perf config: Move config declarations from util/cache.h to util/config.h
authorTaeung Song <treeze.taeung@gmail.com>
Thu, 23 Jun 2016 08:55:17 +0000 (17:55 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 23 Jun 2016 11:51:41 +0000 (08:51 -0300)
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>
15 files changed:
tools/perf/builtin-help.c
tools/perf/builtin-kmem.c
tools/perf/builtin-record.c
tools/perf/builtin-report.c
tools/perf/builtin-top.c
tools/perf/perf.c
tools/perf/ui/browser.c
tools/perf/ui/browsers/annotate.c
tools/perf/util/alias.c
tools/perf/util/cache.h
tools/perf/util/color.c
tools/perf/util/config.h
tools/perf/util/help-unknown-cmd.c
tools/perf/util/intel-pt.c
tools/perf/util/llvm-utils.c

index f9830c902b78c6ea59b723d69fa3cb9651a90954..268ab732b8aae9ac0d5b92d9c69bb9aaa7943b52 100644 (file)
@@ -4,7 +4,7 @@
  * Builtin help command
  */
 #include "perf.h"
-#include "util/cache.h"
+#include "util/config.h"
 #include "builtin.h"
 #include <subcmd/exec-cmd.h>
 #include "common-cmds.h"
index 58adfee230de8c2c2d36b5692b1cc668c1af5f01..4defe44a4a836f0bf1847937b630cb287831fd71 100644 (file)
@@ -4,7 +4,7 @@
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/util.h"
-#include "util/cache.h"
+#include "util/config.h"
 #include "util/symbol.h"
 #include "util/thread.h"
 #include "util/header.h"
index b1304ebc8779e604b6eea03627ef6ad3b0c1d717..c97b2b69ba0a2889ca1d7bd082f653f0af918b99 100644 (file)
@@ -13,6 +13,7 @@
 #include "util/util.h"
 #include <subcmd/parse-options.h>
 #include "util/parse-events.h"
+#include "util/config.h"
 
 #include "util/callchain.h"
 #include "util/cgroup.h"
index 9f36b236f0f9b883e07dfbc6eca33a95f8abfe2d..bcb49ff18c1d163d1f4cb501c7371300fbc16320 100644 (file)
@@ -8,7 +8,7 @@
 #include "builtin.h"
 
 #include "util/util.h"
-#include "util/cache.h"
+#include "util/config.h"
 
 #include "util/annotate.h"
 #include "util/color.h"
index 81dba80a42b55f0a476b106fd9056e02f2d40e8c..ec4cba61f3a27910d5d85e6f63b7ae32b2385e50 100644 (file)
@@ -22,7 +22,7 @@
 #include "perf.h"
 
 #include "util/annotate.h"
-#include "util/cache.h"
+#include "util/config.h"
 #include "util/color.h"
 #include "util/evlist.h"
 #include "util/evsel.h"
index 634bf7c6c477b7cd2e7f503aefb992bb51921497..66772dafa3ecc6b6abd4b21ae6473af21d8ddda4 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "util/env.h"
 #include <subcmd/exec-cmd.h>
-#include "util/cache.h"
+#include "util/config.h"
 #include "util/quote.h"
 #include <subcmd/run-command.h>
 #include "util/parse-events.h"
index af68a9d488bfce964c84e67cf5394e7e13daab29..3eb3edb307a4814d1d11346f94117d3c006e87b7 100644 (file)
@@ -1,5 +1,5 @@
 #include "../util.h"
-#include "../cache.h"
+#include "../config.h"
 #include "../../perf.h"
 #include "libslang.h"
 #include "ui.h"
index 4fc208e82c6fc7b28d99af147d1c75738bc338e6..0e106bb9752519473df77ab6c0189dda8254ed0d 100644 (file)
@@ -8,6 +8,7 @@
 #include "../../util/sort.h"
 #include "../../util/symbol.h"
 #include "../../util/evsel.h"
+#include "../../util/config.h"
 #include <pthread.h>
 
 struct disasm_line_samples {
index c0b43ee40d95674fb5a5602c6f287ba2d8d8c5f5..6c80f830358b517fdacdce3f8ff7f99051e8a311 100644 (file)
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 
 static const char *alias_key;
 static char *alias_val;
index 369f382eedb608cf9b24598f5f7ba0995a3cc992..9f90e36b56fbea2e151eabdc850c24a168f5b8d7 100644 (file)
 #define PERF_TRACEFS_ENVIRONMENT "PERF_TRACEFS_DIR"
 #define PERF_PAGER_ENVIRONMENT "PERF_PAGER"
 
-extern const char *config_exclusive_filename;
-
-typedef int (*config_fn_t)(const char *, const char *, void *);
-int perf_default_config(const char *, const char *, void *);
-int perf_config(config_fn_t fn, void *);
-int perf_config_int(const char *, const char *);
-u64 perf_config_u64(const char *, const char *);
-int perf_config_bool(const char *, const char *);
-int config_error_nonbool(const char *);
-const char *perf_etc_perfconfig(void);
-
 char *alias_lookup(const char *alias);
 int split_cmdline(char *cmdline, const char ***argv);
 
index 43e84aa27e4a6489eafdebc3636d8bfb33334e3f..1210ba555d07bbc923cf38bcf78673ebdbd0b7ca 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/kernel.h>
 #include "cache.h"
+#include "config.h"
 #include "color.h"
 #include <math.h>
 
index 22ec626ac718851f600a1c4b9a42c1ab00de1d66..155a441343e2d5ff57913960ec60be25dfcabc5e 100644 (file)
@@ -20,6 +20,17 @@ struct perf_config_set {
        struct list_head sections;
 };
 
+extern const char *config_exclusive_filename;
+
+typedef int (*config_fn_t)(const char *, const char *, void *);
+int perf_default_config(const char *, const char *, void *);
+int perf_config(config_fn_t fn, void *);
+int perf_config_int(const char *, const char *);
+u64 perf_config_u64(const char *, const char *);
+int perf_config_bool(const char *, const char *);
+int config_error_nonbool(const char *);
+const char *perf_etc_perfconfig(void);
+
 struct perf_config_set *perf_config_set__new(void);
 void perf_config_set__delete(struct perf_config_set *set);
 
index d62ccaeeadd6e71586479e6d6dc4d84fe7f716f4..776e2856234527fe69778941cf6c884cad213edf 100644 (file)
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include <subcmd/help.h>
 #include "../builtin.h"
 #include "levenshtein.h"
index 137196990012727781728b080cb5c4b799e3332d..a2fe3a2194cc19180e9b11709fda4013985ade4a 100644 (file)
@@ -39,6 +39,7 @@
 #include "auxtrace.h"
 #include "tsc.h"
 #include "intel-pt.h"
+#include "config.h"
 
 #include "intel-pt-decoder/intel-pt-log.h"
 #include "intel-pt-decoder/intel-pt-decoder.h"
index 878a566763c3e2c61bb9ff9debef9b3727c90a30..40b6f7269cb4cbc8c905929cd46a35614ca8dfb3 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdlib.h>
 #include "debug.h"
 #include "llvm-utils.h"
+#include "config.h"
 
 #define CLANG_BPF_CMD_DEFAULT_TEMPLATE                         \
                "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\