Flowgrind
Advanced TCP traffic generator
fg_affinity.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2014 Alexander Zimmermann <alexander.zimmermann@netapp.com>
8  *
9  * This file is part of Flowgrind.
10  *
11  * Flowgrind is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * Flowgrind is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with Flowgrind. If not, see <http://www.gnu.org/licenses/>.
23  *
24  */
25 
26 #ifndef _FG_AFFINITY_H_
27 #define _FG_AFFINITY_H_
28 
29 #ifdef HAVE_CONFIG_H
30 #include "config.h"
31 #endif /* HAVE_CONFIG_H */
32 
33 #include <pthread.h>
34 
41 };
42 
50 int get_ncores(enum ncore_query query);
51 
59 int pthread_setaffinity(pthread_t thread, unsigned core);
60 
69 int pthread_getaffinity(pthread_t thread, unsigned *core);
70 
71 #endif /* _FG_AFFINITY_H_ */
ncore_query
ncore_query
Query type for get_ncores().
Definition: fg_affinity.h:36
NCORE_CONFIG
@ NCORE_CONFIG
Total number of processors configured.
Definition: fg_affinity.h:38
get_ncores
int get_ncores(enum ncore_query query)
Return either the total number of configured or available cores.
Definition: fg_affinity.c:56
NCORE_CURRENT
@ NCORE_CURRENT
Processors available to the current process.
Definition: fg_affinity.h:40
pthread_setaffinity
int pthread_setaffinity(pthread_t thread, unsigned core)
Set CPU affinity of the thread thread to the core core.
Definition: fg_affinity.c:75
core
static int core
CPU core to which flowgrindd should bind to.
Definition: flowgrindd.c:101
config.h
pthread_getaffinity
int pthread_getaffinity(pthread_t thread, unsigned *core)
Returns the CPU affinity of thread thread in the buffer pointed to by core.
Definition: fg_affinity.c:85