Go to the source code of this file.
Defines | |
#define | topology_for_each_device_of_type(ctx, dev, type) |
Typedefs | |
typedef unsigned long | topo_context_t |
typedef unsigned long | topo_procent_t |
typedef unsigned long | topo_device_t |
typedef enum topology_level | topo_level_t |
Enumerations | |
enum | topology_level { TOPOLOGY_THREAD = 1, TOPOLOGY_CORE, TOPOLOGY_PACKAGE, TOPOLOGY_NODE, TOPOLOGY_SYSTEM } |
Functions | |
int | topology_init_context (topo_context_t *ctx, topo_procent_t *system) |
void | topology_free_context (topo_context_t ctx) |
size_t | topology_sizeof_cpumask (topo_context_t ctx) |
topo_procent_t | topology_traverse (topo_procent_t start, topo_procent_t iter, topo_level_t to_level) |
void | topology_procent_cpumask (topo_procent_t ent, cpu_set_t *dest) |
topo_device_t | topology_find_device_by_type (topo_context_t ctx, topo_device_t prev, const char *type) |
void | topology_device_cpumask (topo_device_t dev, cpu_set_t *dest) |
const char * | topology_device_get_attribute (topo_device_t dev, const char *name) |
The libtopology API allows one to formulate scheduling and NUMA policies in terms that are abstract and portable.
#define topology_for_each_device_of_type | ( | ctx, | |||
dev, | |||||
type | ) |
Value:
for ((dev) = topology_find_device_by_type((ctx), (topo_device_t)0, (type)); \ (dev) != 0; \ (dev) = topology_find_device_by_type((ctx), (dev), (type)))
ctx | - Topology context in use | |
dev | - struct topo_device * iterator | |
type | - type string, e.g. "cache" |
int topology_init_context | ( | topo_context_t * | ctx, | |
topo_procent_t * | system | |||
) |
topology_init_context() - Allocate a topology context
ctx | - address of topo_context_t | |
system | - address of system topo_procent_t |
On failure the contents of ctx and system are unspecified.
void topology_free_context | ( | topo_context_t | ctx | ) |
topology_free_context() - Release a topology context
ctx | - context to release |
size_t topology_sizeof_cpumask | ( | topo_context_t | ctx | ) |
topology_sizeof_cpumask() - get the size of cpumasks used by libtopology
ctx | - a valid context returned from topology_init_context() |
topo_procent_t topology_traverse | ( | topo_procent_t | start, | |
topo_procent_t | iter, | |||
topo_level_t | to_level | |||
) |
topology_traverse() - traverse from one processor entity to others
start | - starting point in procent hierarchy | |
iter | - value returned from previous call to topology_traverse(), or 0 | |
to_level | - the topology_level value which returned objects must match |
void topology_procent_cpumask | ( | topo_procent_t | ent, | |
cpu_set_t * | dest | |||
) |
topology_procent_cpumask() - copy a topo_procent_t's cpumask
ent | - topo_procent_t to query | |
dest | - pointer to cpu_set_t allocated by the caller |
topo_device_t topology_find_device_by_type | ( | topo_context_t | ctx, | |
topo_device_t | prev, | |||
const char * | type | |||
) |
topology_find_device_by_type() - Iterate from one device to the next of the given type
ctx | - Topology context in use | |
prev | - 0, or a topo_device_t returned by a previous call to topology_find_device_by_type() | |
type | - type string, e.g. "cache" |
void topology_device_cpumask | ( | topo_device_t | dev, | |
cpu_set_t * | dest | |||
) |
topology_device_cpumask() - copy a topo_device_t's cpumask
dev | - topo_device_t to query | |
dest | - pointer to cpu_set_t allocated by the caller |
const char* topology_device_get_attribute | ( | topo_device_t | dev, | |
const char * | name | |||
) |
topology_device_get_attribute - query the properties of a device
dev | - topo_device * | |
name | - string identifying the attribute |