perf tools: Remove needless includes from cache.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 7 Jul 2016 14:38:09 +0000 (11:38 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2016 18:19:58 +0000 (15:19 -0300)
The cache.h header doesn't use any of the definitions in some of the
headers it includes, ditch them and fix the fallout, where files were
getting stuff they needed just because they were including it, sometimes
not using what it really exports at all.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-l6r2bmj8h1g3e01wr981on0n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/common.c
tools/perf/tests/llvm.c
tools/perf/ui/gtk/util.c
tools/perf/ui/helpline.c
tools/perf/ui/tui/setup.c
tools/perf/util/alias.c
tools/perf/util/cache.h
tools/perf/util/levenshtein.c
tools/perf/util/llvm-utils.c
tools/perf/util/path.c
tools/perf/util/target.c

index ee6966812a5a4bfb7d0eb0ffe169b5935f23f308..886dd2aaff0d81533468ad60db70abbd23465ec3 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <sys/utsname.h>
 #include "common.h"
+#include "../util/util.h"
 #include "../util/debug.h"
 
 const char *const arm_triplets[] = {
index cff564fb4b66761f7f7fdcd5ee10727ad3b08726..b798a4bfd23892677b225e41009a784cd4e06d8d 100644 (file)
@@ -5,6 +5,7 @@
 #include "llvm.h"
 #include "tests.h"
 #include "debug.h"
+#include "util.h"
 
 #ifdef HAVE_LIBBPF_SUPPORT
 static int test__bpf_parsing(void *obj_buf, size_t obj_buf_sz)
index 52e7fc48af9f488088785b8e216e05f6b22546fc..00b91921edb1ff9fbb25b8b606f533b30b632762 100644 (file)
@@ -1,4 +1,5 @@
 #include "../util.h"
+#include "../../util/util.h"
 #include "../../util/debug.h"
 #include "gtk.h"
 
index 700fb3cfa1c739128bc0c8009039f48e1f964c93..5b74a7eba210b20cb693dbedaee482508adcd2cd 100644 (file)
@@ -5,6 +5,7 @@
 #include "../debug.h"
 #include "helpline.h"
 #include "ui.h"
+#include "../util.h"
 
 char ui_helpline__current[512];
 
index 7dfeba0a91f37c33c87b826e9ed79ec4ad59869c..4ea2ba861fc2fe6624fff3b67e2c0663015ff91d 100644 (file)
@@ -1,3 +1,4 @@
+#include <errno.h>
 #include <signal.h>
 #include <stdbool.h>
 #ifdef HAVE_BACKTRACE_SUPPORT
@@ -6,6 +7,7 @@
 
 #include "../../util/cache.h"
 #include "../../util/debug.h"
+#include "../../util/util.h"
 #include "../browser.h"
 #include "../helpline.h"
 #include "../ui.h"
index 6c80f830358b517fdacdce3f8ff7f99051e8a311..6455471d9cd1e6dc8386919161a5255ec040f783 100644 (file)
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "util.h"
 #include "config.h"
 
 static const char *alias_key;
index 9f90e36b56fbea2e151eabdc850c24a168f5b8d7..512c0c83fbc6a9a9ed2a9c996de74ff6fb45eb62 100644 (file)
@@ -1,11 +1,8 @@
 #ifndef __PERF_CACHE_H
 #define __PERF_CACHE_H
 
-#include <stdbool.h>
-#include "util.h"
 #include "strbuf.h"
 #include <subcmd/pager.h>
-#include "../perf.h"
 #include "../ui/ui.h"
 
 #include <linux/string.h>
index e521d1516df6eac70c6c2b3d9f925dd9708f4907..f616e4f65b6744813bc076c13dd1fd51042ad9a7 100644 (file)
@@ -1,5 +1,7 @@
-#include "cache.h"
 #include "levenshtein.h"
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
 
 /*
  * This function implements the Damerau-Levenshtein algorithm to
index 282c30f6a51d93e03d7e32962735dc3f4c2026c2..bf7216b8731ddbbeb9326181857962d54c6c3d03 100644 (file)
@@ -3,12 +3,14 @@
  * Copyright (C) 2015, Huawei Inc.
  */
 
+#include <errno.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "debug.h"
 #include "llvm-utils.h"
 #include "config.h"
+#include "util.h"
 
 #define CLANG_BPF_CMD_DEFAULT_TEMPLATE                         \
                "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
index cff8bf0f87e8e3708b5fd0464a86a2c44010cbc9..7c7630be5a897d651bbda7eaf2e0c4addcf95a03 100644 (file)
@@ -11,6 +11,8 @@
  * which is what it's designed for.
  */
 #include "cache.h"
+#include "util.h"
+#include <limits.h>
 
 static char bad_path[] = "/bad-path/";
 /*
index 5898af4510ccf1cb8e8ed8fed93405fdde4e1a0d..8cdcf4641c51de6a1f5a4df597280be97833c07e 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include "target.h"
+#include "util.h"
 #include "debug.h"
 
 #include <pwd.h>