Skip to content

Commit

Permalink
perf debug: Remove needless include directives from debug.h
Browse files Browse the repository at this point in the history
All we need there is a forward declaration for 'union perf_event', so
remove it from there and add missing header directives in places using
things from this indirect include.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-7ftk0ztstqub1tirjj8o8xbl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Aug 31, 2019
1 parent b420902 commit 8520a98
Show file tree
Hide file tree
Showing 75 changed files with 104 additions and 6 deletions.
1 change: 1 addition & 0 deletions tools/perf/arch/arm/util/cs-etm.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/coresight-pmu.h>
#include <linux/kernel.h>
#include <linux/log2.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/zalloc.h>

Expand Down
2 changes: 2 additions & 0 deletions tools/perf/arch/common.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "common.h"
#include "../util/env.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/arch/x86/tests/bp-modify.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ptrace.h>
#include <asm/ptrace.h>
#include <errno.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/arch/x86/tests/insn-x86.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include <string.h>

#include "debug.h"
#include "tests/tests.h"
Expand Down
2 changes: 2 additions & 0 deletions tools/perf/arch/x86/tests/rdpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <linux/string.h>
#include <linux/types.h>
#include "perf-sys.h"
#include "debug.h"
#include "tests/tests.h"
#include "cloexec.h"
#include "event.h"
#include "util.h"
#include "arch-tests.h"

Expand Down
1 change: 1 addition & 0 deletions tools/perf/arch/x86/util/perf_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "../../perf-sys.h"
#include "../../util/perf_regs.h"
#include "../../util/debug.h"
#include "../../util/event.h"

