perf tools: Remove needless includes from cache.h

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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 16b7c9bd
#include <stdio.h> #include <stdio.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include "common.h" #include "common.h"
#include "../util/util.h"
#include "../util/debug.h" #include "../util/debug.h"
const char *const arm_triplets[] = { const char *const arm_triplets[] = {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "llvm.h" #include "llvm.h"
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
#include "util.h"
#ifdef HAVE_LIBBPF_SUPPORT #ifdef HAVE_LIBBPF_SUPPORT
static int test__bpf_parsing(void *obj_buf, size_t obj_buf_sz) static int test__bpf_parsing(void *obj_buf, size_t obj_buf_sz)
......
#include "../util.h" #include "../util.h"
#include "../../util/util.h"
#include "../../util/debug.h" #include "../../util/debug.h"
#include "gtk.h" #include "gtk.h"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "../debug.h" #include "../debug.h"
#include "helpline.h" #include "helpline.h"
#include "ui.h" #include "ui.h"
#include "../util.h"
char ui_helpline__current[512]; char ui_helpline__current[512];
......
#include <errno.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#ifdef HAVE_BACKTRACE_SUPPORT #ifdef HAVE_BACKTRACE_SUPPORT
...@@ -6,6 +7,7 @@ ...@@ -6,6 +7,7 @@
#include "../../util/cache.h" #include "../../util/cache.h"
#include "../../util/debug.h" #include "../../util/debug.h"
#include "../../util/util.h"
#include "../browser.h" #include "../browser.h"
#include "../helpline.h" #include "../helpline.h"
#include "../ui.h" #include "../ui.h"
......
#include "cache.h" #include "cache.h"
#include "util.h"
#include "config.h" #include "config.h"
static const char *alias_key; static const char *alias_key;
......
#ifndef __PERF_CACHE_H #ifndef __PERF_CACHE_H
#define __PERF_CACHE_H #define __PERF_CACHE_H
#include <stdbool.h>
#include "util.h"
#include "strbuf.h" #include "strbuf.h"
#include <subcmd/pager.h> #include <subcmd/pager.h>
#include "../perf.h"
#include "../ui/ui.h" #include "../ui/ui.h"
#include <linux/string.h> #include <linux/string.h>
......
#include "cache.h"
#include "levenshtein.h" #include "levenshtein.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
/* /*
* This function implements the Damerau-Levenshtein algorithm to * This function implements the Damerau-Levenshtein algorithm to
......
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
* Copyright (C) 2015, Huawei Inc. * Copyright (C) 2015, Huawei Inc.
*/ */
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "debug.h" #include "debug.h"
#include "llvm-utils.h" #include "llvm-utils.h"
#include "config.h" #include "config.h"
#include "util.h"
#define CLANG_BPF_CMD_DEFAULT_TEMPLATE \ #define CLANG_BPF_CMD_DEFAULT_TEMPLATE \
"$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\ "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* which is what it's designed for. * which is what it's designed for.
*/ */
#include "cache.h" #include "cache.h"
#include "util.h"
#include <limits.h>
static char bad_path[] = "/bad-path/"; static char bad_path[] = "/bad-path/";
/* /*
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include "target.h" #include "target.h"
#include "util.h"
#include "debug.h" #include "debug.h"
#include <pwd.h> #include <pwd.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment