提交 07590a7d 编写于 作者: I Ingo Molnar

Merge tag 'perf-core-for-mingo-4.12-20170419' of...

Merge tag 'perf-core-for-mingo-4.12-20170419' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core cleanups from Arnaldo Carvalho de Melo:

 - Introduce new header files out of the hodge-podge that util/util.h
   became, trying to disentangle the includes hell that all C projects
   end up growing. This should help in build times, as changes to
   seemingly unrelated files (util.h included tons of headers) won't
   trigger a rebuild of most object files.

 - Use equivalent facilities found in the kernel source code base
   originated tools/include/ header files, such as __stringify(),
   ARRAY_SIZE, that has extra checks (__must_be_array()), etc.

 - For that get some more files from the kernel sources, like
   include/linux/bug.h, some just with the bits needed at this time.

 - Use the headers where facilities declared in them are used, such
   as PRIxu(32,64) macros (inttypes.h), errno defines (errno.h), etc.

 - Remove various leftovers from the initial code base we copied from
   git.git: FLEX_ARRAY, etc.
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
#ifndef _TOOLS_PERF_LINUX_BUG_H
#define _TOOLS_PERF_LINUX_BUG_H
/* Force a compilation error if condition is true, but also produce a
result (of value 0 and type size_t), so the expression can be used
e.g. in a structure initializer (or where-ever else comma expressions
aren't permitted). */
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
#endif /* _TOOLS_PERF_LINUX_BUG_H */
...@@ -16,3 +16,6 @@ ...@@ -16,3 +16,6 @@
#if GCC_VERSION >= 40300 #if GCC_VERSION >= 40300
# define __compiletime_error(message) __attribute__((error(message))) # define __compiletime_error(message) __attribute__((error(message)))
#endif /* GCC_VERSION >= 40300 */ #endif /* GCC_VERSION >= 40300 */
/* &a[0] degrades to a pointer: a different type from an array */
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
# define __always_inline inline __attribute__((always_inline)) # define __always_inline inline __attribute__((always_inline))
#endif #endif
/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
#endif
#ifdef __ANDROID__ #ifdef __ANDROID__
/* /*
* FIXME: Big hammer to get rid of tons of: * FIXME: Big hammer to get rid of tons of:
......
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#include <linux/hash.h> #include <linux/hash.h>
#include <linux/log2.h> #include <linux/log2.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#define DEFINE_HASHTABLE(name, bits) \ #define DEFINE_HASHTABLE(name, bits) \
struct hlist_head name[1 << (bits)] = \ struct hlist_head name[1 << (bits)] = \
{ [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
#include <assert.h> #include <assert.h>
#include <linux/compiler.h>
#ifndef UINT_MAX #ifndef UINT_MAX
#define UINT_MAX (~0U) #define UINT_MAX (~0U)
...@@ -76,6 +77,8 @@ ...@@ -76,6 +77,8 @@
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
int scnprintf(char * buf, size_t size, const char * fmt, ...); int scnprintf(char * buf, size_t size, const char * fmt, ...);
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
/* /*
* This looks more complex than it should be. But we need to * This looks more complex than it should be. But we need to
* get the type for the ~ right in round_down (it needs to be * get the type for the ~ right in round_down (it needs to be
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#ifndef _TOOLS_LINUX_LOG2_H #ifndef _TOOLS_LINUX_LOG2_H
#define _TOOLS_LINUX_LOG2_H #define _TOOLS_LINUX_LOG2_H
#include <linux/bitops.h>
#include <linux/types.h>
/* /*
* non-constant log of base 2 calculators * non-constant log of base 2 calculators
* - the arch may override these in asm/bitops.h if they can be implemented * - the arch may override these in asm/bitops.h if they can be implemented
......
#include <ctype.h>
#include "symbol/kallsyms.h" #include "symbol/kallsyms.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
#include "warn.h" #include "warn.h"
#include <linux/hashtable.h> #include <linux/hashtable.h>
#include <linux/kernel.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define STATE_FP_SAVED 0x1 #define STATE_FP_SAVED 0x1
#define STATE_FP_SETUP 0x2 #define STATE_FP_SETUP 0x2
......
...@@ -31,11 +31,10 @@ ...@@ -31,11 +31,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <subcmd/exec-cmd.h> #include <subcmd/exec-cmd.h>
#include <subcmd/pager.h> #include <subcmd/pager.h>
#include <linux/kernel.h>
#include "builtin.h" #include "builtin.h"
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
struct cmd_struct { struct cmd_struct {
const char *name; const char *name;
int (*fn)(int, const char **); int (*fn)(int, const char **);
......
...@@ -64,6 +64,7 @@ tools/include/linux/bitops.h ...@@ -64,6 +64,7 @@ tools/include/linux/bitops.h
tools/include/linux/compiler.h tools/include/linux/compiler.h
tools/include/linux/compiler-gcc.h tools/include/linux/compiler-gcc.h
tools/include/linux/coresight-pmu.h tools/include/linux/coresight-pmu.h
tools/include/linux/bug.h
tools/include/linux/filter.h tools/include/linux/filter.h
tools/include/linux/hash.h tools/include/linux/hash.h
tools/include/linux/kernel.h tools/include/linux/kernel.h
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <stddef.h> #include <stddef.h>
#include <linux/stringify.h>
#include <dwarf-regs.h> #include <dwarf-regs.h>
struct pt_regs_dwarfnum { struct pt_regs_dwarfnum {
...@@ -16,10 +17,9 @@ struct pt_regs_dwarfnum { ...@@ -16,10 +17,9 @@ struct pt_regs_dwarfnum {
unsigned int dwarfnum; unsigned int dwarfnum;
}; };
#define STR(s) #s
#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num} #define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
#define GPR_DWARFNUM_NAME(num) \ #define GPR_DWARFNUM_NAME(num) \
{.name = STR(%r##num), .dwarfnum = num} {.name = __stringify(%r##num), .dwarfnum = num}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0} #define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
/* /*
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <errno.h>
#include <stddef.h> #include <stddef.h>
#include <dwarf-regs.h> #include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */ #include <linux/ptrace.h> /* for struct user_pt_regs */
#include <linux/stringify.h>
#include "util.h" #include "util.h"
struct pt_regs_dwarfnum { struct pt_regs_dwarfnum {
...@@ -20,7 +22,7 @@ struct pt_regs_dwarfnum { ...@@ -20,7 +22,7 @@ struct pt_regs_dwarfnum {
#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num} #define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
#define GPR_DWARFNUM_NAME(num) \ #define GPR_DWARFNUM_NAME(num) \
{.name = STR(%x##num), .dwarfnum = num} {.name = __stringify(%x##num), .dwarfnum = num}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0} #define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
#define DWARFNUM2OFFSET(index) \ #define DWARFNUM2OFFSET(index) \
(index * sizeof((struct user_pt_regs *)0)->regs[0]) (index * sizeof((struct user_pt_regs *)0)->regs[0])
......
#include <errno.h>
#ifndef REMOTE_UNWIND_LIBUNWIND #ifndef REMOTE_UNWIND_LIBUNWIND
#include <errno.h>
#include <libunwind.h> #include <libunwind.h>
#include "perf_regs.h" #include "perf_regs.h"
#include "../../util/unwind.h" #include "../../util/unwind.h"
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "../util/util.h" #include "../util/util.h"
#include "../util/debug.h" #include "../util/debug.h"
#include "sane_ctype.h"
const char *const arm_triplets[] = { const char *const arm_triplets[] = {
"arm-eabi-", "arm-eabi-",
"arm-linux-androideabi-", "arm-linux-androideabi-",
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <dwarf-regs.h> #include <dwarf-regs.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/stringify.h>
#include "util.h" #include "util.h"
struct pt_regs_dwarfnum { struct pt_regs_dwarfnum {
...@@ -24,10 +25,10 @@ struct pt_regs_dwarfnum { ...@@ -24,10 +25,10 @@ struct pt_regs_dwarfnum {
}; };
#define REG_DWARFNUM_NAME(r, num) \ #define REG_DWARFNUM_NAME(r, num) \
{.name = STR(%)STR(r), .dwarfnum = num, \ {.name = __stringify(%)__stringify(r), .dwarfnum = num, \
.ptregs_offset = offsetof(struct pt_regs, r)} .ptregs_offset = offsetof(struct pt_regs, r)}
#define GPR_DWARFNUM_NAME(num) \ #define GPR_DWARFNUM_NAME(num) \
{.name = STR(%gpr##num), .dwarfnum = num, \ {.name = __stringify(%gpr##num), .dwarfnum = num, \
.ptregs_offset = offsetof(struct pt_regs, gpr[num])} .ptregs_offset = offsetof(struct pt_regs, gpr[num])}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0, .ptregs_offset = 0} #define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0, .ptregs_offset = 0}
......
#include <errno.h>
#include "util/kvm-stat.h" #include "util/kvm-stat.h"
#include "util/parse-events.h" #include "util/parse-events.h"
#include "util/debug.h" #include "util/debug.h"
......
#include <errno.h>
#include <string.h> #include <string.h>
#include <regex.h> #include <regex.h>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
*/ */
#include <errno.h>
#include "../../util/kvm-stat.h" #include "../../util/kvm-stat.h"
#include <asm/sie.h> #include <asm/sie.h>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "arch-tests.h" #include "arch-tests.h"
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h>
#include <string.h> #include <string.h>
static pid_t spawn(void) static pid_t spawn(void)
......
#include <errno.h>
#include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <linux/types.h> #include <linux/types.h>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* *
*/ */
#include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include "../../util/header.h" #include "../../util/header.h"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* *
*/ */
#include <errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/bitops.h> #include <linux/bitops.h>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* *
*/ */
#include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
......
#include <errno.h>
#include "../../util/kvm-stat.h" #include "../../util/kvm-stat.h"
#include <asm/svm.h> #include <asm/svm.h>
#include <asm/vmx.h> #include <asm/vmx.h>
......
#include <errno.h>
#include <string.h> #include <string.h>
#include <regex.h> #include <regex.h>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "../util/header.h" #include "../util/header.h"
#include "../util/cloexec.h" #include "../util/cloexec.h"
#include "../util/string2.h"
#include "bench.h" #include "bench.h"
#include "mem-memcpy-arch.h" #include "mem-memcpy-arch.h"
#include "mem-memset-arch.h" #include "mem-memset-arch.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* numa: Simulate NUMA-sensitive workload and measure their NUMA performance * numa: Simulate NUMA-sensitive workload and measure their NUMA performance
*/ */
#include <inttypes.h>
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <pthread.h> #include <pthread.h>
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/types.h> #include <sys/types.h>
#include <linux/kernel.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <numa.h> #include <numa.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "util/block-range.h" #include "util/block-range.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <errno.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
struct perf_annotate { struct perf_annotate {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "builtin.h" #include "builtin.h"
#include "perf.h" #include "perf.h"
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "util/session.h" #include "util/session.h"
#include "util/symbol.h" #include "util/symbol.h"
#include "util/data.h" #include "util/data.h"
#include <errno.h>
static int sysfs__fprintf_build_id(FILE *fp) static int sysfs__fprintf_build_id(FILE *fp)
{ {
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* Dick Fowles <fowles@inreach.com> * Dick Fowles <fowles@inreach.com>
* Joe Mario <jmario@redhat.com> * Joe Mario <jmario@redhat.com>
*/ */
#include <errno.h>
#include <inttypes.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/stringify.h> #include <linux/stringify.h>
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "util/data.h" #include "util/data.h"
#include "util/config.h" #include "util/config.h"
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
......
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
#include "builtin.h" #include "builtin.h"
#include "perf.h" #include "perf.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <fcntl.h> #include <fcntl.h>
#include "debug.h" #include "debug.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include <api/fs/tracing_path.h>
#include "evlist.h" #include "evlist.h"
#include "target.h" #include "target.h"
#include "cpumap.h" #include "cpumap.h"
......
...@@ -12,16 +12,18 @@ ...@@ -12,16 +12,18 @@
#include <subcmd/run-command.h> #include <subcmd/run-command.h>
#include <subcmd/help.h> #include <subcmd/help.h>
#include "util/debug.h" #include "util/debug.h"
#include <linux/kernel.h>
#include <errno.h>
static struct man_viewer_list { static struct man_viewer_list {
struct man_viewer_list *next; struct man_viewer_list *next;
char name[FLEX_ARRAY]; char name[0];
} *man_viewer_list; } *man_viewer_list;
static struct man_viewer_info_list { static struct man_viewer_info_list {
struct man_viewer_info_list *next; struct man_viewer_info_list *next;
const char *info; const char *info;
char name[FLEX_ARRAY]; char name[0];
} *man_viewer_info_list; } *man_viewer_info_list;
enum help_format { enum help_format {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include <linux/list.h> #include <linux/list.h>
#include <errno.h>
struct perf_inject { struct perf_inject {
struct perf_tool tool; struct perf_tool tool;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* *
* Released under the GPL v2. (and only v2, not any later version) * Released under the GPL v2. (and only v2, not any later version)
*/ */
#include <inttypes.h>
#include "builtin.h" #include "builtin.h"
#include <linux/compiler.h> #include <linux/compiler.h>
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
......
...@@ -20,11 +20,16 @@ ...@@ -20,11 +20,16 @@
#include "util/debug.h" #include "util/debug.h"
#include <linux/kernel.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/string.h> #include <linux/string.h>
#include <errno.h>
#include <inttypes.h>
#include <locale.h> #include <locale.h>
#include <regex.h> #include <regex.h>
#include "sane_ctype.h"
static int kmem_slab; static int kmem_slab;
static int kmem_page; static int kmem_page;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "util/evsel.h" #include "util/evsel.h"
#include "util/evlist.h" #include "util/evlist.h"
#include "util/term.h"
#include "util/util.h" #include "util/util.h"
#include "util/cache.h" #include "util/cache.h"
#include "util/symbol.h" #include "util/symbol.h"
...@@ -24,7 +25,10 @@ ...@@ -24,7 +25,10 @@
#include <sys/timerfd.h> #include <sys/timerfd.h>
#endif #endif
#include <linux/kernel.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <errno.h>
#include <inttypes.h>
#include <termios.h> #include <termios.h>
#include <semaphore.h> #include <semaphore.h>
#include <pthread.h> #include <pthread.h>
......
#include <errno.h>
#include <inttypes.h>
#include "builtin.h" #include "builtin.h"
#include "perf.h" #include "perf.h"
...@@ -26,6 +28,7 @@ ...@@ -26,6 +28,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/hash.h> #include <linux/hash.h>
#include <linux/kernel.h>
static struct perf_session *session; static struct perf_session *session;
......
#include <inttypes.h>
#include "builtin.h" #include "builtin.h"
#include "perf.h" #include "perf.h"
......
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#include "util/perf-hooks.h" #include "util/perf-hooks.h"
#include "asm/bug.h" #include "asm/bug.h"
#include <errno.h>
#include <inttypes.h>
#include <unistd.h> #include <unistd.h>
#include <sched.h> #include <sched.h>
#include <sys/mman.h> #include <sys/mman.h>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include "util/symbol.h" #include "util/symbol.h"
#include "util/callchain.h" #include "util/callchain.h"
#include "util/strlist.h"
#include "util/values.h" #include "util/values.h"
#include "perf.h" #include "perf.h"
...@@ -40,6 +39,9 @@ ...@@ -40,6 +39,9 @@
#include "util/auxtrace.h" #include "util/auxtrace.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <errno.h>
#include <inttypes.h>
#include <regex.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/stringify.h> #include <linux/stringify.h>
......
...@@ -22,16 +22,21 @@ ...@@ -22,16 +22,21 @@
#include "util/debug.h" #include "util/debug.h"
#include <linux/kernel.h>
#include <linux/log2.h> #include <linux/log2.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <inttypes.h>
#include <errno.h>
#include <semaphore.h> #include <semaphore.h>
#include <pthread.h> #include <pthread.h>
#include <math.h> #include <math.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <linux/time64.h> #include <linux/time64.h>
#include "sane_ctype.h"
#define PR_SET_NAME 15 /* Set process name */ #define PR_SET_NAME 15 /* Set process name */
#define MAX_CPUS 4096 #define MAX_CPUS 4096
#define COMM_LEN 20 #define COMM_LEN 20
......
...@@ -21,14 +21,22 @@ ...@@ -21,14 +21,22 @@
#include "util/cpumap.h" #include "util/cpumap.h"
#include "util/thread_map.h" #include "util/thread_map.h"
#include "util/stat.h" #include "util/stat.h"
#include "util/string2.h"
#include "util/thread-stack.h" #include "util/thread-stack.h"
#include "util/time-utils.h" #include "util/time-utils.h"
#include "print_binary.h"
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/kernel.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <linux/time64.h> #include <linux/time64.h>
#include "asm/bug.h" #include "asm/bug.h"
#include "util/mem-events.h" #include "util/mem-events.h"
#include "util/dump-insn.h" #include "util/dump-insn.h"
#include <dirent.h>
#include <errno.h>
#include <inttypes.h>
#include "sane_ctype.h"
static char const *script_name; static char const *script_name;
static char const *generate_script_lang; static char const *generate_script_lang;
......
...@@ -64,15 +64,20 @@ ...@@ -64,15 +64,20 @@
#include "util/session.h" #include "util/session.h"
#include "util/tool.h" #include "util/tool.h"
#include "util/group.h" #include "util/group.h"
#include "util/string2.h"
#include "asm/bug.h" #include "asm/bug.h"
#include <linux/time64.h> #include <linux/time64.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <inttypes.h>
#include <locale.h> #include <locale.h>
#include <math.h> #include <math.h>
#include "sane_ctype.h"
#define DEFAULT_SEPARATOR " " #define DEFAULT_SEPARATOR " "
#define CNTR_NOT_SUPPORTED "<not supported>" #define CNTR_NOT_SUPPORTED "<not supported>"
#define CNTR_NOT_COUNTED "<not counted>" #define CNTR_NOT_COUNTED "<not counted>"
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
* of the License. * of the License.
*/ */
#include <errno.h>
#include <inttypes.h>
#include <traceevent/event-parse.h> #include <traceevent/event-parse.h>
#include "builtin.h" #include "builtin.h"
...@@ -23,11 +25,11 @@ ...@@ -23,11 +25,11 @@
#include "util/cache.h" #include "util/cache.h"
#include "util/evlist.h" #include "util/evlist.h"
#include "util/evsel.h" #include "util/evsel.h"
#include <linux/kernel.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/time64.h> #include <linux/time64.h>
#include "util/symbol.h" #include "util/symbol.h"
#include "util/callchain.h" #include "util/callchain.h"
#include "util/strlist.h"
#include "perf.h" #include "perf.h"
#include "util/header.h" #include "util/header.h"
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "util/cpumap.h" #include "util/cpumap.h"
#include "util/xyarray.h" #include "util/xyarray.h"
#include "util/sort.h" #include "util/sort.h"
#include "util/term.h"
#include "util/intlist.h" #include "util/intlist.h"
#include "util/parse-branch-options.h" #include "util/parse-branch-options.h"
#include "arch/common.h" #include "arch/common.h"
...@@ -72,6 +73,8 @@ ...@@ -72,6 +73,8 @@
#include <linux/time64.h> #include <linux/time64.h>
#include <linux/types.h> #include <linux/types.h>
#include "sane_ctype.h"
static volatile int done; static volatile int done;
#define HEADER_LINE_NR 5 #define HEADER_LINE_NR 5
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "util/evlist.h" #include "util/evlist.h"
#include <subcmd/exec-cmd.h> #include <subcmd/exec-cmd.h>
#include "util/machine.h" #include "util/machine.h"
#include "util/path.h"
#include "util/session.h" #include "util/session.h"
#include "util/thread.h" #include "util/thread.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
...@@ -36,19 +37,26 @@ ...@@ -36,19 +37,26 @@
#include "util/parse-events.h" #include "util/parse-events.h"
#include "util/bpf-loader.h" #include "util/bpf-loader.h"
#include "callchain.h" #include "callchain.h"
#include "print_binary.h"
#include "string2.h"
#include "syscalltbl.h" #include "syscalltbl.h"
#include "rb_resort.h" #include "rb_resort.h"
#include <errno.h>
#include <inttypes.h>
#include <libaudit.h> /* FIXME: Still needed for audit_errno_to_name */ #include <libaudit.h> /* FIXME: Still needed for audit_errno_to_name */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/filter.h> #include <linux/filter.h>
#include <linux/audit.h> #include <linux/audit.h>
#include <linux/kernel.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <linux/time64.h> #include <linux/time64.h>
#include "sane_ctype.h"
#ifndef O_CLOEXEC #ifndef O_CLOEXEC
# define O_CLOEXEC 02000000 # define O_CLOEXEC 02000000
#endif #endif
......
...@@ -19,9 +19,11 @@ ...@@ -19,9 +19,11 @@
#include "util/debug.h" #include "util/debug.h"
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <api/fs/tracing_path.h> #include <api/fs/tracing_path.h>
#include <errno.h>
#include <pthread.h> #include <pthread.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <linux/kernel.h>
const char perf_usage_string[] = const char perf_usage_string[] =
"perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]";
...@@ -327,16 +329,6 @@ static void handle_internal_command(int argc, const char **argv) ...@@ -327,16 +329,6 @@ static void handle_internal_command(int argc, const char **argv)
{ {
const char *cmd = argv[0]; const char *cmd = argv[0];
unsigned int i; unsigned int i;
static const char ext[] = STRIP_EXTENSION;
if (sizeof(ext) > 1) {
i = strlen(argv[0]) - strlen(ext);
if (i > 0 && !strcmp(argv[0] + i, ext)) {
char *argv0 = strdup(argv[0]);
argv[0] = cmd = argv0;
argv0[i] = '\0';
}
}
/* Turn "perf cmd --help" into "perf help cmd" */ /* Turn "perf cmd --help" into "perf help cmd" */
if (argc > 1 && !strcmp(argv[1], "--help")) { if (argc > 1 && !strcmp(argv[1], "--help")) {
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* permissions. All the event text files are stored there. * permissions. All the event text files are stored there.
*/ */
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <linux/types.h> #include <linux/types.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
#include <errno.h>
#define NR_ITERS 111 #define NR_ITERS 111
......
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <util/util.h> #include <util/util.h>
...@@ -5,6 +6,7 @@ ...@@ -5,6 +6,7 @@
#include <util/evlist.h> #include <util/evlist.h>
#include <linux/bpf.h> #include <linux/bpf.h>
#include <linux/filter.h> #include <linux/filter.h>
#include <linux/kernel.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <bpf/bpf.h> #include <bpf/bpf.h>
#include "tests.h" #include "tests.h"
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* *
* Builtin regression testing command: ever growing number of sanity tests * Builtin regression testing command: ever growing number of sanity tests
*/ */
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include "builtin.h" #include "builtin.h"
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
#include "color.h" #include "color.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "symbol.h" #include "symbol.h"
#include <linux/kernel.h>
static bool dont_fork; static bool dont_fork;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include "debug.h" #include "debug.h"
#include "util.h" #include "util.h"
#include "c++/clang-c.h" #include "c++/clang-c.h"
#include <linux/kernel.h>
static struct { static struct {
int (*func)(void); int (*func)(void);
......
#include <errno.h>
#include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h>
#include <string.h> #include <string.h>
#include "parse-events.h" #include "parse-events.h"
...@@ -16,6 +18,8 @@ ...@@ -16,6 +18,8 @@
#include "tests.h" #include "tests.h"
#include "sane_ctype.h"
#define BUFSZ 1024 #define BUFSZ 1024
#define READLEN 128 #define READLEN 128
......
#include <dirent.h>
#include <stdlib.h> #include <stdlib.h>
#include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
......
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include <inttypes.h>
#include <unistd.h> #include <unistd.h>
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
......
#include <linux/compiler.h> #include <linux/compiler.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h> #include <string.h>
#include "tests.h" #include "tests.h"
#include "evlist.h" #include "evlist.h"
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "parse-events.h" #include "parse-events.h"
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
#include <errno.h>
#include <linux/kernel.h>
static int perf_evsel__roundtrip_cache_name_test(void) static int perf_evsel__roundtrip_cache_name_test(void)
{ {
......
#include <inttypes.h>
#include "perf.h" #include "perf.h"
#include "util/debug.h" #include "util/debug.h"
#include "util/symbol.h" #include "util/symbol.h"
...@@ -7,6 +8,7 @@ ...@@ -7,6 +8,7 @@
#include "util/machine.h" #include "util/machine.h"
#include "util/thread.h" #include "util/thread.h"
#include "tests/hists_common.h" #include "tests/hists_common.h"
#include <linux/kernel.h>
static struct { static struct {
u32 pid; u32 pid;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "util/parse-events.h" #include "util/parse-events.h"
#include "tests/tests.h" #include "tests/tests.h"
#include "tests/hists_common.h" #include "tests/hists_common.h"
#include <linux/kernel.h>
struct sample { struct sample {
u32 pid; u32 pid;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "util/parse-events.h" #include "util/parse-events.h"
#include "tests/tests.h" #include "tests/tests.h"
#include "tests/hists_common.h" #include "tests/hists_common.h"
#include <linux/kernel.h>
struct sample { struct sample {
u32 pid; u32 pid;
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "thread.h" #include "thread.h"
#include "parse-events.h" #include "parse-events.h"
#include "hists_common.h" #include "hists_common.h"
#include <errno.h>
#include <linux/kernel.h>
struct sample { struct sample {
u32 pid; u32 pid;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "util/parse-events.h" #include "util/parse-events.h"
#include "tests/tests.h" #include "tests/tests.h"
#include "tests/hists_common.h" #include "tests/hists_common.h"
#include <linux/kernel.h>
struct sample { struct sample {
u32 cpu; u32 cpu;
......
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/kernel.h>
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
#include "util.h" #include "print_binary.h"
int test__is_printable_array(int subtest __maybe_unused) int test__is_printable_array(int subtest __maybe_unused)
{ {
......
#include <errno.h>
#include <inttypes.h>
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <pthread.h> #include <pthread.h>
...@@ -7,6 +9,7 @@ ...@@ -7,6 +9,7 @@
#include "cpumap.h" #include "cpumap.h"
#include "tests.h" #include "tests.h"
#include <linux/err.h> #include <linux/err.h>
#include <linux/kernel.h>
/* /*
* This test will generate random numbers of calls to some getpid syscalls, * This test will generate random numbers of calls to some getpid syscalls,
......
#include <inttypes.h>
#include <unistd.h> #include <unistd.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -11,6 +12,7 @@ ...@@ -11,6 +12,7 @@
#include "thread_map.h" #include "thread_map.h"
#include "symbol.h" #include "symbol.h"
#include "thread.h" #include "thread.h"
#include "util.h"
#define THREADS 4 #define THREADS 4
......
#include <errno.h>
#include <inttypes.h>
/* For the CPU_* macros */ /* For the CPU_* macros */
#include <pthread.h> #include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <linux/err.h> #include <linux/err.h>
#include <api/fs/tracing_path.h>
#include "evsel.h" #include "evsel.h"
#include "tests.h" #include "tests.h"
#include "thread_map.h" #include "thread_map.h"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "thread_map.h" #include "thread_map.h"
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
#include <errno.h>
#ifndef O_DIRECTORY #ifndef O_DIRECTORY
#define O_DIRECTORY 00200000 #define O_DIRECTORY 00200000
......
#include <errno.h>
#include <inttypes.h>
#include <api/fs/tracing_path.h> #include <api/fs/tracing_path.h>
#include <linux/err.h> #include <linux/err.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "thread_map.h" #include "thread_map.h"
#include "evsel.h" #include "evsel.h"
#include "debug.h" #include "debug.h"
......
#include "parse-events.h" #include "parse-events.h"
#include "evsel.h" #include "evsel.h"
#include "evlist.h" #include "evlist.h"
...@@ -6,8 +5,12 @@ ...@@ -6,8 +5,12 @@
#include "tests.h" #include "tests.h"
#include "debug.h" #include "debug.h"
#include "util.h" #include "util.h"
#include <dirent.h>
#include <errno.h>
#include <linux/kernel.h>
#include <linux/hw_breakpoint.h> #include <linux/hw_breakpoint.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <api/fs/tracing_path.h>
#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \ #define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)
......
#include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <stddef.h> #include <stddef.h>
......
#include <errno.h>
#include <inttypes.h>
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <pthread.h> #include <pthread.h>
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#include "pmu.h" #include "pmu.h"
#include "util.h" #include "util.h"
#include "tests.h" #include "tests.h"
#include <errno.h>
#include <linux/kernel.h>
/* Simulated format definitions. */ /* Simulated format definitions. */
static struct test_format { static struct test_format {
......
#include <stdbool.h> #include <stdbool.h>
#include <inttypes.h>
#include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include "util.h" #include "util.h"
......
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <util/util.h> #include <util/util.h>
......
#include <errno.h>
#include <inttypes.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
......
#include <sys/time.h> #include <sys/time.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <errno.h>
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "cpumap.h" #include "cpumap.h"
#include "tests.h" #include "tests.h"
#include <errno.h>
#include <signal.h> #include <signal.h>
static int exited; static int exited;
......
#include <inttypes.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include "tests.h" #include "tests.h"
......
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <inttypes.h>
#include <string.h> #include <string.h>
#include "map.h" #include "map.h"
#include "symbol.h" #include "symbol.h"
......
#include "../util.h" #include "../util.h"
#include "../string2.h"
#include "../config.h" #include "../config.h"
#include "../../perf.h" #include "../../perf.h"
#include "libslang.h" #include "libslang.h"
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
#include "helpline.h" #include "helpline.h"
#include "keysyms.h" #include "keysyms.h"
#include "../color.h" #include "../color.h"
#include "sane_ctype.h"
static int ui_browser__percent_color(struct ui_browser *browser, static int ui_browser__percent_color(struct ui_browser *browser,
double percent, bool current) double percent, bool current)
......
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
#include "../../util/symbol.h" #include "../../util/symbol.h"
#include "../../util/evsel.h" #include "../../util/evsel.h"
#include "../../util/config.h" #include "../../util/config.h"
#include <inttypes.h>
#include <pthread.h> #include <pthread.h>
#include <linux/kernel.h>
#include <sys/ttydefaults.h>
struct disasm_line_samples { struct disasm_line_samples {
double percent; double percent;
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "util/header.h" #include "util/header.h"
#include "util/session.h" #include "util/session.h"
#include <sys/ttydefaults.h>
static void ui_browser__argv_write(struct ui_browser *browser, static void ui_browser__argv_write(struct ui_browser *browser,
void *entry, int row) void *entry, int row)
{ {
......
#include <dirent.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <sys/ttydefaults.h>
#include "../../util/evsel.h" #include "../../util/evsel.h"
#include "../../util/evlist.h" #include "../../util/evlist.h"
...@@ -18,6 +22,10 @@ ...@@ -18,6 +22,10 @@
#include "../ui.h" #include "../ui.h"
#include "map.h" #include "map.h"
#include "annotate.h" #include "annotate.h"
#include "srcline.h"
#include "string2.h"
#include "sane_ctype.h"
extern void hist_browser__init_hpp(void); extern void hist_browser__init_hpp(void);
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "../keysyms.h" #include "../keysyms.h"
#include "map.h" #include "map.h"
#include "sane_ctype.h"
struct map_browser { struct map_browser {
struct ui_browser b; struct ui_browser b;
struct map *map; struct map *map;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "util/annotate.h" #include "util/annotate.h"
#include "util/evsel.h" #include "util/evsel.h"
#include "ui/helpline.h" #include "ui/helpline.h"
#include <inttypes.h>
enum { enum {
ANN_COL__PERCENT, ANN_COL__PERCENT,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "../sort.h" #include "../sort.h"
#include "../hist.h" #include "../hist.h"
#include "../helpline.h" #include "../helpline.h"
#include "../string2.h"
#include "gtk.h" #include "gtk.h"
#define MAX_COLUMNS 32 #define MAX_COLUMNS 32
......
#include <inttypes.h>
#include <math.h> #include <math.h>
#include <linux/compiler.h> #include <linux/compiler.h>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "../util/cache.h" #include "../util/cache.h"
#include "../util/debug.h" #include "../util/debug.h"
#include "../util/hist.h" #include "../util/hist.h"
#include "../util/util.h"
pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
void *perf_gtk_handle; void *perf_gtk_handle;
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
#include "../../util/hist.h" #include "../../util/hist.h"
#include "../../util/sort.h" #include "../../util/sort.h"
#include "../../util/evsel.h" #include "../../util/evsel.h"
#include "../../util/srcline.h"
#include "../../util/string2.h"
#include "../../util/sane_ctype.h"
static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin)
{ {
......
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <linux/kernel.h>
#ifdef HAVE_BACKTRACE_SUPPORT #ifdef HAVE_BACKTRACE_SUPPORT
#include <execinfo.h> #include <execinfo.h>
#endif #endif
......
...@@ -16,6 +16,7 @@ libperf-y += llvm-utils.o ...@@ -16,6 +16,7 @@ libperf-y += llvm-utils.o
libperf-y += parse-events.o libperf-y += parse-events.o
libperf-y += perf_regs.o libperf-y += perf_regs.o
libperf-y += path.o libperf-y += path.o
libperf-y += print_binary.o
libperf-y += rbtree.o libperf-y += rbtree.o
libperf-y += libstring.o libperf-y += libstring.o
libperf-y += bitmap.o libperf-y += bitmap.o
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Released under the GPL v2. (and only v2, not any later version) * Released under the GPL v2. (and only v2, not any later version)
*/ */
#include <errno.h>
#include <inttypes.h>
#include "util.h" #include "util.h"
#include "ui/ui.h" #include "ui/ui.h"
#include "sort.h" #include "sort.h"
...@@ -18,12 +20,16 @@ ...@@ -18,12 +20,16 @@
#include "annotate.h" #include "annotate.h"
#include "evsel.h" #include "evsel.h"
#include "block-range.h" #include "block-range.h"
#include "string2.h"
#include "arch/common.h" #include "arch/common.h"
#include <regex.h> #include <regex.h>
#include <pthread.h> #include <pthread.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/kernel.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include "sane_ctype.h"
const char *disassembler_style; const char *disassembler_style;
const char *objdump_path; const char *objdump_path;
static regex_t file_lineno; static regex_t file_lineno;
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
* *
*/ */
#include <inttypes.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <stdbool.h> #include <stdbool.h>
#include <ctype.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include "cpumap.h" #include "cpumap.h"
#include "thread_map.h" #include "thread_map.h"
#include "asm/bug.h" #include "asm/bug.h"
#include "symbol/kallsyms.h"
#include "auxtrace.h" #include "auxtrace.h"
#include <linux/hash.h> #include <linux/hash.h>
...@@ -59,6 +58,9 @@ ...@@ -59,6 +58,9 @@
#include "intel-pt.h" #include "intel-pt.h"
#include "intel-bts.h" #include "intel-bts.h"
#include "sane_ctype.h"
#include "symbol/kallsyms.h"
int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
struct auxtrace_mmap_params *mp, struct auxtrace_mmap_params *mp,
void *userpg, int fd) void *userpg, int fd)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#define __PERF_AUXTRACE_H #define __PERF_AUXTRACE_H
#include <sys/types.h> #include <sys/types.h>
#include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <linux/list.h> #include <linux/list.h>
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#include <bpf/libbpf.h> #include <bpf/libbpf.h>
#include <bpf/bpf.h> #include <bpf/bpf.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <errno.h>
#include "perf.h" #include "perf.h"
#include "debug.h" #include "debug.h"
#include "bpf-loader.h" #include "bpf-loader.h"
...@@ -17,6 +19,7 @@ ...@@ -17,6 +19,7 @@
#include "probe-event.h" #include "probe-event.h"
#include "probe-finder.h" // for MAX_PROBES #include "probe-finder.h" // for MAX_PROBES
#include "parse-events.h" #include "parse-events.h"
#include "strfilter.h"
#include "llvm-utils.h" #include "llvm-utils.h"
#include "c++/clang-c.h" #include "c++/clang-c.h"
......
...@@ -85,6 +85,8 @@ int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, ...@@ -85,6 +85,8 @@ int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err,
char *buf, size_t size); char *buf, size_t size);
#else #else
#include <errno.h>
static inline struct bpf_object * static inline struct bpf_object *
bpf__prepare_load(const char *filename __maybe_unused, bpf__prepare_load(const char *filename __maybe_unused,
bool source __maybe_unused) bool source __maybe_unused)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "bpf-loader.h" #include "bpf-loader.h"
#include "bpf-prologue.h" #include "bpf-prologue.h"
#include "probe-finder.h" #include "probe-finder.h"
#include <errno.h>
#include <dwarf-regs.h> #include <dwarf-regs.h>
#include <linux/filter.h> #include <linux/filter.h>
......
...@@ -18,6 +18,8 @@ int bpf__gen_prologue(struct probe_trace_arg *args, int nargs, ...@@ -18,6 +18,8 @@ int bpf__gen_prologue(struct probe_trace_arg *args, int nargs,
struct bpf_insn *new_prog, size_t *new_cnt, struct bpf_insn *new_prog, size_t *new_cnt,
size_t cnt_space); size_t cnt_space);
#else #else
#include <errno.h>
static inline int static inline int
bpf__gen_prologue(struct probe_trace_arg *args __maybe_unused, bpf__gen_prologue(struct probe_trace_arg *args __maybe_unused,
int nargs __maybe_unused, int nargs __maybe_unused,
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册