1 #ifndef __PERF_CONFIG_H
2 #define __PERF_CONFIG_H
5 #include <linux/list.h>
7 struct perf_config_item
{
10 bool from_system_config
;
11 struct list_head node
;
14 struct perf_config_section
{
16 struct list_head items
;
17 bool from_system_config
;
18 struct list_head node
;
21 struct perf_config_set
{
22 struct list_head sections
;
25 extern const char *config_exclusive_filename
;
27 typedef int (*config_fn_t
)(const char *, const char *, void *);
28 int perf_default_config(const char *, const char *, void *);
29 int perf_config(config_fn_t fn
, void *);
30 int perf_config_int(const char *, const char *);
31 u64
perf_config_u64(const char *, const char *);
32 int perf_config_bool(const char *, const char *);
33 int config_error_nonbool(const char *);
34 const char *perf_etc_perfconfig(void);
36 struct perf_config_set
*perf_config_set__new(void);
37 void perf_config_set__delete(struct perf_config_set
*set
);
38 int perf_config_set__collect(struct perf_config_set
*set
, const char *file_name
,
39 const char *var
, const char *value
);
40 void perf_config__init(void);
41 void perf_config__exit(void);
42 void perf_config__refresh(void);
45 * perf_config_sections__for_each - iterate thru all the sections
46 * @list: list_head instance to iterate
47 * @section: struct perf_config_section iterator
49 #define perf_config_sections__for_each_entry(list, section) \
50 list_for_each_entry(section, list, node)
53 * perf_config_items__for_each - iterate thru all the items
54 * @list: list_head instance to iterate
55 * @item: struct perf_config_item iterator
57 #define perf_config_items__for_each_entry(list, item) \
58 list_for_each_entry(item, list, node)
61 * perf_config_set__for_each - iterate thru all the config section-item pairs
62 * @set: evlist instance to iterate
63 * @section: struct perf_config_section iterator
64 * @item: struct perf_config_item iterator
66 #define perf_config_set__for_each_entry(set, section, item) \
67 perf_config_sections__for_each_entry(&set->sections, section) \
68 perf_config_items__for_each_entry(§ion->items, item)
70 #endif /* __PERF_CONFIG_H */