perf/urgent fixes 2012-11-19

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAUKqx7BOxKuMESys7AQJ0XQ/5AcJhWtWYgr+hN1zZkPxItw0SCEADkCwu
 FQOObrkFs3LDMj/R/rK9psrA20RtKYPwob6LFfEwZd+DatjuQ/gg2fu2jftwP0hL
 9vZBOvaobORfbAtjxKJ5iGwxuSKqzIfFn6O0rw69Hei3F6envGDBHJvuWvCqUkU7
 FXgf8TvAm+stfiscquf6i/M41ou0CsrsgP7fF59Bgi+TY9TTOfvOuez4hKnyG3ht
 JoyHriBZN6CLSRUDKDNE4PAVrp1aF9SodAfPIhhYiRbv+zfxW+1plfqeLcBaXHbM
 Mb7gfIk3sFzZEBXeYw+HffOIA3RR8gnqux/tP/95f2L7FEeIit3Zm+9rTHD7h+4C
 P6AANeQBm68Ml4dry2pLbdEwzmxrQg/bSxrEA5wE6HVJUdqcE99b6rt9mgIkBovb
 WuWgTDi6dcB8eAexhkQU9k+8s9l/A8PTkWJOHiUVj7YEVm0GlIHhyZtnNveE7G/M
 ///IxPKpr/VuFehylCex42f11Wlq58QXS9s8nWgl55K9NO/i4Xj+TeH3kQarzLQK
 9iX5m2dPQBO0qh/oOoUCtpm3+s4Io2lfdBAVT4ccDyMDyTVd4y8mF9/AmSShAJoE
 Vp9sK61lDnnefdgYblTfA6Z/ew1K97UZWJXGZK5ruaVgcuflxnNzQYHLqYGa8loi
 AxHrtwl5u9o=
 =GvW0
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Arnaldo Carvalho de Melo 2012-11-20 11:58:52 -03:00
commit 97a13bf3fe
20 changed files with 117 additions and 75 deletions

View File

@ -1321,10 +1321,12 @@ kernelversion:
# Clear a bunch of variables before executing the submake
tools/: FORCE
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/
$(Q)mkdir -p $(objtree)/tools
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/
tools/%: FORCE
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $*
$(Q)mkdir -p $(objtree)/tools
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $*
# Single targets
# ---------------------------------------------------------------------------

View File

@ -12,6 +12,7 @@ header-y += mce.h
header-y += msr-index.h
header-y += msr.h
header-y += mtrr.h
header-y += perf_regs.h
header-y += posix_types_32.h
header-y += posix_types_64.h
header-y += posix_types_x32.h
@ -19,8 +20,10 @@ header-y += prctl.h
header-y += processor-flags.h
header-y += ptrace-abi.h
header-y += sigcontext32.h
header-y += svm.h
header-y += ucontext.h
header-y += vm86.h
header-y += vmx.h
header-y += vsyscall.h
genhdr-y += unistd_32.h

View File

@ -1,35 +1,8 @@
#ifndef _LINUX_HW_BREAKPOINT_H
#define _LINUX_HW_BREAKPOINT_H
enum {
HW_BREAKPOINT_LEN_1 = 1,
HW_BREAKPOINT_LEN_2 = 2,
HW_BREAKPOINT_LEN_4 = 4,
HW_BREAKPOINT_LEN_8 = 8,
};
enum {
HW_BREAKPOINT_EMPTY = 0,
HW_BREAKPOINT_R = 1,
HW_BREAKPOINT_W = 2,
HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
HW_BREAKPOINT_X = 4,
HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
};
enum bp_type_idx {
TYPE_INST = 0,
#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
TYPE_DATA = 0,
#else
TYPE_DATA = 1,
#endif
TYPE_MAX
};
#ifdef __KERNEL__
#include <linux/perf_event.h>
#include <uapi/linux/hw_breakpoint.h>
#ifdef CONFIG_HAVE_HW_BREAKPOINT
@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
}
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
#endif /* __KERNEL__ */
#endif /* _LINUX_HW_BREAKPOINT_H */

