perf/core improvements and fixes
Subsystems (2)
Jiri Olsa
reviewerhi Ingo,
please consider pulling
thanks,
jirka
The following changes since commit 3617660e4e1618a888a2e3a4067224534302cb33:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-05-01 08:24:59 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
for you to fetch changes up to 73a31b7c6a85e2f033524058bad5bce900e4f2ed:
perf tools: Move ACCESS_ONCE from perf.h header (2014-05-05 17:49:07 +0200)
----------------------------------------------------------------
perf/core improvements and fixes:
. Cleanups for perf.h header (Jiri Olsa)
. Consolidate types.h and export.h within tools (Borislav Petkov)
----------------------------------------------------------------
Borislav Petkov (2):
tools: Unify export.h
tools: Consolidate types.h
Jiri Olsa (10):
perf tools: Remove MAX_COUNTERS define from perf.h perf tools: Remove unlikely define from perf.h
perf tools: Remove min define from perf.h
perf tools: Remove asmlinkage define from perf.h perf tools: Remove PR_TASK_PERF_EVENTS_* from perf.h perf tools: Move sample data structures from perf.h perf tools: Move perf_call_graph_mode enum from perf.h perf tools: Move syscall and arch specific defines from perf.h perf tools: Move sys_perf_event_open function from perf.h perf tools: Move ACCESS_ONCE from perf.h header
tools/include/linux/compiler.h | 2 +
tools/{virtio => include}/linux/export.h | 5 +
.../lockdep/uinclude => include}/linux/types.h | 29 ++-
tools/lib/lockdep/Makefile | 2 +-
tools/lib/lockdep/uinclude/linux/export.h | 7 -
tools/perf/MANIFEST | 2 +
tools/perf/Makefile.perf | 5 +-
tools/perf/arch/x86/include/perf_regs.h | 2 +-
tools/perf/arch/x86/util/tsc.c | 2 +-
tools/perf/arch/x86/util/tsc.h | 2 +-
tools/perf/perf-sys.h | 190 +++++++++++++++
tools/perf/perf.h | 254 +--------------------
tools/perf/tests/attr.c | 7 -
tools/perf/tests/code-reading.c | 3 +-
tools/perf/tests/dso-data.c | 2 +-
tools/perf/tests/dwarf-unwind.c | 2 +-
tools/perf/tests/keep-tracking.c | 2 +-
tools/perf/tests/parse-no-sample-id-all.c | 2 +-
tools/perf/tests/perf-time-to-tsc.c | 3 +-
tools/perf/tests/rdpmc.c | 2 +-
tools/perf/tests/sample-parsing.c | 2 +-
tools/perf/ui/browser.h | 4 +-
tools/perf/ui/progress.h | 2 +-
tools/perf/util/annotate.h | 2 +-
tools/perf/util/build-id.h | 2 +-
tools/perf/util/callchain.h | 7 +
tools/perf/util/dso.h | 2 +-
tools/perf/util/event.h | 24 ++
tools/perf/util/evsel.h | 4 +-
tools/perf/util/header.h | 4 +-
tools/perf/util/include/linux/bitmap.h | 3 +
tools/perf/util/include/linux/export.h | 6 -
tools/perf/util/include/linux/list.h | 1 +
tools/perf/util/include/linux/types.h | 29 ---
tools/perf/util/map.h | 2 +-
tools/perf/util/parse-events.h | 3 +-
tools/perf/util/parse-events.y | 2 +-
tools/perf/util/perf_regs.h | 2 +-
tools/perf/util/pmu.h | 2 +-
tools/perf/util/stat.h | 2 +-
tools/perf/util/svghelper.c | 2 +-
tools/perf/util/svghelper.h | 2 +-
tools/perf/util/symbol.h | 1 +
tools/perf/util/top.h | 2 +-
tools/perf/util/types.h | 19 --
tools/perf/util/unwind-libdw.c | 2 +-
tools/perf/util/unwind.h | 2 +-
tools/perf/util/util.h | 2 +-
tools/perf/util/values.h | 2 +-
tools/virtio/Makefile | 2 +-
tools/virtio/linux/kernel.h | 7 -
tools/virtio/linux/types.h | 28 ---
52 files changed, 304 insertions(+), 397 deletions(-)
rename tools/{virtio => include}/linux/export.h (70%)
rename tools/{lib/lockdep/uinclude => include}/linux/types.h (63%)
delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h
create mode 100644 tools/perf/perf-sys.h
delete mode 100644 tools/perf/util/include/linux/export.h
delete mode 100644 tools/perf/util/include/linux/types.h
delete mode 100644 tools/perf/util/types.h
delete mode 100644 tools/virtio/linux/types.hJiri Olsa
reviewerPATCH 1/12 tools: Unify export.h
From: Borislav Petkov <[email protected]>
So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.
--- tools/include/linux/export.h | 10 ++++++++++ tools/lib/lockdep/Makefile | 2 +- tools/lib/lockdep/uinclude/linux/export.h | 7 ------- tools/perf/MANIFEST | 1 + tools/perf/Makefile.perf | 2 +- tools/perf/util/include/linux/export.h | 6 ------ tools/virtio/Makefile | 2 +- tools/virtio/linux/export.h | 5 ----- 8 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 tools/include/linux/export.h delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h delete mode 100644 tools/perf/util/include/linux/export.h delete mode 100644 tools/virtio/linux/export.h
tools/include/linux/export.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _TOOLS_LINUX_EXPORT_H_ +#define _TOOLS_LINUX_EXPORT_H_ + +#define EXPORT_SYMBOL (sym) +#define EXPORT_SYMBOL_GPL (sym) +#define EXPORT_SYMBOL_GPL_FUTURE (sym) +#define EXPORT_UNUSED_SYMBOL (sym) +#define EXPORT_UNUSED_SYMBOL_GPL (sym) + +#endif
tools/lib/lockdep/Makefile +1 -1
@@ -105,7 +105,7 @@ N = export Q VERBOSE -INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include $(CONFIG_INCLUDES) +INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES) # Set compile option CFLAGS if not set elsewhere CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g
tools/lib/lockdep/uinclude/linux/export.h deleted +0 -7
@@ -1,7 +0,0 @@ -#ifndef _LIBLOCKDEP_LINUX_EXPORT_H_ -#define _LIBLOCKDEP_LINUX_EXPORT_H_ - -#define EXPORT_SYMBOL (sym) -#define EXPORT_SYMBOL_GPL (sym) - -#endif
tools/perf/MANIFEST +1 -0
@@ -7,6 +7,7 @@ tools/lib/symbol/kallsyms.h tools/include/asm/bug.h tools/include/linux/compiler.h tools/include/linux/hash.h +tools/include/linux/export.h include/linux/const.h include/linux/perf_event.h include/linux/rbtree.h
tools/perf/Makefile.perf +1 -1
@@ -222,7 +222,7 @@ LIB_H += util/include/linux/const.h LIB_H += util/include/linux/ctype.h LIB_H += util/include/linux/kernel.h LIB_H += util/include/linux/list.h -LIB_H += util/include/linux/export.h +LIB_H += ../include/linux/export.h LIB_H += util/include/linux/poison.h LIB_H += util/include/linux/rbtree.h LIB_H += util/include/linux/rbtree_augmented.h
tools/perf/util/include/linux/export.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef PERF_LINUX_MODULE_H -#define PERF_LINUX_MODULE_H - -#define EXPORT_SYMBOL (name) - -#endif
tools/virtio/Makefile +1 -1
@@ -3,7 +3,7 @@ test: virtio_test vringh_test virtio_test: virtio_ring.o virtio_test.o vringh_test: vringh_test.o vringh.o virtio_ring.o -CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE +CFLAGS += -g -O2 -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE vpath %.c ../../drivers/virtio ../../drivers/vhost mod: ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
tools/virtio/linux/export.h deleted +0 -5
@@ -1,5 +0,0 @@ -#define EXPORT_SYMBOL (sym) -#define EXPORT_SYMBOL_GPL (sym) -#define EXPORT_SYMBOL_GPL_FUTURE (sym) -#define EXPORT_UNUSED_SYMBOL (sym) -#define EXPORT_UNUSED_SYMBOL_GPL (sym)
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 1/12 tools: Unify export.h
In reply to Jiri OlsaFrom: Borislav Petkov <[email protected]>
So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.
--- tools/include/linux/export.h | 10 ++++++++++ tools/lib/lockdep/Makefile | 2 +- tools/lib/lockdep/uinclude/linux/export.h | 7 ------- tools/perf/MANIFEST | 1 + tools/perf/Makefile.perf | 2 +- tools/perf/util/include/linux/export.h | 6 ------ tools/virtio/Makefile | 2 +- tools/virtio/linux/export.h | 5 ----- 8 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 tools/include/linux/export.h delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h delete mode 100644 tools/perf/util/include/linux/export.h delete mode 100644 tools/virtio/linux/export.h
tools/include/linux/export.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _TOOLS_LINUX_EXPORT_H_ +#define _TOOLS_LINUX_EXPORT_H_ + +#define EXPORT_SYMBOL (sym) +#define EXPORT_SYMBOL_GPL (sym) +#define EXPORT_SYMBOL_GPL_FUTURE (sym) +#define EXPORT_UNUSED_SYMBOL (sym) +#define EXPORT_UNUSED_SYMBOL_GPL (sym) + +#endif
tools/lib/lockdep/Makefile +1 -1
@@ -105,7 +105,7 @@ N = export Q VERBOSE -INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include $(CONFIG_INCLUDES) +INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES) # Set compile option CFLAGS if not set elsewhere CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g
tools/lib/lockdep/uinclude/linux/export.h deleted +0 -7
@@ -1,7 +0,0 @@ -#ifndef _LIBLOCKDEP_LINUX_EXPORT_H_ -#define _LIBLOCKDEP_LINUX_EXPORT_H_ - -#define EXPORT_SYMBOL (sym) -#define EXPORT_SYMBOL_GPL (sym) - -#endif
tools/perf/MANIFEST +1 -0
@@ -7,6 +7,7 @@ tools/lib/symbol/kallsyms.h tools/include/asm/bug.h tools/include/linux/compiler.h tools/include/linux/hash.h +tools/include/linux/export.h include/linux/const.h include/linux/perf_event.h include/linux/rbtree.h
tools/perf/Makefile.perf +1 -1
@@ -222,7 +222,7 @@ LIB_H += util/include/linux/const.h LIB_H += util/include/linux/ctype.h LIB_H += util/include/linux/kernel.h LIB_H += util/include/linux/list.h -LIB_H += util/include/linux/export.h +LIB_H += ../include/linux/export.h LIB_H += util/include/linux/poison.h LIB_H += util/include/linux/rbtree.h LIB_H += util/include/linux/rbtree_augmented.h
tools/perf/util/include/linux/export.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef PERF_LINUX_MODULE_H -#define PERF_LINUX_MODULE_H - -#define EXPORT_SYMBOL (name) - -#endif
tools/virtio/Makefile +1 -1
@@ -3,7 +3,7 @@ test: virtio_test vringh_test virtio_test: virtio_ring.o virtio_test.o vringh_test: vringh_test.o vringh.o virtio_ring.o -CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE +CFLAGS += -g -O2 -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE vpath %.c ../../drivers/virtio ../../drivers/vhost mod: ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
tools/virtio/linux/export.h deleted +0 -5
@@ -1,5 +0,0 @@ -#define EXPORT_SYMBOL (sym) -#define EXPORT_SYMBOL_GPL (sym) -#define EXPORT_SYMBOL_GPL_FUTURE (sym) -#define EXPORT_UNUSED_SYMBOL (sym) -#define EXPORT_UNUSED_SYMBOL_GPL (sym)
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 2/12 tools: Consolidate types.h
In reply to Jiri OlsaFrom: Borislav Petkov <[email protected]>
Combine all definitions into a common tools/include/linux/types.h and kill the wild growth elsewhere. Move DECLARE_BITMAP to its proper bitmap.h header.
--- tools/include/linux/types.h | 75 +++++++++++++++++++++++++++++++ tools/lib/lockdep/uinclude/linux/types.h | 58 ------------------------ tools/perf/MANIFEST | 1 + tools/perf/Makefile.perf | 3 +- tools/perf/arch/x86/include/perf_regs.h | 2 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/arch/x86/util/tsc.h | 2 +- tools/perf/perf.h | 4 +- tools/perf/tests/attr.c | 7 --- tools/perf/tests/code-reading.c | 3 +- tools/perf/tests/dso-data.c | 2 +- tools/perf/tests/dwarf-unwind.c | 2 +- tools/perf/tests/keep-tracking.c | 2 +- tools/perf/tests/parse-no-sample-id-all.c | 2 +- tools/perf/tests/perf-time-to-tsc.c | 3 +- tools/perf/tests/rdpmc.c | 2 +- tools/perf/tests/sample-parsing.c | 2 +- tools/perf/ui/browser.h | 4 +- tools/perf/ui/progress.h | 2 +- tools/perf/util/annotate.h | 2 +- tools/perf/util/build-id.h | 2 +- tools/perf/util/dso.h | 2 +- tools/perf/util/evsel.h | 4 +- tools/perf/util/header.h | 4 +- tools/perf/util/include/linux/bitmap.h | 3 ++ tools/perf/util/include/linux/list.h | 1 + tools/perf/util/include/linux/types.h | 29 ------------ tools/perf/util/map.h | 2 +- tools/perf/util/parse-events.h | 3 +- tools/perf/util/parse-events.y | 2 +- tools/perf/util/perf_regs.h | 2 +- tools/perf/util/pmu.h | 2 +- tools/perf/util/stat.h | 2 +- tools/perf/util/svghelper.c | 2 +- tools/perf/util/svghelper.h | 2 +- tools/perf/util/top.h | 2 +- tools/perf/util/types.h | 19 -------- tools/perf/util/unwind-libdw.c | 2 +- tools/perf/util/unwind.h | 2 +- tools/perf/util/util.h | 2 +- tools/perf/util/values.h | 2 +- tools/virtio/linux/kernel.h | 7 --- tools/virtio/linux/types.h | 28 ------------ 43 files changed, 115 insertions(+), 191 deletions(-) create mode 100644 tools/include/linux/types.h delete mode 100644 tools/lib/lockdep/uinclude/linux/types.h delete mode 100644 tools/perf/util/include/linux/types.h delete mode 100644 tools/perf/util/types.h delete mode 100644 tools/virtio/linux/types.h
tools/include/linux/types.h new file +75 -0
@@ -0,0 +1,75 @@ +#ifndef _TOOLS_LINUX_TYPES_H_ +#define _TOOLS_LINUX_TYPES_H_ + +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#define __SANE_USERSPACE_TYPES__/* For PPC64, to get LL64 types */ +#include <asm/types.h> + +struct page ; +struct kmem_cache ; + +typedef enum { +GFP_KERNEL , +GFP_ATOMIC , + __GFP_HIGHMEM, + __GFP_HIGH +}gfp_t ; + +/* +* We define u64 as uint64_t for every architecture +* so that we can print it with "%"PRIx64 without getting warnings. +* +* typedef __u64 u64; +* typedef __s64 s64; +*/ +typedef uint64_t u64 ; +typedef int64_t s64 ; + +typedef __u32 u32 ; +typedef __s32 s32 ; + +typedef __u16 u16 ; +typedef __s16 s16 ; + +typedef __u8 u8 ; +typedef __s8 s8 ; + +#ifdef __CHECKER__ +#define __bitwise__ __attribute__((bitwise)) +#else +#define __bitwise__ +#endif +#ifdef __CHECK_ENDIAN__ +#define __bitwise __bitwise__ +#else +#define __bitwise +#endif + +#define __force +#define __user +#define __must_check +#define __cold + +typedef __u16 __bitwise __le16 ; +typedef __u16 __bitwise __be16 ; +typedef __u32 __bitwise __le32 ; +typedef __u32 __bitwise __be32 ; +typedef __u64 __bitwise __le64 ; +typedef __u64 __bitwise __be64 ; + +struct list_head { +struct list_head *next, *prev; +}; + +struct hlist_head { +struct hlist_node *first; +}; + +struct hlist_node { +struct hlist_node *next, **pprev; +}; + +#endif /* _TOOLS_LINUX_TYPES_H_ */
tools/lib/lockdep/uinclude/linux/types.h deleted +0 -58
58 lines not on this page · raw message
tools/perf/MANIFEST +1 -0
@@ -8,6 +8,7 @@ tools/include/asm/bug.h tools/include/linux/compiler.h tools/include/linux/hash.h tools/include/linux/export.h +tools/include/linux/types.h include/linux/const.h include/linux/perf_event.h include/linux/rbtree.h
tools/perf/Makefile.perf +1 -2
@@ -227,7 +227,7 @@ LIB_H += util/include/linux/poison.h LIB_H += util/include/linux/rbtree.h LIB_H += util/include/linux/rbtree_augmented.h LIB_H += util/include/linux/string.h -LIB_H += util/include/linux/types.h +LIB_H += ../include/linux/types.h LIB_H += util/include/linux/linkage.h LIB_H += util/include/asm/asm-offsets.h LIB_H += ../include/asm/bug.h
@@ -252,7 +252,6 @@ LIB_H += util/event.h LIB_H += util/evsel.h LIB_H += util/evlist.h LIB_H += util/exec_cmd.h -LIB_H += util/types.h LIB_H += util/levenshtein.h LIB_H += util/machine.h LIB_H += util/map.h
tools/perf/arch/x86/include/perf_regs.h +1 -1
@@ -2,7 +2,7 @@#define ARCH_PERF_REGS_H #include <stdlib.h> -#include "../../util/types.h" +#include <linux/types.h> #include <asm/perf_regs.h> void perf_regs_load (u64 *regs);
tools/perf/arch/x86/util/tsc.c +1 -1
@@ -4,7 +4,7 @@#include <linux/perf_event.h> #include "../../perf.h" -#include "../../util/types.h" +#include <linux/types.h> #include "../../util/debug.h" #include "tsc.h"
tools/perf/arch/x86/util/tsc.h +1 -1
@@ -1,7 +1,7 @@ #ifndef TOOLS_PERF_ARCH_X86_UTIL_TSC_H__ #define TOOLS_PERF_ARCH_X86_UTIL_TSC_H__ -#include "../../util/types.h" +#include <linux/types.h> struct perf_tsc_conversion { u16 time_shift;
tools/perf/perf.h +1 -3
@@ -173,9 +173,8 @@#include <sys/types.h> #include <sys/syscall.h> +#include <linux/types.h> #include <linux/perf_event.h> -#include "util/types.h" -#include <stdbool.h> /* * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all
@@ -202,7 +201,6 @@ static inline unsigned long long rdclock(void)/* * Pick up some kernel type conventions: */ -#define __user#define asmlinkage#define unlikely (x) __builtin_expect(!!(x), 0)
tools/perf/tests/attr.c +0 -7
@@ -1,4 +1,3 @@ -/* * The struct perf_event_attr test support. *
@@ -19,14 +18,8 @@* permissions. All the event text files are stored there. */ -/* -* Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select -* 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu. -*/ -#define __SANE_USERSPACE_TYPES__#include <stdlib.h> #include <stdio.h> -#include <inttypes.h> #include <linux/types.h> #include <linux/kernel.h> #include "../perf.h"
tools/perf/tests/code-reading.c +1 -2
@@ -1,8 +1,7 @@ -#include <sys/types.h> +#include <linux/types.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> -#include <inttypes.h> #include <ctype.h> #include <string.h>
tools/perf/tests/dso-data.c +1 -1
@@ -1,7 +1,7 @@#include "util.h" #include <stdlib.h> -#include <sys/types.h> +#include <linux/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h>
tools/perf/tests/dwarf-unwind.c +1 -1
@@ -1,5 +1,5 @@#include <linux/compiler.h> -#include <sys/types.h> +#include <linux/types.h> #include <unistd.h> #include "tests.h" #include "debug.h"
tools/perf/tests/keep-tracking.c +1 -1
@@ -1,4 +1,4 @@ -#include <sys/types.h> +#include <linux/types.h> #include <unistd.h> #include <sys/prctl.h>
tools/perf/tests/parse-no-sample-id-all.c +1 -1
@@ -1,4 +1,4 @@ -#include <sys/types.h> +#include <linux/types.h> #include <stddef.h> #include "tests.h"
tools/perf/tests/perf-time-to-tsc.c +1 -2
@@ -1,7 +1,6 @@#include <stdio.h> -#include <sys/types.h> #include <unistd.h> -#include <inttypes.h> +#include <linux/types.h> #include <sys/prctl.h> #include "parse-events.h"
tools/perf/tests/rdpmc.c +1 -1
@@ -2,7 +2,7 @@#include <stdlib.h> #include <signal.h> #include <sys/mman.h> -#include "types.h" +#include <linux/types.h> #include "perf.h" #include "debug.h" #include "tests.h"
tools/perf/tests/sample-parsing.c +1 -1
@@ -1,5 +1,5 @@#include <stdbool.h> -#include <inttypes.h> +#include <linux/types.h> #include "util.h" #include "event.h"
tools/perf/ui/browser.h +1 -3
@@ -1,9 +1,7 @@#ifndef _PERF_UI_BROWSER_H_#define _PERF_UI_BROWSER_H_ 1 -#include <stdbool.h> -#include <sys/types.h> -#include "../types.h" +#include <linux/types.h> #define HE_COLORSET_TOP 50#define HE_COLORSET_MEDIUM 51
tools/perf/ui/progress.h +1 -1
@@ -1,7 +1,7 @@#ifndef _PERF_UI_PROGRESS_H_#define _PERF_UI_PROGRESS_H_ 1 -#include <../types.h> +#include <linux/types.h> void ui_progress__finish (void );
tools/perf/util/annotate.h +1 -1
@@ -3,7 +3,7 @@#include <stdbool.h> #include <stdint.h> -#include "types.h" +#include <linux/types.h> #include "symbol.h" #include "hist.h" #include "sort.h"
tools/perf/util/build-id.h +1 -1
@@ -4,7 +4,7 @@#define BUILD_ID_SIZE 20#include "tool.h" -#include "types.h" +#include <linux/types.h> extern struct perf_tool build_id__mark_dso_hit_ops;struct dso ;
tools/perf/util/dso.h +1 -1
@@ -4,7 +4,7 @@#include <linux/types.h> #include <linux/rbtree.h> #include <stdbool.h> -#include "types.h" +#include <linux/types.h> #include "map.h" #include "build-id.h"
tools/perf/util/evsel.h +2 -2
@@ -5,12 +5,12 @@#include <stdbool.h> #include <stddef.h> #include <linux/perf_event.h> -#include "types.h" +#include <linux/types.h> #include "xyarray.h" #include "cgroup.h" #include "hist.h" #include "symbol.h" - + struct perf_counts_values { union { struct {
tools/perf/util/header.h +2 -2
@@ -4,10 +4,10 @@#include <linux/perf_event.h> #include <sys/types.h> #include <stdbool.h> -#include "types.h" +#include <linux/bitmap.h> +#include <linux/types.h> #include "event.h" -#include <linux/bitmap.h> enum {HEADER_RESERVED =0 ,/* always cleared */
tools/perf/util/include/linux/bitmap.h +3 -0
@@ -4,6 +4,9 @@#include <string.h> #include <linux/bitops.h> +#define DECLARE_BITMAP (name,bits) \ + unsigned long name[BITS_TO_LONGS(bits)] +int __bitmap_weight (const unsigned long *bitmap,int bits);void __bitmap_or (unsigned long *dst,const unsigned long *bitmap1,const unsigned long *bitmap2,int bits);
tools/perf/util/include/linux/list.h +1 -0
@@ -1,4 +1,5 @@#include <linux/kernel.h> +#include <linux/types.h> #include "../../../../include/linux/list.h"
tools/perf/util/include/linux/types.h deleted +0 -29
@@ -1,29 +0,0 @@ -#ifndef _PERF_LINUX_TYPES_H_ -#define _PERF_LINUX_TYPES_H_ - -#include <asm/types.h> - -#ifndef __bitwise -#define __bitwise -#endif - -#ifndef __le32 -typedef __u32 __bitwise __le32 ; -#endif - -#define DECLARE_BITMAP (name,bits) \ - unsigned long name[BITS_TO_LONGS(bits)] - -struct list_head { -struct list_head *next, *prev; -}; - -struct hlist_head { -struct hlist_node *first; -}; - -struct hlist_node { -struct hlist_node *next, **pprev; -}; - -#endif
tools/perf/util/map.h +1 -1
@@ -6,7 +6,7 @@#include <linux/rbtree.h> #include <stdio.h> #include <stdbool.h> -#include "types.h" +#include <linux/types.h> enum map_type {MAP__FUNCTION =0 ,
tools/perf/util/parse-events.h +1 -2
@@ -6,9 +6,8 @@#include <linux/list.h> #include <stdbool.h> -#include "types.h" +#include <linux/types.h> #include <linux/perf_event.h> -#include "types.h" struct list_head ;struct perf_evsel ;
tools/perf/util/parse-events.y +1 -1
@@ -9,7 +9,7 @@ #include <linux/compiler.h> #include <linux/list.h> -#include "types.h" +#include <linux/types.h> #include "util.h" #include "parse-events.h" #include "parse-events-bison.h"
tools/perf/util/perf_regs.h +1 -1
@@ -1,7 +1,7 @@#ifndef __PERF_REGS_H#define __PERF_REGS_H -#include "types.h" +#include <linux/types.h> #include "event.h" #ifdef HAVE_PERF_REGS_SUPPORT
tools/perf/util/pmu.h +1 -1
@@ -1,7 +1,7 @@#ifndef __PMU_H#define __PMU_H -#include <linux/bitops.h> +#include <linux/bitmap.h> #include <linux/perf_event.h> #include <stdbool.h>
tools/perf/util/stat.h +1 -1
@@ -1,7 +1,7 @@#ifndef __PERF_STATS_H#define __PERF_STATS_H -#include "types.h" +#include <linux/types.h> struct stats {
tools/perf/util/svghelper.c +1 -1
@@ -17,7 +17,7 @@#include <stdlib.h> #include <unistd.h> #include <string.h> -#include <linux/bitops.h> +#include <linux/bitmap.h> #include "perf.h" #include "svghelper.h"
tools/perf/util/svghelper.h +1 -1
@@ -1,7 +1,7 @@#ifndef __PERF_SVGHELPER_H#define __PERF_SVGHELPER_H -#include "types.h" +#include <linux/types.h> extern void open_svg (const char *filename,int cpus,int rows,u64 start,u64 end);extern void svg_box (int Yslot,u64 start,u64 end,const char *type);
tools/perf/util/top.h +1 -1
@@ -2,7 +2,7 @@#define __PERF_TOP_H 1#include "tool.h" -#include "types.h" +#include <linux/types.h> #include <stddef.h> #include <stdbool.h> #include <termios.h>
tools/perf/util/types.h deleted +0 -19
@@ -1,19 +0,0 @@ -#ifndef __PERF_TYPES_H -#define __PERF_TYPES_H - -#include <stdint.h> - -/* -* We define u64 as uint64_t for every architecture -* so that we can print it with "%"PRIx64 without getting warnings. -*/ -typedef uint64_t u64 ; -typedef int64_t s64 ; -typedef unsigned int u32 ; -typedef signed int s32 ; -typedef unsigned short u16 ; -typedef signed short s16 ; -typedef unsigned char u8 ; -typedef signed char s8 ; - -#endif /* __PERF_TYPES_H */
tools/perf/util/unwind-libdw.c +1 -1
@@ -7,7 +7,7 @@#include "unwind-libdw.h" #include "machine.h" #include "thread.h" -#include "types.h" +#include <linux/types.h> #include "event.h" #include "perf_regs.h"
tools/perf/util/unwind.h +1 -1
@@ -1,7 +1,7 @@#ifndef __UNWIND_H#define __UNWIND_H -#include "types.h" +#include <linux/types.h> #include "event.h" #include "symbol.h"
tools/perf/util/util.h +1 -1
@@ -69,7 +69,7 @@#include <sys/ioctl.h> #include <inttypes.h> #include <linux/magic.h> -#include "types.h" +#include <linux/types.h> #include <sys/ttydefaults.h> #include <api/fs/debugfs.h> #include <termios.h>
tools/perf/util/values.h +1 -1
@@ -1,7 +1,7 @@ #ifndef __PERF_VALUES_H #define __PERF_VALUES_H -#include "types.h" +#include <linux/types.h> struct perf_read_values { int threads;
tools/virtio/linux/kernel.h +0 -7
@@ -38,13 +38,6 @@ struct page {#define __printf (a,b) __attribute__((format(printf,a,b))) -typedef enum { -GFP_KERNEL , -GFP_ATOMIC , - __GFP_HIGHMEM, - __GFP_HIGH -}gfp_t ; -#define ARRAY_SIZE (x) (sizeof(x)/sizeof(x[0]))extern void *__kmalloc_fake, *__kfree_ignore_start, *__kfree_ignore_end;
tools/virtio/linux/types.h deleted +0 -28
@@ -1,28 +0,0 @@ -#ifndef TYPES_H -#define TYPES_H -#include <stdint.h> - -#define __force -#define __user -#define __must_check -#define __cold - -typedef uint64_t u64 ; -typedef int64_t s64 ; -typedef uint32_t u32 ; -typedef int32_t s32 ; -typedef uint16_t u16 ; -typedef int16_t s16 ; -typedef uint8_t u8 ; -typedef int8_t s8 ; - -typedef uint64_t __u64 ; -typedef int64_t __s64 ; -typedef uint32_t __u32 ; -typedef int32_t __s32 ; -typedef uint16_t __u16 ; -typedef int16_t __s16 ; -typedef uint8_t __u8 ; -typedef int8_t __s8 ; - -#endif /* TYPES_H */
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 3/12 perf tools: Remove MAX_COUNTERS define from perf.h
In reply to Jiri OlsaAs it's no longer used.
--- tools/perf/perf.h | 1 - 1 file changed, 1 deletion(-)
tools/perf/perf.h +0 -1
@@ -231,7 +231,6 @@ sys_perf_event_open(struct perf_event_attr *attr,return fd; } -#define MAX_COUNTERS 256#define MAX_NR_CPUS 256struct ip_callchain {
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 4/12 perf tools: Remove unlikely define from perf.h
In reply to Jiri OlsaIt's defined in tools/include/linux/compiler.h header.
--- tools/perf/perf.h | 1 - 1 file changed, 1 deletion(-)
tools/perf/perf.h +0 -1
@@ -203,7 +203,6 @@ static inline unsigned long long rdclock(void)*/ #define asmlinkage -#define unlikely (x) __builtin_expect(!!(x), 0)#define min (x, y) ({ \ typeof(x) _min1 = (x); \ typeof(y) _min2 = (y); \
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 5/12 perf tools: Remove min define from perf.h
In reply to Jiri OlsaIt's defined in tools/perf/util/include/linux/kernel.h header.
--- tools/perf/perf.h | 6 ------ 1 file changed, 6 deletions(-)
tools/perf/perf.h +0 -6
@@ -203,12 +203,6 @@ static inline unsigned long long rdclock(void)*/ #define asmlinkage -#define min (x, y) ({ \ - typeof(x) _min1 = (x); \ - typeof(y) _min2 = (y); \ - (void) (&_min1 == &_min2); \ - _min1 < _min2 ? _min1 : _min2; }) -extern bool test_attr__enabled;void test_attr__init (void ); void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 6/12 perf tools: Remove asmlinkage define from perf.h
In reply to Jiri OlsaAs it's no longer used.
--- tools/perf/perf.h | 5 ----- 1 file changed, 5 deletions(-)
tools/perf/perf.h +0 -5
@@ -198,11 +198,6 @@ static inline unsigned long long rdclock(void)return ts.tv_sec *1000000000ULL + ts.tv_nsec; } -/* -* Pick up some kernel type conventions: -*/ -#define asmlinkage -extern bool test_attr__enabled;void test_attr__init (void ); void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 7/12 perf tools: Remove PR_TASK_PERF_EVENTS_* from perf.h
In reply to Jiri OlsaIt's defined in include/uapi/linux/prctl.h header. Also it was never used in perf tool.
--- tools/perf/perf.h | 7 ------- 1 file changed, 7 deletions(-)
tools/perf/perf.h +0 -7
@@ -176,13 +176,6 @@#include <linux/types.h> #include <linux/perf_event.h> -/* -* prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all -* counters in the current task. -*/ -#define PR_TASK_PERF_EVENTS_DISABLE 31 -#define PR_TASK_PERF_EVENTS_ENABLE 32 -#ifndef NSEC_PER_SEC # define NSEC_PER_SEC 1000000000ULL#endif
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 8/12 perf tools: Move sample data structures from perf.h
In reply to Jiri OlsaInto util/event.h header where all sample data structures are defined.
--- tools/perf/perf.h | 24 ------------------------ tools/perf/util/event.h | 24 ++++++++++++++++++++++++ tools/perf/util/symbol.h | 1 + 3 files changed, 25 insertions(+), 24 deletions(-)
tools/perf/perf.h +0 -24
@@ -214,30 +214,6 @@ sys_perf_event_open(struct perf_event_attr *attr,#define MAX_NR_CPUS 256 -struct ip_callchain { -u64 nr; -u64 ips[0 ]; -}; - -struct branch_flags { -u64 mispred:1 ; -u64 predicted:1 ; -u64 in_tx:1 ; -u64 abort:1 ; -u64 reserved:60 ; -}; - -struct branch_entry { -u64 from; -u64 to; -struct branch_flags flags; -}; - -struct branch_stack { -u64 nr; -struct branch_entry entries[0 ]; -}; -extern const char *input_name;extern bool perf_host, perf_guest;extern const char perf_version_string[];
tools/perf/util/event.h +24 -0
@@ -112,6 +112,30 @@ struct sample_read { }; }; +struct ip_callchain { +u64 nr; +u64 ips[0 ]; +}; + +struct branch_flags { +u64 mispred:1 ; +u64 predicted:1 ; +u64 in_tx:1 ; +u64 abort:1 ; +u64 reserved:60 ; +}; + +struct branch_entry { +u64 from; +u64 to; +struct branch_flags flags; +}; + +struct branch_stack { +u64 nr; +struct branch_entry entries[0 ]; +}; +struct perf_sample {u64 ip;u32 pid, tid;
tools/perf/util/symbol.h +1 -0
@@ -12,6 +12,7 @@#include <byteswap.h> #include <libgen.h> #include "build-id.h" +#include "event.h" #ifdef HAVE_LIBELF_SUPPORT #include <libelf.h>
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 9/12 perf tools: Move perf_call_graph_mode enum from perf.h
In reply to Jiri OlsaInto util/callchain.h header where all callchain related structures should be.
--- tools/perf/perf.h | 7 ------- tools/perf/util/callchain.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/perf.h +0 -7
@@ -222,13 +222,6 @@ void pthread__unblock_sigwinch(void);#include "util/target.h" -enum perf_call_graph_mode { -CALLCHAIN_NONE , -CALLCHAIN_FP , -CALLCHAIN_DWARF , -CALLCHAIN_MAX -}; -struct record_opts {struct target target;int call_graph;
tools/perf/util/callchain.h +7 -0
@@ -7,6 +7,13 @@#include "event.h" #include "symbol.h" +enum perf_call_graph_mode { +CALLCHAIN_NONE , +CALLCHAIN_FP , +CALLCHAIN_DWARF , +CALLCHAIN_MAX +}; +enum chain_mode {CHAIN_NONE ,CHAIN_FLAT ,
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 10/12 perf tools: Move syscall and arch specific defines from perf.h
In reply to Jiri OlsaInto new perf-sys.h header.
The main reason is to separate system specific perf data from perf tool stuff, so it could be used in small test programs, as requested Peter:
http://lkml.kernel.org/r/[email protected]
This separation makes the perf.h header more clear.
--- tools/perf/perf-sys.h | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/perf.h | 165 +------------------------------------------------ 2 files changed, 169 insertions(+), 164 deletions(-) create mode 100644 tools/perf/perf-sys.h
tools/perf/perf-sys.h new file +168 -0
@@ -0,0 +1,168 @@ +#ifndef _PERF_SYS_H +#define _PERF_SYS_H + +#include <asm/unistd.h> + +#if defined(__i386__) +#define mb () asm volatile("lock; addl $0,0(%%esp)" ::: "memory") +#define wmb () asm volatile("lock; addl $0,0(%%esp)" ::: "memory") +#define rmb () asm volatile("lock; addl $0,0(%%esp)" ::: "memory") +#define cpu_relax () asm volatile("rep; nop" ::: "memory"); +#define CPUINFO_PROC "model name" +#ifndef __NR_perf_event_open +# define __NR_perf_event_open 336 +#endif +#ifndef __NR_futex +# define __NR_futex 240 +#endif +#ifndef __NR_gettid +# define __NR_gettid 224 +#endif +#endif + +#if defined(__x86_64__) +#define mb () asm volatile("mfence" ::: "memory") +#define wmb () asm volatile("sfence" ::: "memory") +#define rmb () asm volatile("lfence" ::: "memory") +#define cpu_relax () asm volatile("rep; nop" ::: "memory"); +#define CPUINFO_PROC "model name" +#ifndef __NR_perf_event_open +# define __NR_perf_event_open 298 +#endif +#ifndef __NR_futex +# define __NR_futex 202 +#endif +#ifndef __NR_gettid +# define __NR_gettid 186 +#endif +#endif + +#ifdef __powerpc__ +#include "../../arch/powerpc/include/uapi/asm/unistd.h" +#define mb () asm volatile ("sync" ::: "memory") +#define wmb () asm volatile ("sync" ::: "memory") +#define rmb () asm volatile ("sync" ::: "memory") +#define CPUINFO_PROC "cpu" +#endif + +#ifdef __s390__ +#define mb () asm volatile("bcr 15,0" ::: "memory") +#define wmb () asm volatile("bcr 15,0" ::: "memory") +#define rmb () asm volatile("bcr 15,0" ::: "memory") +#endif + +#ifdef __sh__ +#if defined(__SH4A__) || defined(__SH5__) +# define mb () asm volatile("synco" ::: "memory") +# define wmb () asm volatile("synco" ::: "memory") +# define rmb () asm volatile("synco" ::: "memory") +#else +# define mb () asm volatile("" ::: "memory") +# define wmb () asm volatile("" ::: "memory") +# define rmb () asm volatile("" ::: "memory") +#endif +#define CPUINFO_PROC "cpu type" +#endif + +#ifdef __hppa__ +#define mb () asm volatile("" ::: "memory") +#define wmb () asm volatile("" ::: "memory") +#define rmb () asm volatile("" ::: "memory") +#define CPUINFO_PROC "cpu" +#endif + +#ifdef __sparc__ +#ifdef __LP64__ +#define mb () asm volatile("ba,pt %%xcc, 1f\n" \ + "membar #StoreLoad\n" \ + "1:\n":::"memory") +#else +#define mb () asm volatile("":::"memory") +#endif +#define wmb () asm volatile("":::"memory") +#define rmb () asm volatile("":::"memory") +#define CPUINFO_PROC "cpu" +#endif + +#ifdef __alpha__ +#define mb () asm volatile("mb" ::: "memory") +#define wmb () asm volatile("wmb" ::: "memory") +#define rmb () asm volatile("mb" ::: "memory") +#define CPUINFO_PROC "cpu model" +#endif + +#ifdef __ia64__ +#define mb () asm volatile ("mf" ::: "memory") +#define wmb () asm volatile ("mf" ::: "memory") +#define rmb () asm volatile ("mf" ::: "memory") +#define cpu_relax () asm volatile ("hint @pause" ::: "memory") +#define CPUINFO_PROC "model name" +#endif + +#ifdef __arm__ +/* +* Use the __kuser_memory_barrier helper in the CPU helper page. See +* arch/arm/kernel/entry-armv.S in the kernel source for details. +*/ +#define mb () ((void(*)(void))0xffff0fa0)() +#define wmb () ((void(*)(void))0xffff0fa0)() +#define rmb () ((void(*)(void))0xffff0fa0)() +#define CPUINFO_PROC "Processor" +#endif + +#ifdef __aarch64__ +#define mb () asm volatile("dmb ish" ::: "memory") +#define wmb () asm volatile("dmb ishst" ::: "memory") +#define rmb () asm volatile("dmb ishld" ::: "memory") +#define cpu_relax () asm volatile("yield" ::: "memory") +#endif + +#ifdef __mips__ +#define mb() asm volatile( \ + ".set mips2\n\t" \ + "sync\n\t" \ + ".set mips0" \ + : /* no output */ \ + : /* no input */ \ + : "memory") +#define wmb () mb() +#define rmb () mb() +#define CPUINFO_PROC "cpu model" +#endif + +#ifdef __arc__ +#define mb () asm volatile("" ::: "memory") +#define wmb () asm volatile("" ::: "memory") +#define rmb () asm volatile("" ::: "memory") +#define CPUINFO_PROC "Processor" +#endif + +#ifdef __metag__ +#define mb () asm volatile("" ::: "memory") +#define wmb () asm volatile("" ::: "memory") +#define rmb () asm volatile("" ::: "memory") +#define CPUINFO_PROC "CPU" +#endif + +#ifdef __xtensa__ +#define mb () asm volatile("memw" ::: "memory") +#define wmb () asm volatile("memw" ::: "memory") +#define rmb () asm volatile("" ::: "memory") +#define CPUINFO_PROC "core ID" +#endif + +#ifdef __tile__ +#define mb () asm volatile ("mf" ::: "memory") +#define wmb () asm volatile ("mf" ::: "memory") +#define rmb () asm volatile ("mf" ::: "memory") +#define cpu_relax () asm volatile ("mfspr zero, PASS" ::: "memory") +#define CPUINFO_PROC "model name" +#endif + +#define barrier () asm volatile ("" ::: "memory") + +#ifndef cpu_relax +#define cpu_relax () barrier() +#endif + +#endif /* _PERF_SYS_H */
tools/perf/perf.h +1 -164
174 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 11/12 perf tools: Move sys_perf_event_open function from perf.h
In reply to Jiri OlsaInto perf-sys.h header, as requested by Peter:
http://lkml.kernel.org/r/[email protected]
Adding HAVE_ATTR_TEST define to turn off/on the attribute test code in the sys_perf_event_open function.
--- tools/perf/perf-sys.h | 22 ++++++++++++++++++++++ tools/perf/perf.h | 40 +++++++++++----------------------------- 2 files changed, 33 insertions(+), 29 deletions(-)
tools/perf/perf-sys.h +22 -0
@@ -1,6 +1,11 @@#ifndef _PERF_SYS_H#define _PERF_SYS_H +#include <unistd.h> +#include <sys/types.h> +#include <sys/syscall.h> +#include <linux/types.h> +#include <linux/perf_event.h> #include <asm/unistd.h> #if defined(__i386__)
@@ -165,4 +170,21 @@#define cpu_relax () barrier()#endif +static inline int +sys_perf_event_open (struct perf_event_attr *attr, +pid_t pid,int cpu,int group_fd, +unsigned long flags) +{ +int fd; + + fd =syscall (__NR_perf_event_open, attr, pid, cpu, + group_fd, flags); + +#ifdef HAVE_ATTR_TEST +if (unlikely (test_attr__enabled)) +test_attr__open (attr, pid, cpu, fd, group_fd, flags); +#endif +return fd; +} +#endif /* _PERF_SYS_H */
tools/perf/perf.h +11 -29
@@ -1,18 +1,21 @@#ifndef _PERF_PERF_H#define _PERF_PERF_H -#include "perf-sys.h" - -#define ACCESS_ONCE (x) (*(volatile typeof(x) *)&(x)) -#include <time.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/syscall.h> - +#include <stdbool.h> #include <linux/types.h> #include <linux/perf_event.h> +extern bool test_attr__enabled; +void test_attr__init (void ); +void test_attr__open (struct perf_event_attr *attr,pid_t pid,int cpu, +int fd,int group_fd,unsigned long flags); + +#define HAVE_ATTR_TEST +#include "perf-sys.h" + +#define ACCESS_ONCE (x) (*(volatile typeof(x) *)&(x)) +#ifndef NSEC_PER_SEC # define NSEC_PER_SEC 1000000000ULL#endif
@@ -28,27 +31,6 @@ static inline unsigned long long rdclock(void)return ts.tv_sec *1000000000ULL + ts.tv_nsec; } -extern bool test_attr__enabled; -void test_attr__init (void ); -void test_attr__open (struct perf_event_attr *attr,pid_t pid,int cpu, -int fd,int group_fd,unsigned long flags); - -static inline int -sys_perf_event_open (struct perf_event_attr *attr, -pid_t pid,int cpu,int group_fd, -unsigned long flags) -{ -int fd; - - fd =syscall (__NR_perf_event_open, attr, pid, cpu, - group_fd, flags); - -if (unlikely (test_attr__enabled)) -test_attr__open (attr, pid, cpu, fd, group_fd, flags); - -return fd; -} -#define MAX_NR_CPUS 256extern const char *input_name;
Signature · 1 line
1.8.3.1
Jiri Olsa
reviewerPATCH 12/12 perf tools: Move ACCESS_ONCE from perf.h header
In reply to Jiri OlsaInto tools/include/linux/compiler.h header.
--- tools/include/linux/compiler.h | 2 ++ tools/perf/perf.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/include/linux/compiler.h +2 -0
@@ -35,4 +35,6 @@# define unlikely (x) __builtin_expect(!!(x), 0)#endif +#define ACCESS_ONCE (x) (*(volatile typeof(x) *)&(x)) +#endif /* _TOOLS_LINUX_COMPILER_H */
tools/perf/perf.h +0 -2
@@ -14,8 +14,6 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,#define HAVE_ATTR_TEST #include "perf-sys.h" -#define ACCESS_ONCE (x) (*(volatile typeof(x) *)&(x)) -#ifndef NSEC_PER_SEC # define NSEC_PER_SEC 1000000000ULL#endif
Signature · 1 line
1.8.3.1
Quoted 98 lines · Jiri Olsa
hi Ingo,
please consider pullingthanks,
jirkaThe following changes since commit
3617660e4e1618a888a2e3a4067224534302cb33:Merge tag 'perf-core-for-mingo' of
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perfinto perf/core (2014-05-01 08:24:59 +0200)are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.gittags/perf-core-for-mingofor you to fetch changes up to
73a31b7c6a85e2f033524058bad5bce900e4f2ed:perf tools: Move
ACCESS_ONCEfromperf.hheader (2014-05-05 17:49:07 +0200)----------------------------------------------------------------
perf/core improvements and fixes:. Cleanups for
perf.hheader (Jiri Olsa). Consolidate
types.handexport.hwithin tools (Borislav Petkov)----------------------------------------------------------------
Borislav Petkov (2):
tools: Unifyexport.h
tools: Consolidatetypes.hJiri Olsa (10):
perf tools: RemoveMAX_COUNTERSdefine fromperf.hperf tools: Remove unlikely define fromperf.h
perf tools: Remove min define fromperf.h
perf tools: Remove asmlinkage define fromperf.hperf tools: Remove PR_TASK_PERF_EVENTS_* fromperf.hperf tools: Move sample data structures fromperf.hperf tools: Moveperf_call_graph_modeenum fromperf.hperf tools: Move syscall and arch specific defines fromperf.hperf tools: Movesys_perf_event_openfunction fromperf.hperf tools: MoveACCESS_ONCEfromperf.hheadertools/include/linux/compiler.h | 2 + tools/{virtio => include}/linux/export.h | 5 + .../lockdep/uinclude => include}/linux/types.h | 29 ++- tools/lib/lockdep/Makefile | 2 +- tools/lib/lockdep/uinclude/linux/export.h | 7 - tools/perf/MANIFEST | 2 + tools/perf/Makefile.perf | 5 +- tools/perf/arch/x86/include/perf_regs.h | 2 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/arch/x86/util/tsc.h | 2 +- tools/perf/perf-sys.h | 190 +++++++++++++++ tools/perf/perf.h | 254 +-------------------- tools/perf/tests/attr.c | 7 - tools/perf/tests/code-reading.c | 3 +- tools/perf/tests/dso-data.c | 2 +- tools/perf/tests/dwarf-unwind.c | 2 +- tools/perf/tests/keep-tracking.c | 2 +- tools/perf/tests/parse-no-sample-id-all.c | 2 +- tools/perf/tests/perf-time-to-tsc.c | 3 +- tools/perf/tests/rdpmc.c | 2 +- tools/perf/tests/sample-parsing.c | 2 +- tools/perf/ui/browser.h | 4 +- tools/perf/ui/progress.h | 2 +- tools/perf/util/annotate.h | 2 +- tools/perf/util/build-id.h | 2 +- tools/perf/util/callchain.h | 7 + tools/perf/util/dso.h | 2 +- tools/perf/util/event.h | 24 ++ tools/perf/util/evsel.h | 4 +- tools/perf/util/header.h | 4 +- tools/perf/util/include/linux/bitmap.h | 3 + tools/perf/util/include/linux/export.h | 6 - tools/perf/util/include/linux/list.h | 1 + tools/perf/util/include/linux/types.h | 29 --- tools/perf/util/map.h | 2 +- tools/perf/util/parse-events.h | 3 +- tools/perf/util/parse-events.y | 2 +- tools/perf/util/perf_regs.h | 2 +- tools/perf/util/pmu.h | 2 +- tools/perf/util/stat.h | 2 +- tools/perf/util/svghelper.c | 2 +- tools/perf/util/svghelper.h | 2 +- tools/perf/util/symbol.h | 1 + tools/perf/util/top.h | 2 +- tools/perf/util/types.h | 19 -- tools/perf/util/unwind-libdw.c | 2 +- tools/perf/util/unwind.h | 2 +- tools/perf/util/util.h | 2 +- tools/perf/util/values.h | 2 +- tools/virtio/Makefile | 2 +- tools/virtio/linux/kernel.h | 7 - tools/virtio/linux/types.h | 28 --- 52 files changed, 304 insertions(+), 397 deletions(-)
Quoted 8 lines
rename tools/{virtio => include}/linux/export.h (70%)
rename tools/{lib/lockdep/uinclude => include}/linux/types.h (63%)
delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h
create mode 100644 tools/perf/perf-sys.h
delete mode 100644 tools/perf/util/include/linux/export.h
delete mode 100644 tools/perf/util/include/linux/types.h
delete mode 100644 tools/perf/util/types.h
delete mode 100644 tools/virtio/linux/types.hPulled, thanks a lot Jiri!
Ingo