perf probe: Use cache entry if possible
[deliverable/linux.git] / tools / perf / util / config.h
CommitLineData
20105ca1
TS
1#ifndef __PERF_CONFIG_H
2#define __PERF_CONFIG_H
3
4#include <stdbool.h>
5#include <linux/list.h>
6
7struct perf_config_item {
8 char *name;
9 char *value;
10 struct list_head node;
11};
12
13struct perf_config_section {
14 char *name;
15 struct list_head items;
16 struct list_head node;
17};
18
19struct perf_config_set {
20 struct list_head sections;
21};
22
41840d21
TS
23extern const char *config_exclusive_filename;
24
25typedef int (*config_fn_t)(const char *, const char *, void *);
26int perf_default_config(const char *, const char *, void *);
27int perf_config(config_fn_t fn, void *);
28int perf_config_int(const char *, const char *);
29u64 perf_config_u64(const char *, const char *);
30int perf_config_bool(const char *, const char *);
31int config_error_nonbool(const char *);
32const char *perf_etc_perfconfig(void);
33
20105ca1
TS
34struct perf_config_set *perf_config_set__new(void);
35void perf_config_set__delete(struct perf_config_set *set);
8a0a9c7e
TS
36void perf_config__init(void);
37void perf_config__exit(void);
38void perf_config__refresh(void);
39
40/**
41 * perf_config_sections__for_each - iterate thru all the sections
42 * @list: list_head instance to iterate
43 * @section: struct perf_config_section iterator
44 */
45#define perf_config_sections__for_each_entry(list, section) \
46 list_for_each_entry(section, list, node)
47
48/**
49 * perf_config_items__for_each - iterate thru all the items
50 * @list: list_head instance to iterate
51 * @item: struct perf_config_item iterator
52 */
53#define perf_config_items__for_each_entry(list, item) \
54 list_for_each_entry(item, list, node)
55
56/**
57 * perf_config_set__for_each - iterate thru all the config section-item pairs
58 * @set: evlist instance to iterate
59 * @section: struct perf_config_section iterator
60 * @item: struct perf_config_item iterator
61 */
62#define perf_config_set__for_each_entry(set, section, item) \
63 perf_config_sections__for_each_entry(&set->sections, section) \
64 perf_config_items__for_each_entry(&section->items, item)
20105ca1
TS
65
66#endif /* __PERF_CONFIG_H */
This page took 0.17193 seconds and 5 git commands to generate.