const struct sample_reg sample_reg_masks[] = {
SMPL_REG(AX, PERF_REG_X86_AX),
Expand Down
2 changes: 2 additions & 0 deletions tools/perf/builtin-c2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sys/param.h>
#include "debug.h"
#include "builtin.h"
#include <subcmd/pager.h>
#include <subcmd/parse-options.h>
#include "mem-events.h"
#include "session.h"
Expand All @@ -35,6 +36,7 @@
#include "thread.h"
#include "mem2node.h"
#include "symbol.h"
#include "ui/ui.h"
#include "../perf.h"

struct c2c_hists {
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "util/debug.h"
#include "util/config.h"
#include <linux/string.h>
#include <stdio.h>
#include <stdlib.h>

static bool use_system_config, use_user_config;
Expand Down
2 changes: 2 additions & 0 deletions tools/perf/builtin-data.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <stdio.h>
#include <string.h>
#include "builtin.h"
#include "perf.h"
#include "debug.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "util/annotate.h"
#include "util/map.h"
#include <linux/zalloc.h>
#include <subcmd/pager.h>
#include <subcmd/parse-options.h>

#include <errno.h>
Expand Down
3 changes: 2 additions & 1 deletion tools/perf/builtin-ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#include <fcntl.h>
#include <poll.h>
#include <linux/capability.h>
#include <linux/string.h>

#include "debug.h"
#include <subcmd/pager.h>
#include <subcmd/parse-options.h>
#include <api/fs/tracing_path.h>
#include "evlist.h"
Expand All @@ -24,7 +26,6 @@
#include "util/cap.h"
#include "util/config.h"


#define DEFAULT_TRACER "function_graph"

struct perf_ftrace {
Expand Down
4 changes: 4 additions & 0 deletions tools/perf/builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*
* Builtin help command
*/
#include "util/cache.h"
#include "util/config.h"
#include "util/strbuf.h"
#include "builtin.h"
#include <subcmd/exec-cmd.h>
#include "common-cmds.h"
Expand All @@ -13,10 +15,12 @@
#include <subcmd/help.h>
#include "util/debug.h"
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/zalloc.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "util/callchain.h"
#include "util/time-utils.h"

#include <subcmd/pager.h>
#include <subcmd/parse-options.h>
#include "util/trace-event.h"
#include "util/data.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "util/debug.h"
#include "util/metricgroup.h"
#include <subcmd/parse-options.h>
#include <stdio.h>

static bool desc_flag = true;
static bool details_flag;
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "util/probe-finder.h"
#include "util/probe-event.h"
#include "util/probe-file.h"
#include <linux/string.h>
#include <linux/zalloc.h>

#define DEFAULT_VAR_FILTER "!__k???tab_* & !__crc_*"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <signal.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <linux/string.h>
#include <linux/time64.h>
#include <linux/zalloc.h>

Expand Down
2 changes: 2 additions & 0 deletions tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "util/units.h"
#include "util/branch.h"
#include "util/util.h"
#include "ui/ui.h"

#include <dlfcn.h>
#include <errno.h>
Expand All @@ -53,6 +54,7 @@
#include <linux/ctype.h>
#include <signal.h>
#include <linux/bitmap.h>
#include <linux/string.h>
#include <linux/stringify.h>
#include <linux/time64.h>
#include <sys/types.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "util/intlist.h"
#include "util/parse-branch-options.h"
#include "arch/common.h"
#include "ui/ui.h"

#include "util/debug.h"
#include "util/ordered-events.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "util/event.h"
#include "util/evlist.h"
#include "util/evswitch.h"
#include <subcmd/pager.h>
#include <subcmd/exec-cmd.h>
#include "util/machine.h"
#include "util/map.h"
Expand Down
2 changes: 2 additions & 0 deletions tools/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "builtin.h"
#include "perf.h"

#include "util/cache.h"
#include "util/env.h"
#include <subcmd/exec-cmd.h>
#include "util/config.h"
Expand All @@ -32,6 +33,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/zalloc.h>

const char perf_usage_string[] =
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <unistd.h>
#include "../perf-sys.h"
#include <subcmd/exec-cmd.h>
#include "event.h"
#include "tests.h"

#define ENV "PERF_TEST_ATTR"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/backward-ring-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "tests.h"
#include "debug.h"
#include <errno.h>
#include <linux/string.h>

#define NR_ITERS 111

Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/bp_account.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "tests.h"
#include "debug.h"
#include "event.h"
#include "../perf-sys.h"
#include "cloexec.h"

Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/bp_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "tests.h"
#include "debug.h"
#include "event.h"
#include "perf-sys.h"
#include "cloexec.h"

Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/bp_signal_overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "tests.h"
#include "debug.h"
#include "event.h"
#include "../perf-sys.h"
#include "cloexec.h"

Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/bpf.h>
#include <linux/filter.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <api/fs/fs.h>
#include <bpf/bpf.h>
#include "tests.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/event-times.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/string.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "util/expr.h"
#include "tests.h"
#include <stdlib.h>
#include <string.h>
#include <linux/zalloc.h>

static int test(struct parse_ctx *ctx, const char *e, double val2)
Expand Down
2 changes: 2 additions & 0 deletions tools/perf/tests/kmod-path.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "tests.h"
#include "dso.h"
#include "debug.h"
#include "event.h"

static int test(const char *path, bool alloc_name, bool kmod,
int comp, const char *name)
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/mmap-basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "tests.h"
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <perf/evlist.h>

/*
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/openat-syscall-all-cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <fcntl.h>
#include <api/fs/fs.h>
#include <linux/err.h>
#include <linux/string.h>
#include <api/fs/tracing_path.h>
#include "evsel.h"
#include "tests.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/openat-syscall-tp-fields.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdbool.h>
#include <linux/err.h>
#include <linux/string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/openat-syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <inttypes.h>
#include <api/fs/tracing_path.h>
#include <linux/err.h>
#include <linux/string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/perf-record.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <linux/string.h>
/* For the CLR_() macros */
#include <pthread.h>

Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/sample-parsing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdbool.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/types.h>
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/task-exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <errno.h>
#include <signal.h>
#include <linux/string.h>
#include <perf/evlist.h>

static int exited;
Expand Down
7 changes: 7 additions & 0 deletions tools/perf/tests/thread-map.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/prctl.h>
#include "tests.h"
#include "thread_map.h"
#include "debug.h"
#include "event.h"
#include <linux/zalloc.h>
#include <perf/event.h>

struct perf_sample;
struct perf_tool;
struct machine;

#define NAME (const char *) "perf"
#define NAMEUL (unsigned long) NAME
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/unit_number__scnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <string.h>
#include "tests.h"
#include "units.h"
#include "debug.h"
Expand Down
3 changes: 3 additions & 0 deletions tools/perf/tests/wp.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/hw_breakpoint.h>
#include <linux/kernel.h>
#include "tests.h"
#include "debug.h"
#include "event.h"
#include "cloexec.h"
#include "../perf-sys.h"

Expand Down
1 change: 1 addition & 0 deletions tools/perf/ui/browsers/scripts.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../browser.h"
#include "../libslang.h"
#include "config.h"
#include <linux/string.h>
#include <linux/zalloc.h>

#define SCRIPT_NAMELEN 128
Expand Down
Loading

0 comments on commit 8520a98

Please sign in to comment.