aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-11-20 09:58:52 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-23 14:27:25 -0500
commit97a13bf3fed11a7508d58b67515c4b83cce25540 (patch)
treeda6e14e27b02b2d234aad0eb1ccf5bbfa06d0cb8
parent18423d3562f396206e0928a71177eeb2edfed077 (diff)
parentd2709c7ce4c513ab7f4ca9a106a930621811f2d3 (diff)
Merge tag 'perf-uapi-20121119' of git://git.infradead.org/users/dhowells/linux-headers into perf/urgent
Merge reason: UAPI fixes for building on non x86 arches. perf/urgent fixes 2012-11-19
-rw-r--r--Makefile6
-rw-r--r--arch/x86/include/asm/Kbuild3
-rw-r--r--include/linux/hw_breakpoint.h31
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/hw_breakpoint.h30
-rw-r--r--tools/Makefile24
-rw-r--r--tools/perf/Makefile29
-rw-r--r--tools/perf/arch/x86/include/perf_regs.h2
-rw-r--r--tools/perf/builtin-kvm.c6
-rw-r--r--tools/perf/builtin-test.c2
-rw-r--r--tools/perf/perf.h16
-rw-r--r--tools/perf/util/evsel.c4
-rw-r--r--tools/perf/util/evsel.h3
-rw-r--r--tools/perf/util/header.h2
-rw-r--r--tools/perf/util/parse-events-test.c2
-rw-r--r--tools/perf/util/parse-events.c2
-rw-r--r--tools/perf/util/parse-events.h2
-rw-r--r--tools/perf/util/pmu.h2
-rw-r--r--tools/perf/util/session.h2
-rw-r--r--tools/scripts/Makefile.include23
20 files changed, 117 insertions, 75 deletions
diff --git a/Makefile b/Makefile
index 42d0e56818ea..71dc31e41407 100644
--- a/Makefile
+++ b/Makefile
@@ -1321,10 +1321,12 @@ kernelversion:
1321 1321
1322# Clear a bunch of variables before executing the submake 1322# Clear a bunch of variables before executing the submake
1323tools/: FORCE 1323tools/: FORCE
1324 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ 1324 $(Q)mkdir -p $(objtree)/tools
1325 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/
1325 1326
1326tools/%: FORCE 1327tools/%: FORCE
1327 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $* 1328 $(Q)mkdir -p $(objtree)/tools
1329 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $*
1328 1330
1329# Single targets 1331# Single targets
1330# --------------------------------------------------------------------------- 1332# ---------------------------------------------------------------------------
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 66e5f0ef0523..79fd8a3418f9 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -12,6 +12,7 @@ header-y += mce.h
12header-y += msr-index.h 12header-y += msr-index.h
13header-y += msr.h 13header-y += msr.h
14header-y += mtrr.h 14header-y += mtrr.h
15header-y += perf_regs.h
15header-y += posix_types_32.h 16header-y += posix_types_32.h
16header-y += posix_types_64.h 17header-y += posix_types_64.h
17header-y += posix_types_x32.h 18header-y += posix_types_x32.h
@@ -19,8 +20,10 @@ header-y += prctl.h
19header-y += processor-flags.h 20header-y += processor-flags.h
20header-y += ptrace-abi.h 21header-y += ptrace-abi.h
21header-y += sigcontext32.h 22header-y += sigcontext32.h
23header-y += svm.h
22header-y += ucontext.h 24header-y += ucontext.h
23header-y += vm86.h 25header-y += vm86.h
26header-y += vmx.h
24header-y += vsyscall.h 27header-y += vsyscall.h
25 28
26genhdr-y += unistd_32.h 29genhdr-y += unistd_32.h
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 6ae9c631a1be..0464c85e63fd 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -1,35 +1,8 @@
1#ifndef _LINUX_HW_BREAKPOINT_H 1#ifndef _LINUX_HW_BREAKPOINT_H
2#define _LINUX_HW_BREAKPOINT_H 2#define _LINUX_HW_BREAKPOINT_H
3 3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
28};
29
30#ifdef __KERNEL__
31
32#include <linux/perf_event.h> 4#include <linux/perf_event.h>
5#include <uapi/linux/hw_breakpoint.h>
33 6
34#ifdef CONFIG_HAVE_HW_BREAKPOINT 7#ifdef CONFIG_HAVE_HW_BREAKPOINT
35 8
@@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
151} 124}
152 125
153#endif /* CONFIG_HAVE_HW_BREAKPOINT */ 126#endif /* CONFIG_HAVE_HW_BREAKPOINT */
154#endif /* __KERNEL__ */
155
156#endif /* _LINUX_HW_BREAKPOINT_H */ 127#endif /* _LINUX_HW_BREAKPOINT_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index e194387ef784..19e765fbfef7 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -415,3 +415,4 @@ header-y += wireless.h
415header-y += x25.h 415header-y += x25.h
416header-y += xattr.h 416header-y += xattr.h
417header-y += xfrm.h 417header-y += xfrm.h
418header-y += hw_breakpoint.h
diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h
new file mode 100644
index 000000000000..b04000a2296a
--- /dev/null
+++ b/include/uapi/linux/hw_breakpoint.h
@@ -0,0 +1,30 @@
1#ifndef _UAPI_LINUX_HW_BREAKPOINT_H
2#define _UAPI_LINUX_HW_BREAKPOINT_H
3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
28};
29
30#endif /* _UAPI_LINUX_HW_BREAKPOINT_H */
diff --git a/tools/Makefile b/tools/Makefile
index 3ae43947a171..1f9a529fe544 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -31,44 +31,44 @@ help:
31 @echo ' clean: a summary clean target to clean _all_ folders' 31 @echo ' clean: a summary clean target to clean _all_ folders'
32 32
33cpupower: FORCE 33cpupower: FORCE
34 $(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1) 34 $(call descend,power/$@)
35 35
36firewire lguest perf usb virtio vm: FORCE 36firewire lguest perf usb virtio vm: FORCE
37 $(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1) 37 $(call descend,$@)
38 38
39selftests: FORCE 39selftests: FORCE
40 $(QUIET_SUBDIR0)testing/$@/ $(QUIET_SUBDIR1) 40 $(call descend,testing/$@)
41 41
42turbostat x86_energy_perf_policy: FORCE 42turbostat x86_energy_perf_policy: FORCE
43 $(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1) 43 $(call descend,power/x86/$@)
44 44
45cpupower_install: 45cpupower_install:
46 $(QUIET_SUBDIR0)power/$(@:_install=)/ $(QUIET_SUBDIR1) install 46 $(call descend,power/$(@:_install=),install)
47 47
48firewire_install lguest_install perf_install usb_install virtio_install vm_install: 48firewire_install lguest_install perf_install usb_install virtio_install vm_install:
49 $(QUIET_SUBDIR0)$(@:_install=)/ $(QUIET_SUBDIR1) install 49 $(call descend,$(@:_install=),install)
50 50
51selftests_install: 51selftests_install:
52 $(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) install 52 $(call descend,testing/$(@:_clean=),install)
53 53
54turbostat_install x86_energy_perf_policy_install: 54turbostat_install x86_energy_perf_policy_install:
55 $(QUIET_SUBDIR0)power/x86/$(@:_install=)/ $(QUIET_SUBDIR1) install 55 $(call descend,power/x86/$(@:_install=),install)
56 56
57install: cpupower_install firewire_install lguest_install perf_install \ 57install: cpupower_install firewire_install lguest_install perf_install \
58 selftests_install turbostat_install usb_install virtio_install \ 58 selftests_install turbostat_install usb_install virtio_install \
59 vm_install x86_energy_perf_policy_install 59 vm_install x86_energy_perf_policy_install
60 60
61cpupower_clean: 61cpupower_clean:
62 $(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean 62 $(call descend,power/cpupower,clean)
63 63
64firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean: 64firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean:
65 $(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean 65 $(call descend,$(@:_clean=),clean)
66 66
67selftests_clean: 67selftests_clean:
68 $(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) clean 68 $(call descend,testing/$(@:_clean=),clean)
69 69
70turbostat_clean x86_energy_perf_policy_clean: 70turbostat_clean x86_energy_perf_policy_clean:
71 $(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean 71 $(call descend,power/x86/$(@:_clean=),clean)
72 72
73clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \ 73clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \
74 turbostat_clean usb_clean virtio_clean vm_clean \ 74 turbostat_clean usb_clean virtio_clean vm_clean \
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 00deed4d6159..0a619af5be43 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -169,7 +169,34 @@ endif
169 169
170### --- END CONFIGURATION SECTION --- 170### --- END CONFIGURATION SECTION ---
171 171
172BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 172ifeq ($(srctree),)
173srctree := $(patsubst %/,%,$(dir $(shell pwd)))
174srctree := $(patsubst %/,%,$(dir $(srctree)))
175#$(info Determined 'srctree' to be $(srctree))
176endif
177
178ifneq ($(objtree),)
179#$(info Determined 'objtree' to be $(objtree))
180endif
181
182ifneq ($(OUTPUT),)
183#$(info Determined 'OUTPUT' to be $(OUTPUT))
184endif
185
186BASIC_CFLAGS = \
187 -Iutil/include \
188 -Iarch/$(ARCH)/include \
189 $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \
190 -I$(srctree)/arch/$(ARCH)/include/uapi \
191 -I$(srctree)/arch/$(ARCH)/include \
192 $(if $(objtree),-I$(objtree)/include/generated/uapi) \
193 -I$(srctree)/include/uapi \
194 -I$(srctree)/include \
195 -I$(OUTPUT)util \
196 -Iutil \
197 -I. \
198 -I$(TRACE_EVENT_DIR) \
199 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
173BASIC_LDFLAGS = 200BASIC_LDFLAGS =
174 201
175# Guard against environment variables 202# Guard against environment variables
diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h
index 46fc9f15c6b3..7fcdcdbee917 100644
--- a/tools/perf/arch/x86/include/perf_regs.h
+++ b/tools/perf/arch/x86/include/perf_regs.h
@@ -3,7 +3,7 @@
3 3
4#include <stdlib.h> 4#include <stdlib.h>
5#include "../../util/types.h" 5#include "../../util/types.h"
6#include "../../../../../arch/x86/include/asm/perf_regs.h" 6#include <asm/perf_regs.h>
7 7
8#ifndef ARCH_X86_64 8#ifndef ARCH_X86_64
9#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1) 9#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 260abc535b5b..e013bdb5e24a 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -22,9 +22,9 @@
22#include <pthread.h> 22#include <pthread.h>
23#include <math.h> 23#include <math.h>
24 24
25#include "../../arch/x86/include/asm/svm.h" 25#include <asm/svm.h>
26#include "../../arch/x86/include/asm/vmx.h" 26#include <asm/vmx.h>
27#include "../../arch/x86/include/asm/kvm.h" 27#include <asm/kvm.h>
28 28
29struct event_key { 29struct event_key {
30 #define INVALID_KEY (~0ULL) 30 #define INVALID_KEY (~0ULL)
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 484f26cc0c00..5acd6e8e658b 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -15,7 +15,7 @@
15#include "util/thread_map.h" 15#include "util/thread_map.h"
16#include "util/pmu.h" 16#include "util/pmu.h"
17#include "event-parse.h" 17#include "event-parse.h"
18#include "../../include/linux/hw_breakpoint.h" 18#include <linux/hw_breakpoint.h>
19 19
20#include <sys/mman.h> 20#include <sys/mman.h>
21 21
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index c50985eaec41..238f923f2218 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -5,8 +5,9 @@ struct winsize;
5 5
6void get_term_dimensions(struct winsize *ws); 6void get_term_dimensions(struct winsize *ws);
7 7
8#include <asm/unistd.h>
9
8#if defined(__i386__) 10#if defined(__i386__)
9#include "../../arch/x86/include/asm/unistd.h"
10#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") 11#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
11#define cpu_relax() asm volatile("rep; nop" ::: "memory"); 12#define cpu_relax() asm volatile("rep; nop" ::: "memory");
12#define CPUINFO_PROC "model name" 13#define CPUINFO_PROC "model name"
@@ -16,7 +17,6 @@ void get_term_dimensions(struct winsize *ws);
16#endif 17#endif
17 18
18#if defined(__x86_64__) 19#if defined(__x86_64__)
19#include "../../arch/x86/include/asm/unistd.h"
20#define rmb() asm volatile("lfence" ::: "memory") 20#define rmb() asm volatile("lfence" ::: "memory")
21#define cpu_relax() asm volatile("rep; nop" ::: "memory"); 21#define cpu_relax() asm volatile("rep; nop" ::: "memory");
22#define CPUINFO_PROC "model name" 22#define CPUINFO_PROC "model name"
@@ -26,20 +26,17 @@ void get_term_dimensions(struct winsize *ws);
26#endif 26#endif
27 27
28#ifdef __powerpc__ 28#ifdef __powerpc__
29#include "../../arch/powerpc/include/asm/unistd.h"
30#define rmb() asm volatile ("sync" ::: "memory") 29#define rmb() asm volatile ("sync" ::: "memory")
31#define cpu_relax() asm volatile ("" ::: "memory"); 30#define cpu_relax() asm volatile ("" ::: "memory");
32#define CPUINFO_PROC "cpu" 31#define CPUINFO_PROC "cpu"
33#endif 32#endif
34 33
35#ifdef __s390__ 34#ifdef __s390__
36#include "../../arch/s390/include/asm/unistd.h"
37#define rmb() asm volatile("bcr 15,0" ::: "memory") 35#define rmb() asm volatile("bcr 15,0" ::: "memory")
38#define cpu_relax() asm volatile("" ::: "memory"); 36#define cpu_relax() asm volatile("" ::: "memory");
39#endif 37#endif
40 38
41#ifdef __sh__ 39#ifdef __sh__
42#include "../../arch/sh/include/asm/unistd.h"
43#if defined(__SH4A__) || defined(__SH5__) 40#if defined(__SH4A__) || defined(__SH5__)
44# define rmb() asm volatile("synco" ::: "memory") 41# define rmb() asm volatile("synco" ::: "memory")
45#else 42#else
@@ -50,35 +47,30 @@ void get_term_dimensions(struct winsize *ws);
50#endif 47#endif
51 48
52#ifdef __hppa__ 49#ifdef __hppa__
53#include "../../arch/parisc/include/asm/unistd.h"
54#define rmb() asm volatile("" ::: "memory") 50#define rmb() asm volatile("" ::: "memory")
55#define cpu_relax() asm volatile("" ::: "memory"); 51#define cpu_relax() asm volatile("" ::: "memory");
56#define CPUINFO_PROC "cpu" 52#define CPUINFO_PROC "cpu"
57#endif 53#endif
58 54
59#ifdef __sparc__ 55#ifdef __sparc__
60#include "../../arch/sparc/include/uapi/asm/unistd.h"
61#define rmb() asm volatile("":::"memory") 56#define rmb() asm volatile("":::"memory")
62#define cpu_relax() asm volatile("":::"memory") 57#define cpu_relax() asm volatile("":::"memory")
63#define CPUINFO_PROC "cpu" 58#define CPUINFO_PROC "cpu"
64#endif 59#endif
65 60
66#ifdef __alpha__ 61#ifdef __alpha__
67#include "../../arch/alpha/include/asm/unistd.h"
68#define rmb() asm volatile("mb" ::: "memory") 62#define rmb() asm volatile("mb" ::: "memory")
69#define cpu_relax() asm volatile("" ::: "memory") 63#define cpu_relax() asm volatile("" ::: "memory")
70#define CPUINFO_PROC "cpu model" 64#define CPUINFO_PROC "cpu model"
71#endif 65#endif
72 66
73#ifdef __ia64__ 67#ifdef __ia64__
74#include "../../arch/ia64/include/asm/unistd.h"
75#define rmb() asm volatile ("mf" ::: "memory") 68#define rmb() asm volatile ("mf" ::: "memory")
76#define cpu_relax() asm volatile ("hint @pause" ::: "memory") 69#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
77#define CPUINFO_PROC "model name" 70#define CPUINFO_PROC "model name"
78#endif 71#endif
79 72
80#ifdef __arm__ 73#ifdef __arm__
81#include "../../arch/arm/include/asm/unistd.h"
82/* 74/*
83 * Use the __kuser_memory_barrier helper in the CPU helper page. See 75 * Use the __kuser_memory_barrier helper in the CPU helper page. See
84 * arch/arm/kernel/entry-armv.S in the kernel source for details. 76 * arch/arm/kernel/entry-armv.S in the kernel source for details.
@@ -89,13 +81,11 @@ void get_term_dimensions(struct winsize *ws);
89#endif 81#endif
90 82
91#ifdef __aarch64__ 83#ifdef __aarch64__
92#include "../../arch/arm64/include/asm/unistd.h"
93#define rmb() asm volatile("dmb ld" ::: "memory") 84#define rmb() asm volatile("dmb ld" ::: "memory")
94#define cpu_relax() asm volatile("yield" ::: "memory") 85#define cpu_relax() asm volatile("yield" ::: "memory")
95#endif 86#endif
96 87
97#ifdef __mips__ 88#ifdef __mips__
98#include "../../arch/mips/include/asm/unistd.h"
99#define rmb() asm volatile( \ 89#define rmb() asm volatile( \
100 ".set mips2\n\t" \ 90 ".set mips2\n\t" \
101 "sync\n\t" \ 91 "sync\n\t" \
@@ -112,7 +102,7 @@ void get_term_dimensions(struct winsize *ws);
112#include <sys/types.h> 102#include <sys/types.h>
113#include <sys/syscall.h> 103#include <sys/syscall.h>
114 104
115#include "../../include/uapi/linux/perf_event.h" 105#include <linux/perf_event.h>
116#include "util/types.h" 106#include "util/types.h"
117#include <stdbool.h> 107#include <stdbool.h>
118 108
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 618d41140abd..d144d464ce39 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -18,8 +18,8 @@
18#include "cpumap.h" 18#include "cpumap.h"
19#include "thread_map.h" 19#include "thread_map.h"
20#include "target.h" 20#include "target.h"
21#include "../../../include/linux/hw_breakpoint.h" 21#include <linux/hw_breakpoint.h>
22#include "../../../include/uapi/linux/perf_event.h" 22#include <linux/perf_event.h>
23#include "perf_regs.h" 23#include "perf_regs.h"
24 24
25#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) 25#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 6f94d6dea00f..d99b476ef37c 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -3,7 +3,8 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <stdbool.h> 5#include <stdbool.h>
6#include "../../../include/uapi/linux/perf_event.h" 6#include <stddef.h>
7#include <linux/perf_event.h>
7#include "types.h" 8#include "types.h"
8#include "xyarray.h" 9#include "xyarray.h"
9#include "cgroup.h" 10#include "cgroup.h"
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 879d215cdac9..9bc00783f24f 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -1,7 +1,7 @@
1#ifndef __PERF_HEADER_H 1#ifndef __PERF_HEADER_H
2#define __PERF_HEADER_H 2#define __PERF_HEADER_H
3 3
4#include "../../../include/uapi/linux/perf_event.h" 4#include <linux/perf_event.h>
5#include <sys/types.h> 5#include <sys/types.h>
6#include <stdbool.h> 6#include <stdbool.h>
7#include "types.h" 7#include "types.h"
diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c
index 516ecd9ddd6e..6ef213b35ecd 100644
--- a/tools/perf/util/parse-events-test.c
+++ b/tools/perf/util/parse-events-test.c
@@ -3,7 +3,7 @@
3#include "evsel.h" 3#include "evsel.h"
4#include "evlist.h" 4#include "evlist.h"
5#include "sysfs.h" 5#include "sysfs.h"
6#include "../../../include/linux/hw_breakpoint.h" 6#include <linux/hw_breakpoint.h>
7 7
8#define TEST_ASSERT_VAL(text, cond) \ 8#define TEST_ASSERT_VAL(text, cond) \
9do { \ 9do { \
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 75c7b0fca6d9..6b6d03e93c3d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1,4 +1,4 @@
1#include "../../../include/linux/hw_breakpoint.h" 1#include <linux/hw_breakpoint.h>
2#include "util.h" 2#include "util.h"
3#include "../perf.h" 3#include "../perf.h"
4#include "evlist.h" 4#include "evlist.h"
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 839230ceb18b..2820c407adb2 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -7,7 +7,7 @@
7#include <linux/list.h> 7#include <linux/list.h>
8#include <stdbool.h> 8#include <stdbool.h>
9#include "types.h" 9#include "types.h"
10#include "../../../include/uapi/linux/perf_event.h" 10#include <linux/perf_event.h>
11#include "types.h" 11#include "types.h"
12 12
13struct list_head; 13struct list_head;
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 39f3abac7744..fdeb8ac7c5d2 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -2,7 +2,7 @@
2#define __PMU_H 2#define __PMU_H
3 3
4#include <linux/bitops.h> 4#include <linux/bitops.h>
5#include "../../../include/uapi/linux/perf_event.h" 5#include <linux/perf_event.h>
6 6
7enum { 7enum {
8 PERF_PMU_FORMAT_VALUE_CONFIG, 8 PERF_PMU_FORMAT_VALUE_CONFIG,
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index dd6426163ba6..0eae00ad5fe7 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -7,7 +7,7 @@
7#include "symbol.h" 7#include "symbol.h"
8#include "thread.h" 8#include "thread.h"
9#include <linux/rbtree.h> 9#include <linux/rbtree.h>
10#include "../../../include/uapi/linux/perf_event.h" 10#include <linux/perf_event.h>
11 11
12struct sample_queue; 12struct sample_queue;
13struct ip_callchain; 13struct ip_callchain;
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 96ce80a3743b..2964b96aa55f 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -1,8 +1,11 @@
1ifeq ("$(origin O)", "command line") 1ifeq ($(origin O), command line)
2 dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) 2 dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
3 ABSOLUTE_O := $(shell cd $(O) ; pwd) 3 ABSOLUTE_O := $(shell cd $(O) ; pwd)
4 OUTPUT := $(ABSOLUTE_O)/ 4 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
5 COMMAND_O := O=$(ABSOLUTE_O) 5 COMMAND_O := O=$(ABSOLUTE_O)
6ifeq ($(objtree),)
7 objtree := $(O)
8endif
6endif 9endif
7 10
8ifneq ($(OUTPUT),) 11ifneq ($(OUTPUT),)
@@ -41,7 +44,16 @@ else
41NO_SUBDIR = : 44NO_SUBDIR = :
42endif 45endif
43 46
44QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir 47#
48# Define a callable command for descending to a new directory
49#
50# Call by doing: $(call descend,directory[,target])
51#
52descend = \
53 +mkdir -p $(OUTPUT)$(1) && \
54 $(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
55
56QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
45QUIET_SUBDIR1 = 57QUIET_SUBDIR1 =
46 58
47ifneq ($(findstring $(MAKEFLAGS),s),s) 59ifneq ($(findstring $(MAKEFLAGS),s),s)
@@ -56,5 +68,10 @@ ifndef V
56 $(MAKE) $(PRINT_DIR) -C $$subdir 68 $(MAKE) $(PRINT_DIR) -C $$subdir
57 QUIET_FLEX = @echo ' ' FLEX $@; 69 QUIET_FLEX = @echo ' ' FLEX $@;
58 QUIET_BISON = @echo ' ' BISON $@; 70 QUIET_BISON = @echo ' ' BISON $@;
71
72 descend = \
73 @echo ' ' DESCEND $(1); \
74 mkdir -p $(OUTPUT)$(1) && \
75 $(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
59endif 76endif
60endif 77endif