]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libbenchmark/inc/libbenchmark/libbenchmark_topology.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libbenchmark / inc / libbenchmark / libbenchmark_topology.h
1 /***** enums *****/
2 enum libbenchmark_topology_string_format
3 {
4   LIBBENCHMARK_TOPOLOGY_STRING_FORMAT_STDOUT,
5   LIBBENCHMARK_TOPOLOGY_STRING_FORMAT_GNUPLOT
6 };
7
8 enum libbenchmark_topology_numa_mode
9 {
10   LIBBENCHMARK_TOPOLOGY_NUMA_MODE_SMP,
11   LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA,
12   LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA_BUT_NOT_USED
13 };
14
15 enum libbenchmark_topology_query
16 {
17   LIBBENCHMARK_TOPOLOGY_QUERY_GET_NUMBER_OF_NODE_TYPE,
18   LIBBENCHMARK_TOPOLOGY_QUERY_GET_NUMA_NODE_FOR_LOGICAL_PROCESSOR
19 };
20
21 /***** structs *****/
22 struct libbenchmark_topology_state
23 {
24   int
25     line_width;
26
27   struct lfds710_btree_au_state
28     lp_printing_offset_lookup_tree,
29     topology_tree;
30 };
31
32 struct libbenchmark_topology_logical_processor_set
33 {
34   struct lfds710_list_aso_state
35     logical_processors;
36
37   struct lfds710_list_asu_element
38     lasue;
39 };
40
41 struct libbenchmark_topology_iterate_state
42 {
43   enum libbenchmark_topology_node_type
44     type;
45
46   struct lfds710_btree_au_element
47     *baue;
48 };
49
50 struct libbenchmark_topology_numa_node
51 {
52   enum libbenchmark_topology_numa_mode
53     mode;
54
55   struct lfds710_list_asu_element
56     lasue;
57 };
58
59 /***** public prototypes *****/
60 int libbenchmark_topology_init( struct libbenchmark_topology_state *ts, struct libshared_memory_state *ms );
61 void libbenchmark_topology_cleanup( struct libbenchmark_topology_state *ts );
62
63 void libbenchmark_topology_insert( struct libbenchmark_topology_state *ts, struct libbenchmark_topology_node_state *tns );
64
65 int libbenchmark_topology_compare_logical_processor_function( void const *new_key, void const *existing_key );
66
67 void libbenchmark_topology_generate_deduplicated_logical_processor_sets( struct libbenchmark_topology_state *ts, struct libshared_memory_state *ms, struct lfds710_list_asu_state *lp_sets );
68
69 void libbenchmark_topology_generate_numa_modes_list( struct libbenchmark_topology_state *ts, enum libbenchmark_topology_numa_mode numa_mode, struct libshared_memory_state *ms, struct lfds710_list_asu_state *numa_modes_list );
70
71 char *libbenchmark_topology_generate_string( struct libbenchmark_topology_state *ts, struct libshared_memory_state *ms, enum libbenchmark_topology_string_format format );
72 char *libbenchmark_topology_generate_lpset_string( struct libbenchmark_topology_state *ts, struct libshared_memory_state *ms, struct lfds710_list_aso_state *lpset );
73
74 int libbenchmark_topology_compare_lp_printing_offsets_function( void const *new_key, void const *existing_key );
75 int libbenchmark_topology_compare_node_against_lp_printing_offset_function( void const *new_key, void const *existing_key );
76
77 void libbenchmark_topology_iterate_init( struct libbenchmark_topology_iterate_state *tis, enum libbenchmark_topology_node_type type );
78 int libbenchmark_topology_iterate( struct libbenchmark_topology_state *ts, struct libbenchmark_topology_iterate_state *tis, struct libbenchmark_topology_node_state **tns );
79
80 void libbenchmark_topology_query( struct libbenchmark_topology_state *ts, enum libbenchmark_topology_query query_type, void *query_input, void *query_output );
81