Skip to content

Commit fd6da69

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Don't build 'perf kvm stat" on non-x86 arches, fix from Xiao Guangrong. - UAPI fixes to get perf building again in non-x86 arches, from David Howells. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 18423d3 + 7321090 commit fd6da69

File tree

20 files changed

+181
-126
lines changed

20 files changed

+181
-126
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,10 +1321,12 @@ kernelversion:
13211321

13221322
# Clear a bunch of variables before executing the submake
13231323
tools/: 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/
13251326

13261327
tools/%: 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/ $*
13281330

13291331
# Single targets
13301332
# ---------------------------------------------------------------------------

arch/x86/include/asm/Kbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ header-y += mce.h
1212
header-y += msr-index.h
1313
header-y += msr.h
1414
header-y += mtrr.h
15+
header-y += perf_regs.h
1516
header-y += posix_types_32.h
1617
header-y += posix_types_64.h
1718
header-y += posix_types_x32.h
1819
header-y += prctl.h
1920
header-y += processor-flags.h
2021
header-y += ptrace-abi.h
2122
header-y += sigcontext32.h
23+
header-y += svm.h
2224
header-y += ucontext.h
2325
header-y += vm86.h
26+
header-y += vmx.h
2427
header-y += vsyscall.h
2528

2629
genhdr-y += unistd_32.h

include/linux/hw_breakpoint.h

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
11
#ifndef _LINUX_HW_BREAKPOINT_H
22
#define _LINUX_HW_BREAKPOINT_H
33

4-
enum {
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-
11-
enum {
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-
20-
enum 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-
324
#include <linux/perf_event.h>
5+
#include <uapi/linux/hw_breakpoint.h>
336

347
#ifdef CONFIG_HAVE_HW_BREAKPOINT
358

@@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
151124
}
152125

153126
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
154-
#endif /* __KERNEL__ */
155-
156127
#endif /* _LINUX_HW_BREAKPOINT_H */

include/uapi/linux/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,3 +415,4 @@ header-y += wireless.h
415415
header-y += x25.h
416416
header-y += xattr.h
417417
header-y += xfrm.h
418+
header-y += hw_breakpoint.h

include/uapi/linux/hw_breakpoint.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef _UAPI_LINUX_HW_BREAKPOINT_H
2+
#define _UAPI_LINUX_HW_BREAKPOINT_H
3+
4+
enum {
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+
11+
enum {
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+
20+
enum 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 */

tools/Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,44 @@ help:
3131
@echo ' clean: a summary clean target to clean _all_ folders'
3232

3333
cpupower: FORCE
34-
$(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1)
34+
$(call descend,power/$@)
3535

3636
firewire lguest perf usb virtio vm: FORCE
37-
$(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1)
37+
$(call descend,$@)
3838

3939
selftests: FORCE
40-
$(QUIET_SUBDIR0)testing/$@/ $(QUIET_SUBDIR1)
40+
$(call descend,testing/$@)
4141

4242
turbostat x86_energy_perf_policy: FORCE
43-
$(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1)
43+
$(call descend,power/x86/$@)
4444

4545
cpupower_install:
46-
$(QUIET_SUBDIR0)power/$(@:_install=)/ $(QUIET_SUBDIR1) install
46+
$(call descend,power/$(@:_install=),install)
4747

4848
firewire_install lguest_install perf_install usb_install virtio_install vm_install:
49-
$(QUIET_SUBDIR0)$(@:_install=)/ $(QUIET_SUBDIR1) install
49+
$(call descend,$(@:_install=),install)
5050

5151
selftests_install:
52-
$(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) install
52+
$(call descend,testing/$(@:_clean=),install)
5353

5454
turbostat_install x86_energy_perf_policy_install:
55-
$(QUIET_SUBDIR0)power/x86/$(@:_install=)/ $(QUIET_SUBDIR1) install
55+
$(call descend,power/x86/$(@:_install=),install)
5656

5757
install: cpupower_install firewire_install lguest_install perf_install \
5858
selftests_install turbostat_install usb_install virtio_install \
5959
vm_install x86_energy_perf_policy_install
6060

6161
cpupower_clean:
62-
$(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean
62+
$(call descend,power/cpupower,clean)
6363

6464
firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean:
65-
$(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean
65+
$(call descend,$(@:_clean=),clean)
6666

6767
selftests_clean:
68-
$(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) clean
68+
$(call descend,testing/$(@:_clean=),clean)
6969

7070
turbostat_clean x86_energy_perf_policy_clean:
71-
$(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean
71+
$(call descend,power/x86/$(@:_clean=),clean)
7272

7373
clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \
7474
turbostat_clean usb_clean virtio_clean vm_clean \

tools/perf/Makefile

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,34 @@ endif
169169

170170
### --- END CONFIGURATION SECTION ---
171171

172-
BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
172+
ifeq ($(srctree),)
173+
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
174+
srctree := $(patsubst %/,%,$(dir $(srctree)))
175+
#$(info Determined 'srctree' to be $(srctree))
176+
endif
177+
178+
ifneq ($(objtree),)
179+
#$(info Determined 'objtree' to be $(objtree))
180+
endif
181+
182+
ifneq ($(OUTPUT),)
183+
#$(info Determined 'OUTPUT' to be $(OUTPUT))
184+
endif
185+
186+
BASIC_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
173200
BASIC_LDFLAGS =
174201

175202
# Guard against environment variables

tools/perf/arch/x86/include/perf_regs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <stdlib.h>
55
#include "../../util/types.h"
6-
#include "../../../../../arch/x86/include/asm/perf_regs.h"
6+
#include <asm/perf_regs.h>
77

88
#ifndef ARCH_X86_64
99
#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)

0 commit comments

Comments
 (0)