perf tools: Remove util.h from where it is not needed

Check that it is not needed and remove, fixing up some fallout for
places where it was only serving to get something else.

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-9h6dg6lsqe2usyqjh5rrues4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-09-03 10:56:06 -03:00
parent 4a903c2e15
commit fb71c86cc8
75 changed files with 47 additions and 73 deletions

View File

@ -25,7 +25,7 @@
#include "../../util/evsel.h"
#include "../../util/pmu.h"
#include "../../util/cs-etm.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/session.h"
#include <errno.h>

View File

@ -16,7 +16,7 @@
#include "../../util/evsel.h"
#include "../../util/evlist.h"
#include "../../util/session.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/pmu.h"
#include "../../util/debug.h"
#include "../../util/auxtrace.h"

View File

@ -11,7 +11,6 @@
#include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */
#include <linux/stringify.h>
#include "util.h"
struct pt_regs_dwarfnum {
const char *name;

View File

@ -12,7 +12,6 @@
#include <linux/ptrace.h>
#include <linux/kernel.h>
#include <linux/stringify.h>
#include "util.h"
struct pt_regs_dwarfnum {
const char *name;

View File

@ -6,7 +6,6 @@
#include <string.h>
#include <linux/stringify.h>
#include "header.h"
#include "util.h"
#define mfspr(rn) ({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \

View File

@ -2,7 +2,7 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "util.h"
#include "util.h" // page_size
#include "machine.h"
#include "api/fs/fs.h"
#include "debug.h"

View File

@ -5,7 +5,6 @@
#include "evlist.h"
#include "evsel.h"
#include "arch-tests.h"
#include "util.h"
#include <signal.h>
#include <sys/mman.h>

View File

@ -13,7 +13,7 @@
#include "tests/tests.h"
#include "cloexec.h"
#include "event.h"
#include "util.h"
#include "util.h" // page_size
#include "arch-tests.h"
static u64 rdpmc(unsigned int counter)

View File

@ -22,7 +22,7 @@
#include "../../util/tsc.h"
#include "../../util/auxtrace.h"
#include "../../util/intel-bts.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#define KiB(x) ((x) * 1024)
#define MiB(x) ((x) * 1024 * 1024)

View File

@ -26,7 +26,7 @@
#include "../../util/record.h"
#include "../../util/target.h"
#include "../../util/tsc.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/intel-pt.h"
#define KiB(x) ((x) * 1024)

View File

@ -3,7 +3,7 @@
#include <linux/string.h>
#include <stdlib.h>
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/machine.h"
#include "../../util/map.h"
#include "../../util/symbol.h"

View File

@ -10,7 +10,6 @@
*
*/
#include "../util/util.h"
#include <subcmd/parse-options.h>
#include "bench.h"

View File

@ -9,7 +9,6 @@
* http://people.redhat.com/mingo/cfs-scheduler/tools/pipe-test-1m.c
* Ported to perf by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
*/
#include "../util/util.h"
#include <subcmd/parse-options.h>
#include "bench.h"

View File

@ -9,7 +9,6 @@
#include "util/cache.h"
#include <subcmd/parse-options.h>
#include "util/util.h"
#include "util/debug.h"
#include "util/config.h"
#include <linux/string.h>

View File

@ -5,8 +5,6 @@
*/
#include "builtin.h"
#include "util/util.h"
#include <linux/list.h>
#include "perf.h"

View File

@ -48,7 +48,7 @@
#include "util/auxtrace.h"
#include "util/units.h"
#include "util/branch.h"
#include "util/util.h"
#include "util/util.h" // perf_tip()
#include "ui/ui.h"
#include "ui/progress.h"

View File

@ -20,7 +20,7 @@
#include "util/bpf-loader.h"
#include "util/debug.h"
#include "util/event.h"
#include "util/util.h"
#include "util/util.h" // page_size, usage()
#include "ui/ui.h"
#include "perf-sys.h"
#include <api/fs/fs.h>

View File

@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include "tests.h"
#include "util.h"
#include "c++/clang-c.h"
#include <linux/kernel.h>

View File

@ -10,7 +10,6 @@
#include <sys/resource.h>
#include <api/fs/fs.h>
#include "dso.h"
#include "util.h"
#include "machine.h"
#include "symbol.h"
#include "tests.h"

View File

@ -9,7 +9,6 @@
#include "tests.h"
#include "evlist.h"
#include "evsel.h"
#include "util.h"
#include "debug.h"
#include "parse-events.h"
#include "thread_map.h"

View File

@ -7,7 +7,6 @@
#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)

View File

@ -14,7 +14,7 @@
#include "map.h"
#include "symbol.h"
#include "thread.h"
#include "util.h"
#include "util.h" // page_size
#define THREADS 4

View File

@ -6,7 +6,6 @@
#include "tests.h"
#include "debug.h"
#include "pmu.h"
#include "util.h"
#include <dirent.h>
#include <errno.h>
#include <sys/types.h>

View File

@ -1,4 +1,3 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include <linux/types.h>
#include <stddef.h>
@ -8,7 +7,6 @@
#include "event.h"
#include "evlist.h"
#include "header.h"
#include "util.h"
#include "debug.h"
static int process_event(struct evlist **pevlist, union perf_event *event)

View File

@ -4,7 +4,6 @@
#include "tests.h"
#include "debug.h"
#include "util.h"
#include "perf-hooks.h"
static void sigsegv_handler(int sig __maybe_unused)

View File

@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include "parse-events.h"
#include "pmu.h"
#include "util.h"
#include "tests.h"
#include <errno.h>
#include <stdio.h>

View File

@ -9,7 +9,6 @@
#include "map_symbol.h"
#include "branch.h"
#include "util.h"
#include "event.h"
#include "evsel.h"
#include "debug.h"

View File

@ -4,7 +4,6 @@
#include <stdio.h>
#include <perf/cpumap.h>
#include "tests.h"
#include "util.h"
#include "session.h"
#include "evlist.h"
#include "debug.h"

View File

@ -7,7 +7,7 @@
#include "dso.h"
#include "map.h"
#include "symbol.h"
#include "util.h"
#include "util.h" // page_size
#include "tests.h"
#include "debug.h"
#include "machine.h"

View File

@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include "../util/util.h"
#include "../util/string2.h"
#include "../util/config.h"
#include "libslang.h"

View File

@ -2,7 +2,6 @@
#include "../browser.h"
#include "../helpline.h"
#include "../ui.h"
#include "../util.h"
#include "../../util/annotate.h"
#include "../../util/debug.h"
#include "../../util/dso.h"

View File

@ -5,7 +5,6 @@
#include <stdlib.h>
#include <string.h>
#include <linux/bitops.h>
#include "../../util/util.h"
#include "../../util/debug.h"
#include "../../util/map.h"
#include "../../util/dso.h"

View File

@ -7,7 +7,7 @@
#include "config.h"
#include "time-utils.h"
#include "../util.h"
#include "../../util/util.h"
#include "../../util/util.h" // perf_exe()
#include "../../perf.h"
#include <stdlib.h>
#include <string.h>

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "../../builtin.h"
#include "../../perf.h"
#include "../../util/util.h"
#include "../../util/util.h" // perf_exe()
#include "../util.h"
#include "../../util/hist.h"
#include "../../util/debug.h"

View File

@ -3,7 +3,6 @@
#include "gtk.h"
#include "../progress.h"
#include "util.h"
static GtkWidget *dialog;
static GtkWidget *progress;

View File

@ -5,7 +5,6 @@
#include "helpline.h"
#include "ui.h"
#include "../util/util.h"
char ui_helpline__current[512];

View File

@ -8,7 +8,6 @@
#include "../util/callchain.h"
#include "../util/debug.h"
#include "../util/hist.h"
#include "../util/util.h"
#include "../util/sort.h"
#include "../util/evsel.h"
#include "../util/evlist.h"

View File

@ -1,11 +1,11 @@
// SPDX-License-Identifier: GPL-2.0
#include <pthread.h>
#include <dlfcn.h>
#include <unistd.h>
#include <subcmd/pager.h>
#include "../util/debug.h"
#include "../util/hist.h"
#include "../util/util.h"
#include "ui.h"
pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;

View File

@ -2,13 +2,13 @@
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/kernel.h>
#ifdef HAVE_BACKTRACE_SUPPORT
#include <execinfo.h>
#endif
#include "../../util/debug.h"
#include "../../util/util.h"
#include "../../perf.h"
#include "../browser.h"
#include "../helpline.h"

View File

@ -14,7 +14,7 @@
#include <bpf/btf.h>
#include <bpf/libbpf.h>
#include <linux/btf.h>
#include "util.h"
#include "util.h" // hex_width()
#include "ui/ui.h"
#include "sort.h"
#include "build-id.h"

View File

@ -50,10 +50,12 @@
#include "intel-bts.h"
#include "arm-spe.h"
#include "s390-cpumsf.h"
#include "util.h"
#include "util.h" // page_size
#include <linux/ctype.h>
#include <linux/kernel.h>
#include "symbol/kallsyms.h"
#include <internal/lib.h>
static bool auxtrace__dont_decode(struct perf_session *session)
{

View File

@ -1,4 +1,3 @@
#include "util/util.h"
#include "util/map_symbol.h"
#include "util/branch.h"
#include <linux/kernel.h>

View File

@ -1,8 +1,15 @@
#ifndef _PERF_BRANCH_H
#define _PERF_BRANCH_H 1
/*
* The linux/stddef.h isn't need here, but is needed for __always_inline used
* in files included from uapi/linux/perf_event.h such as
* /usr/include/linux/swab.h and /usr/include/linux/byteorder/little_endian.h,
* detected in at least musl libc, used in Alpine Linux. -acme
*/
#include <stdio.h>
#include <stdint.h>
#include <linux/compiler.h>
#include <linux/stddef.h>
#include <linux/perf_event.h>
#include <linux/types.h>

View File

@ -7,7 +7,7 @@
* Copyright (C) 2009, 2010 Red Hat Inc.
* Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <acme@redhat.com>
*/
#include "util.h"
#include "util.h" // copyfile_ns(), lsdir(), mkdir_p(), rm_rf()
#include <dirent.h>
#include <errno.h>
#include <stdio.h>

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <sched.h>
#include "util.h"
#include "util.h" // for sched_getcpu()
#include "../perf-sys.h"
#include "cloexec.h"
#include "event.h"

View File

@ -17,7 +17,6 @@
#include "cs-etm.h"
#include "cs-etm-decoder.h"
#include "intlist.h"
#include "util.h"
/* use raw logging */
#ifdef CS_DEBUG_RAW

View File

@ -35,7 +35,6 @@
#include "thread.h"
#include "thread-stack.h"
#include <tools/libc_compat.h>
#include "util.h"
#define MAX_TIMESTAMP (~0ULL)

View File

@ -13,9 +13,10 @@
#include <dirent.h>
#include "data.h"
#include "util.h"
#include "util.h" // rm_rf_perf_data()
#include "debug.h"
#include "header.h"
#include <internal/lib.h>
static void close_dir(struct perf_data_file *files, int nr)
{

View File

@ -17,7 +17,6 @@
#include "event.h"
#include "debug.h"
#include "print_binary.h"
#include "util.h"
#include "target.h"
#include "ui/helpline.h"
#include "ui/ui.h"

View File

@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "util.h"
#include "debug.h"
#include "demangle-rust.h"

View File

@ -5,7 +5,6 @@
* Written by: Masami Hiramatsu <mhiramat@kernel.org>
*/
#include <util.h>
#include <debug.h>
#include <dwarf-regs.h>
#include <elf.h>

View File

@ -16,7 +16,7 @@
#include "evsel.h"
#include "debug.h"
#include "units.h"
#include "util.h"
#include "util.h" // page_size
#include "../perf.h"
#include "asm/bug.h"
#include "bpf-event.h"

View File

@ -45,6 +45,7 @@
#include "../perf-sys.h"
#include "util/parse-branch-options.h"
#include <internal/xyarray.h>
#include <internal/lib.h>
#include <linux/ctype.h>

View File

@ -42,11 +42,12 @@
#include "tool.h"
#include "time-utils.h"
#include "units.h"
#include "util.h"
#include "util.h" // page_size, perf_exe()
#include "cputopo.h"
#include "bpf-event.h"
#include <linux/ctype.h>
#include <internal/lib.h>
/*
* magic2 = "PERFILE2"

View File

@ -15,7 +15,6 @@
#include <linux/stringify.h>
#include "build-id.h"
#include "util.h"
#include "event.h"
#include "debug.h"
#include "evlist.h"

View File

@ -8,6 +8,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/err.h>
#include <linux/string.h>
#include <linux/zalloc.h>

View File

@ -7,10 +7,10 @@
#include <sys/stat.h>
#include <fcntl.h>
#include "compress.h"
#include "util.h"
#include "debug.h"
#include <string.h>
#include <unistd.h>
#include <internal/lib.h>
#define BUFSIZE 8192

View File

@ -12,7 +12,6 @@
#include <setjmp.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include "util/util.h"
#include "util/debug.h"
#include "util/perf-hooks.h"

View File

@ -10,7 +10,6 @@
#include <api/fs/fs.h>
#include <subcmd/parse-options.h>
#include <perf/cpumap.h>
#include "util.h"
#include "cloexec.h"
#include "record.h"
#include "../perf-sys.h"

View File

@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include "util.h"
#include "rwsem.h"

View File

@ -22,7 +22,6 @@
#include <asm/byteorder.h>
#include "debug.h"
#include "util.h"
#include "session.h"
#include "evlist.h"
#include "color.h"

View File

@ -37,7 +37,6 @@
#include "../dso.h"
#include "../callchain.h"
#include "../evsel.h"
#include "../util.h"
#include "../event.h"
#include "../thread.h"
#include "../comm.h"

View File

@ -34,6 +34,7 @@
#include "ui/progress.h"
#include "../perf.h"
#include "arch/common.h"
#include <internal/lib.h>
#ifdef HAVE_ZSTD_SUPPORT
static int perf_session__process_compressed_event(struct perf_session *session,

View File

@ -15,7 +15,7 @@
#include <string.h>
#include "srccode.h"
#include "debug.h"
#include "util.h"
#include "util.h" // page_size
#define MAXSRCCACHE (32*1024*1024)
#define MAXSRCFILES 64

View File

@ -18,8 +18,10 @@
#include "debug.h"
#include "util.h"
#include <linux/ctype.h>
#include <linux/kernel.h>
#include <linux/zalloc.h>
#include <symbol/kallsyms.h>
#include <internal/lib.h>
#ifndef EM_AARCH64
#define EM_AARCH64 183 /* ARM 64 bit */

View File

@ -1,8 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include "dso.h"
#include "symbol.h"
#include "symsrc.h"
#include "util.h"
#include <errno.h>
#include <unistd.h>
@ -13,6 +11,7 @@
#include <byteswap.h>
#include <sys/stat.h>
#include <linux/zalloc.h>
#include <internal/lib.h>
static bool check_need_swap(int file_endian)
{

View File

@ -19,7 +19,7 @@
#include "build-id.h"
#include "cap.h"
#include "dso.h"
#include "util.h"
#include "util.h" // lsdir()
#include "debug.h"
#include "event.h"
#include "machine.h"

View File

@ -6,7 +6,6 @@
*/
#include "target.h"
#include "util.h"
#include <pwd.h>
#include <stdio.h>

View File

@ -2,7 +2,7 @@
/*
* Copyright (C) 2008,2009, Steven Rostedt <srostedt@redhat.com>
*/
#include "util.h"
#include "util.h" // page_size
#include <dirent.h>
#include <mntent.h>
#include <stdio.h>

View File

@ -15,7 +15,6 @@
#include <unistd.h>
#include <errno.h>
#include "util.h"
#include "trace-event.h"
#include "debug.h"

View File

@ -14,7 +14,6 @@
#include <api/fs/fs.h>
#include "trace-event.h"
#include "machine.h"
#include "util.h"
/*
* global trace_event object used by trace_event__tp_format

View File

@ -17,7 +17,6 @@
#include "event.h"
#include "perf_regs.h"
#include "callchain.h"
#include "util.h"
static char *debuginfo_path;

View File

@ -37,7 +37,6 @@
#include "unwind.h"
#include "map.h"
#include "symbol.h"
#include "util.h"
#include "debug.h"
#include "asm/bug.h"
#include "dso.h"

View File

@ -11,7 +11,7 @@
#include "vdso.h"
#include "dso.h"
#include "util.h"
#include <internal/lib.h>
#include "map.h"
#include "symbol.h"
#include "machine.h"

View File

@ -7,9 +7,9 @@
#include <sys/mman.h>
#include <zlib.h>
#include <linux/compiler.h>
#include <internal/lib.h>
#include "util/compress.h"
#include "util/util.h"
#define CHUNK_SIZE 16384