aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/perf_event_server.h
diff options
context:
space:
mode:
authorRunzhen Wang <runzhen@linux.vnet.ibm.com>2013-06-28 04:14:57 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-07-12 12:46:09 -0400
commitcfe0d8ba14a1d98245b371e486c68f37eba1ca52 (patch)
tree73ba840aa9a401befd3425d1eba0d7b63a81f851 /arch/powerpc/include/asm/perf_event_server.h
parentd4ae0a6f7c79be64c8f3551dd149189f8c4480eb (diff)
perf tools: Make Power7 events available for perf
Power7 supports over 530 different perf events but only a small subset of these can be specified by name, for the remaining events, we must specify them by their raw code: perf stat -e r2003c <application> This patch makes all the POWER7 events available in sysfs. So we can instead specify these as: perf stat -e 'cpu/PM_CMPLU_STALL_DFU/' <application> where PM_CMPLU_STALL_DFU is the r2003c in previous example. Before this patch is applied, the size of power7-pmu.o is: $ size arch/powerpc/perf/power7-pmu.o text data bss dec hex filename 3073 2720 0 5793 16a1 arch/powerpc/perf/power7-pmu.o and after the patch is applied, it is: $ size arch/powerpc/perf/power7-pmu.o text data bss dec hex filename 15950 31112 0 47062 b7d6 arch/powerpc/perf/power7-pmu.o For the run time overhead, I use two scripts, one is "event_name.sh", which contains 50 event names, it looks like: # ./perf record -e 'cpu/PM_CMPLU_STALL_DFU/' -e ..... /bin/sleep 1 the other one is named "event_code.sh" which use corresponding events raw code instead of events names, it looks like: # ./perf record -e r2003c -e ...... /bin/sleep 1 below is the result. Using events name: [root@localhost perf]# time ./event_name.sh [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.002 MB perf.data (~102 samples) ] real 0m1.192s user 0m0.028s sys 0m0.106s Using events raw code: [root@localhost perf]# time ./event_code.sh [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.003 MB perf.data (~112 samples) ] real 0m1.198s user 0m0.028s sys 0m0.105s Signed-off-by: Runzhen Wang <runzhen@linux.vnet.ibm.com> Acked-by: Michael Ellerman <michael@ellerman.id.au> Cc: icycoder@gmail.com Cc: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman <michael@ellerman.id.au> Cc: Paul Mackerras <paulus@samba.org> Cc: Runzhen Wang <runzhew@clemson.edu> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1372407297-6996-3-git-send-email-runzhen@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'arch/powerpc/include/asm/perf_event_server.h')
-rw-r--r--arch/powerpc/include/asm/perf_event_server.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index f265049dd7d6..d9270d8eb087 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -136,11 +136,11 @@ extern ssize_t power_events_sysfs_show(struct device *dev,
136#define EVENT_PTR(_id, _suffix) &EVENT_VAR(_id, _suffix).attr.attr 136#define EVENT_PTR(_id, _suffix) &EVENT_VAR(_id, _suffix).attr.attr
137 137
138#define EVENT_ATTR(_name, _id, _suffix) \ 138#define EVENT_ATTR(_name, _id, _suffix) \
139 PMU_EVENT_ATTR(_name, EVENT_VAR(_id, _suffix), PME_PM_##_id, \ 139 PMU_EVENT_ATTR(_name, EVENT_VAR(_id, _suffix), PME_##_id, \
140 power_events_sysfs_show) 140 power_events_sysfs_show)
141 141
142#define GENERIC_EVENT_ATTR(_name, _id) EVENT_ATTR(_name, _id, _g) 142#define GENERIC_EVENT_ATTR(_name, _id) EVENT_ATTR(_name, _id, _g)
143#define GENERIC_EVENT_PTR(_id) EVENT_PTR(_id, _g) 143#define GENERIC_EVENT_PTR(_id) EVENT_PTR(_id, _g)
144 144
145#define POWER_EVENT_ATTR(_name, _id) EVENT_ATTR(PM_##_name, _id, _p) 145#define POWER_EVENT_ATTR(_name, _id) EVENT_ATTR(_name, _id, _p)
146#define POWER_EVENT_PTR(_id) EVENT_PTR(_id, _p) 146#define POWER_EVENT_PTR(_id) EVENT_PTR(_id, _p)