View File

@ -415,3 +415,4 @@ header-y += wireless.h
header-y += x25.h
header-y += xattr.h
header-y += xfrm.h
header-y += hw_breakpoint.h

View File

@ -0,0 +1,30 @@
#ifndef _UAPI_LINUX_HW_BREAKPOINT_H
#define _UAPI_LINUX_HW_BREAKPOINT_H
enum {
HW_BREAKPOINT_LEN_1 = 1,
HW_BREAKPOINT_LEN_2 = 2,
HW_BREAKPOINT_LEN_4 = 4,
HW_BREAKPOINT_LEN_8 = 8,
};
enum {
HW_BREAKPOINT_EMPTY = 0,
HW_BREAKPOINT_R = 1,
HW_BREAKPOINT_W = 2,
HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
HW_BREAKPOINT_X = 4,
HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
};
enum bp_type_idx {
TYPE_INST = 0,
#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
TYPE_DATA = 0,
#else
TYPE_DATA = 1,
#endif
TYPE_MAX
};
#endif /* _UAPI_LINUX_HW_BREAKPOINT_H */

View File

@ -31,44 +31,44 @@ help:
@echo ' clean: a summary clean target to clean _all_ folders'
cpupower: FORCE
$(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1)
$(call descend,power/$@)
firewire lguest perf usb virtio vm: FORCE
$(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1)
$(call descend,$@)
selftests: FORCE
$(QUIET_SUBDIR0)testing/$@/ $(QUIET_SUBDIR1)
$(call descend,testing/$@)
turbostat x86_energy_perf_policy: FORCE
$(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1)
$(call descend,power/x86/$@)
cpupower_install:
$(QUIET_SUBDIR0)power/$(@:_install=)/ $(QUIET_SUBDIR1) install
$(call descend,power/$(@:_install=),install)
firewire_install lguest_install perf_install usb_install virtio_install vm_install:
$(QUIET_SUBDIR0)$(@:_install=)/ $(QUIET_SUBDIR1) install
$(call descend,$(@:_install=),install)
selftests_install:
$(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) install
$(call descend,testing/$(@:_clean=),install)
turbostat_install x86_energy_perf_policy_install:
$(QUIET_SUBDIR0)power/x86/$(@:_install=)/ $(QUIET_SUBDIR1) install
$(call descend,power/x86/$(@:_install=),install)
install: cpupower_install firewire_install lguest_install perf_install \
selftests_install turbostat_install usb_install virtio_install \
vm_install x86_energy_perf_policy_install
cpupower_clean:
$(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean
$(call descend,power/cpupower,clean)
firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean:
$(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean
$(call descend,$(@:_clean=),clean)
selftests_clean:
$(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) clean
$(call descend,testing/$(@:_clean=),clean)
turbostat_clean x86_energy_perf_policy_clean:
$(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean
$(call descend,power/x86/$(@:_clean=),clean)
clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \
turbostat_clean usb_clean virtio_clean vm_clean \

View File

@ -169,7 +169,34 @@ endif
### --- END CONFIGURATION SECTION ---
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
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif
ifneq ($(objtree),)
#$(info Determined 'objtree' to be $(objtree))
endif
ifneq ($(OUTPUT),)
#$(info Determined 'OUTPUT' to be $(OUTPUT))
endif
BASIC_CFLAGS = \
-Iutil/include \
-Iarch/$(ARCH)/include \
$(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \
-I$(srctree)/arch/$(ARCH)/include/uapi \
-I$(srctree)/arch/$(ARCH)/include \
$(if $(objtree),-I$(objtree)/include/generated/uapi) \
-I$(srctree)/include/uapi \
-I$(srctree)/include \
-I$(OUTPUT)util \
-Iutil \
-I. \
-I$(TRACE_EVENT_DIR) \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
BASIC_LDFLAGS =
# Guard against environment variables

View File

@ -3,7 +3,7 @@
#include <stdlib.h>
#include "../../util/types.h"
#include "../../../../../arch/x86/include/asm/perf_regs.h"
#include <asm/perf_regs.h>
#ifndef ARCH_X86_64
#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)

View File

@ -22,9 +22,9 @@
#include <pthread.h>
#include <math.h>
#include "../../arch/x86/include/asm/svm.h"
#include "../../arch/x86/include/asm/vmx.h"
#include "../../arch/x86/include/asm/kvm.h"
#include <asm/svm.h>
#include <asm/vmx.h>
#include <asm/kvm.h>
struct event_key {
#define INVALID_KEY (~0ULL)

View File

@ -15,7 +15,7 @@
#include "util/thread_map.h"
#include "util/pmu.h"
#include "event-parse.h"
#include "../../include/linux/hw_breakpoint.h"
#include <linux/hw_breakpoint.h>
#include <sys/mman.h>

View File

@ -5,8 +5,9 @@ struct winsize;
void get_term_dimensions(struct winsize *ws);
#include <asm/unistd.h>
#if defined(__i386__)
#include "../../arch/x86/include/asm/unistd.h"
#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
#define cpu_relax() asm volatile("rep; nop" ::: "memory");
#define CPUINFO_PROC "model name"
@ -16,7 +17,6 @@ void get_term_dimensions(struct winsize *ws);
#endif
#if defined(__x86_64__)
#include "../../arch/x86/include/asm/unistd.h"
#define rmb() asm volatile("lfence" ::: "memory")
#define cpu_relax() asm volatile("rep; nop" ::: "memory");
#define CPUINFO_PROC "model name"
@ -26,20 +26,17 @@ void get_term_dimensions(struct winsize *ws);
#endif
#ifdef __powerpc__
#include "../../arch/powerpc/include/asm/unistd.h"
#define rmb() asm volatile ("sync" ::: "memory")
#define cpu_relax() asm volatile ("" ::: "memory");
#define CPUINFO_PROC "cpu"
#endif
#ifdef __s390__
#include "../../arch/s390/include/asm/unistd.h"
#define rmb() asm volatile("bcr 15,0" ::: "memory")
#define cpu_relax() asm volatile("" ::: "memory");
#endif
#ifdef __sh__
#include "../../arch/sh/include/asm/unistd.h"
#if defined(__SH4A__) || defined(__SH5__)
# define rmb() asm volatile("synco" ::: "memory")
#else
@ -50,35 +47,30 @@ void get_term_dimensions(struct winsize *ws);
#endif
#ifdef __hppa__
#include "../../arch/parisc/include/asm/unistd.h"
#define rmb() asm volatile("" ::: "memory")
#define cpu_relax() asm volatile("" ::: "memory");
#define CPUINFO_PROC "cpu"
#endif
#ifdef __sparc__
#include "../../arch/sparc/include/uapi/asm/unistd.h"
#define rmb() asm volatile("":::"memory")
#define cpu_relax() asm volatile("":::"memory")
#define CPUINFO_PROC "cpu"
#endif
#ifdef __alpha__
#include "../../arch/alpha/include/asm/unistd.h"
#define rmb() asm volatile("mb" ::: "memory")
#define cpu_relax() asm volatile("" ::: "memory")
#define CPUINFO_PROC "cpu model"
#endif
#ifdef __ia64__
#include "../../arch/ia64/include/asm/unistd.h"
#define rmb() asm volatile ("mf" ::: "memory")
#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
#define CPUINFO_PROC "model name"
#endif
#ifdef __arm__
#include "../../arch/arm/include/asm/unistd.h"
/*
* Use the __kuser_memory_barrier helper in the CPU helper page. See
* arch/arm/kernel/entry-armv.S in the kernel source for details.
@ -89,13 +81,11 @@ void get_term_dimensions(struct winsize *ws);
#endif
#ifdef __aarch64__
#include "../../arch/arm64/include/asm/unistd.h"
#define rmb() asm volatile("dmb ld" ::: "memory")
#define cpu_relax() asm volatile("yield" ::: "memory")
#endif
#ifdef __mips__
#include "../../arch/mips/include/asm/unistd.h"
#define rmb() asm volatile( \
".set mips2\n\t" \
"sync\n\t" \
@ -112,7 +102,7 @@ void get_term_dimensions(struct winsize *ws);
#include <sys/types.h>
#include <sys/syscall.h>
#include "../../include/uapi/linux/perf_event.h"
#include <linux/perf_event.h>
#include "util/types.h"
#include <stdbool.h>

View File

@ -18,8 +18,8 @@
#include "cpumap.h"
#include "thread_map.h"
#include "target.h"
#include "../../../include/linux/hw_breakpoint.h"
#include "../../../include/uapi/linux/perf_event.h"
#include <linux/hw_breakpoint.h>
#include <linux/perf_event.h>
#include "perf_regs.h"
#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))

View File

@ -3,7 +3,8 @@
#include <linux/list.h>
#include <stdbool.h>
#include "../../../include/uapi/linux/perf_event.h"
#include <stddef.h>
#include <linux/perf_event.h>
#include "types.h"
#include "xyarray.h"
#include "cgroup.h"

View File

@ -1,7 +1,7 @@
#ifndef __PERF_HEADER_H
#define __PERF_HEADER_H
#include "../../../include/uapi/linux/perf_event.h"
#include <linux/perf_event.h>
#include <sys/types.h>
#include <stdbool.h>
#include "types.h"

View File

@ -3,7 +3,7 @@
#include "evsel.h"
#include "evlist.h"
#include "sysfs.h"
#include "../../../include/linux/hw_breakpoint.h"
#include <linux/hw_breakpoint.h>
#define TEST_ASSERT_VAL(text, cond) \
do { \

View File

@ -1,4 +1,4 @@
#include "../../../include/linux/hw_breakpoint.h"
#include <linux/hw_breakpoint.h>
#include "util.h"
#include "../perf.h"
#include "evlist.h"

View File

@ -7,7 +7,7 @@
#include <linux/list.h>
#include <stdbool.h>
#include "types.h"
#include "../../../include/uapi/linux/perf_event.h"
#include <linux/perf_event.h>
#include "types.h"
struct list_head;

View File

@ -2,7 +2,7 @@
#define __PMU_H
#include <linux/bitops.h>
#include "../../../include/uapi/linux/perf_event.h"
#include <linux/perf_event.h>
enum {
PERF_PMU_FORMAT_VALUE_CONFIG,

View File

@ -7,7 +7,7 @@
#include "symbol.h"
#include "thread.h"
#include <linux/rbtree.h>
#include "../../../include/uapi/linux/perf_event.h"
#include <linux/perf_event.h>
struct sample_queue;
struct ip_callchain;

View File

@ -1,8 +1,11 @@
ifeq ("$(origin O)", "command line")
ifeq ($(origin O), command line)
dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
ABSOLUTE_O := $(shell cd $(O) ; pwd)
OUTPUT := $(ABSOLUTE_O)/
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
objtree := $(O)
endif
endif
ifneq ($(OUTPUT),)
@ -41,7 +44,16 @@ else
NO_SUBDIR = :
endif
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
#
# Define a callable command for descending to a new directory
#
# Call by doing: $(call descend,directory[,target])
#
descend = \
+mkdir -p $(OUTPUT)$(1) && \
$(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
QUIET_SUBDIR1 =
ifneq ($(findstring $(MAKEFLAGS),s),s)
@ -56,5 +68,10 @@ ifndef V
$(MAKE) $(PRINT_DIR) -C $$subdir
QUIET_FLEX = @echo ' ' FLEX $@;
QUIET_BISON = @echo ' ' BISON $@;
descend = \
@echo ' ' DESCEND $(1); \
mkdir -p $(OUTPUT)$(1) && \
$(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
endif
endif