diff options
author | Taeung Song <treeze.taeung@gmail.com> | 2016-06-23 04:55:17 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-23 07:51:41 -0400 |
commit | 41840d211c518e6af6e327b03e09323824e563bf (patch) | |
tree | 095d4a688e27031a6df219d86eb3d70713566261 | |
parent | 48d8d5db4ac454e590ef7d440f456743d6cbaa94 (diff) |
perf config: Move config declarations from util/cache.h to util/config.h
Lately util/config.h has been added but util/cache.h has declarations of
functions and a global variable for config features.
To manage codes about configuration at one spot, move them to
util/config.h and let source files that need config features include
config.h And if the source files that included previous cache.h need
only config.h, remove including cache.h.
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1466672119-4852-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-help.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-kmem.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/perf.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/browser.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 1 | ||||
-rw-r--r-- | tools/perf/util/alias.c | 1 | ||||
-rw-r--r-- | tools/perf/util/cache.h | 11 | ||||
-rw-r--r-- | tools/perf/util/color.c | 1 | ||||
-rw-r--r-- | tools/perf/util/config.h | 11 | ||||
-rw-r--r-- | tools/perf/util/help-unknown-cmd.c | 1 | ||||
-rw-r--r-- | tools/perf/util/intel-pt.c | 1 | ||||
-rw-r--r-- | tools/perf/util/llvm-utils.c | 1 |
15 files changed, 24 insertions, 17 deletions
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index f9830c902b78..268ab732b8aa 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Builtin help command | 4 | * Builtin help command |
5 | */ | 5 | */ |
6 | #include "perf.h" | 6 | #include "perf.h" |
7 | #include "util/cache.h" | 7 | #include "util/config.h" |
8 | #include "builtin.h" | 8 | #include "builtin.h" |
9 | #include <subcmd/exec-cmd.h> | 9 | #include <subcmd/exec-cmd.h> |
10 | #include "common-cmds.h" | 10 | #include "common-cmds.h" |
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 58adfee230de..4defe44a4a83 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -4,7 +4,7 @@ | |||
4 | #include "util/evlist.h" | 4 | #include "util/evlist.h" |
5 | #include "util/evsel.h" | 5 | #include "util/evsel.h" |
6 | #include "util/util.h" | 6 | #include "util/util.h" |
7 | #include "util/cache.h" | 7 | #include "util/config.h" |
8 | #include "util/symbol.h" | 8 | #include "util/symbol.h" |
9 | #include "util/thread.h" | 9 | #include "util/thread.h" |
10 | #include "util/header.h" | 10 | #include "util/header.h" |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index b1304ebc8779..c97b2b69ba0a 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "util/util.h" | 13 | #include "util/util.h" |
14 | #include <subcmd/parse-options.h> | 14 | #include <subcmd/parse-options.h> |
15 | #include "util/parse-events.h" | 15 | #include "util/parse-events.h" |
16 | #include "util/config.h" | ||
16 | 17 | ||
17 | #include "util/callchain.h" | 18 | #include "util/callchain.h" |
18 | #include "util/cgroup.h" | 19 | #include "util/cgroup.h" |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 9f36b236f0f9..bcb49ff18c1d 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include "builtin.h" | 8 | #include "builtin.h" |
9 | 9 | ||
10 | #include "util/util.h" | 10 | #include "util/util.h" |
11 | #include "util/cache.h" | 11 | #include "util/config.h" |
12 | 12 | ||
13 | #include "util/annotate.h" | 13 | #include "util/annotate.h" |
14 | #include "util/color.h" | 14 | #include "util/color.h" |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 81dba80a42b5..ec4cba61f3a2 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "perf.h" | 22 | #include "perf.h" |
23 | 23 | ||
24 | #include "util/annotate.h" | 24 | #include "util/annotate.h" |
25 | #include "util/cache.h" | 25 | #include "util/config.h" |
26 | #include "util/color.h" | 26 | #include "util/color.h" |
27 | #include "util/evlist.h" | 27 | #include "util/evlist.h" |
28 | #include "util/evsel.h" | 28 | #include "util/evsel.h" |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 634bf7c6c477..66772dafa3ec 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include "util/env.h" | 11 | #include "util/env.h" |
12 | #include <subcmd/exec-cmd.h> | 12 | #include <subcmd/exec-cmd.h> |
13 | #include "util/cache.h" | 13 | #include "util/config.h" |
14 | #include "util/quote.h" | 14 | #include "util/quote.h" |
15 | #include <subcmd/run-command.h> | 15 | #include <subcmd/run-command.h> |
16 | #include "util/parse-events.h" | 16 | #include "util/parse-events.h" |
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index af68a9d488bf..3eb3edb307a4 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include "../util.h" | 1 | #include "../util.h" |
2 | #include "../cache.h" | 2 | #include "../config.h" |
3 | #include "../../perf.h" | 3 | #include "../../perf.h" |
4 | #include "libslang.h" | 4 | #include "libslang.h" |
5 | #include "ui.h" | 5 | #include "ui.h" |
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 4fc208e82c6f..0e106bb97525 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "../../util/sort.h" | 8 | #include "../../util/sort.h" |
9 | #include "../../util/symbol.h" | 9 | #include "../../util/symbol.h" |
10 | #include "../../util/evsel.h" | 10 | #include "../../util/evsel.h" |
11 | #include "../../util/config.h" | ||
11 | #include <pthread.h> | 12 | #include <pthread.h> |
12 | 13 | ||
13 | struct disasm_line_samples { | 14 | struct disasm_line_samples { |
diff --git a/tools/perf/util/alias.c b/tools/perf/util/alias.c index c0b43ee40d95..6c80f830358b 100644 --- a/tools/perf/util/alias.c +++ b/tools/perf/util/alias.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include "cache.h" | 1 | #include "cache.h" |
2 | #include "config.h" | ||
2 | 3 | ||
3 | static const char *alias_key; | 4 | static const char *alias_key; |
4 | static char *alias_val; | 5 | static char *alias_val; |
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h index 369f382eedb6..9f90e36b56fb 100644 --- a/tools/perf/util/cache.h +++ b/tools/perf/util/cache.h | |||
@@ -18,17 +18,6 @@ | |||
18 | #define PERF_TRACEFS_ENVIRONMENT "PERF_TRACEFS_DIR" | 18 | #define PERF_TRACEFS_ENVIRONMENT "PERF_TRACEFS_DIR" |
19 | #define PERF_PAGER_ENVIRONMENT "PERF_PAGER" | 19 | #define PERF_PAGER_ENVIRONMENT "PERF_PAGER" |
20 | 20 | ||
21 | extern const char *config_exclusive_filename; | ||
22 | |||
23 | typedef int (*config_fn_t)(const char *, const char *, void *); | ||
24 | int perf_default_config(const char *, const char *, void *); | ||
25 | int perf_config(config_fn_t fn, void *); | ||
26 | int perf_config_int(const char *, const char *); | ||
27 | u64 perf_config_u64(const char *, const char *); | ||
28 | int perf_config_bool(const char *, const char *); | ||
29 | int config_error_nonbool(const char *); | ||
30 | const char *perf_etc_perfconfig(void); | ||
31 | |||
32 | char *alias_lookup(const char *alias); | 21 | char *alias_lookup(const char *alias); |
33 | int split_cmdline(char *cmdline, const char ***argv); | 22 | int split_cmdline(char *cmdline, const char ***argv); |
34 | 23 | ||
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c index 43e84aa27e4a..1210ba555d07 100644 --- a/tools/perf/util/color.c +++ b/tools/perf/util/color.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
2 | #include "cache.h" | 2 | #include "cache.h" |
3 | #include "config.h" | ||
3 | #include "color.h" | 4 | #include "color.h" |
4 | #include <math.h> | 5 | #include <math.h> |
5 | 6 | ||
diff --git a/tools/perf/util/config.h b/tools/perf/util/config.h index 22ec626ac718..155a441343e2 100644 --- a/tools/perf/util/config.h +++ b/tools/perf/util/config.h | |||
@@ -20,6 +20,17 @@ struct perf_config_set { | |||
20 | struct list_head sections; | 20 | struct list_head sections; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | extern const char *config_exclusive_filename; | ||
24 | |||
25 | typedef int (*config_fn_t)(const char *, const char *, void *); | ||
26 | int perf_default_config(const char *, const char *, void *); | ||
27 | int perf_config(config_fn_t fn, void *); | ||
28 | int perf_config_int(const char *, const char *); | ||
29 | u64 perf_config_u64(const char *, const char *); | ||
30 | int perf_config_bool(const char *, const char *); | ||
31 | int config_error_nonbool(const char *); | ||
32 | const char *perf_etc_perfconfig(void); | ||
33 | |||
23 | struct perf_config_set *perf_config_set__new(void); | 34 | struct perf_config_set *perf_config_set__new(void); |
24 | void perf_config_set__delete(struct perf_config_set *set); | 35 | void perf_config_set__delete(struct perf_config_set *set); |
25 | 36 | ||
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c index d62ccaeeadd6..776e28562345 100644 --- a/tools/perf/util/help-unknown-cmd.c +++ b/tools/perf/util/help-unknown-cmd.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include "cache.h" | 1 | #include "cache.h" |
2 | #include "config.h" | ||
2 | #include <subcmd/help.h> | 3 | #include <subcmd/help.h> |
3 | #include "../builtin.h" | 4 | #include "../builtin.h" |
4 | #include "levenshtein.h" | 5 | #include "levenshtein.h" |
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 137196990012..a2fe3a2194cc 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "auxtrace.h" | 39 | #include "auxtrace.h" |
40 | #include "tsc.h" | 40 | #include "tsc.h" |
41 | #include "intel-pt.h" | 41 | #include "intel-pt.h" |
42 | #include "config.h" | ||
42 | 43 | ||
43 | #include "intel-pt-decoder/intel-pt-log.h" | 44 | #include "intel-pt-decoder/intel-pt-log.h" |
44 | #include "intel-pt-decoder/intel-pt-decoder.h" | 45 | #include "intel-pt-decoder/intel-pt-decoder.h" |
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c index 878a566763c3..40b6f7269cb4 100644 --- a/tools/perf/util/llvm-utils.c +++ b/tools/perf/util/llvm-utils.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include "debug.h" | 9 | #include "debug.h" |
10 | #include "llvm-utils.h" | 10 | #include "llvm-utils.h" |
11 | #include "config.h" | ||
11 | 12 | ||
12 | #define CLANG_BPF_CMD_DEFAULT_TEMPLATE \ | 13 | #define CLANG_BPF_CMD_DEFAULT_TEMPLATE \ |
13 | "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\ | 14 | "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\ |