aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/perf_event.c
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2013-12-11 06:44:40 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-16 08:37:50 -0500
commitc716832513f30430179b60ac5ffd203c53f7eb40 (patch)
treec9b29a4b189b928661cca6751c72db5b29d07573 /arch/s390/kernel/perf_event.c
parentcf48ad83278aad39d4a0158cd085b6038b2941e6 (diff)
s390/cpum_cf: Export event names in sysfs
Provide PMU event attributes for supported counters and export their symbolic names to the sysfs "events" directory. See the /sys/devices/cpum_cf/events/ directory for a list of available counters. Note that you might require counter set authorizations for the LPAR to use them. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/perf_event.c')
-rw-r--r--arch/s390/kernel/perf_event.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/s390/kernel/perf_event.c b/arch/s390/kernel/perf_event.c
index 2343c218b8f9..4c1d336ce941 100644
--- a/arch/s390/kernel/perf_event.c
+++ b/arch/s390/kernel/perf_event.c
@@ -16,6 +16,7 @@
16#include <linux/kvm_host.h> 16#include <linux/kvm_host.h>
17#include <linux/percpu.h> 17#include <linux/percpu.h>
18#include <linux/export.h> 18#include <linux/export.h>
19#include <linux/sysfs.h>
19#include <asm/irq.h> 20#include <asm/irq.h>
20#include <asm/cpu_mf.h> 21#include <asm/cpu_mf.h>
21#include <asm/lowcore.h> 22#include <asm/lowcore.h>
@@ -172,3 +173,14 @@ void perf_callchain_kernel(struct perf_callchain_entry *entry,
172 __store_trace(entry, head, S390_lowcore.thread_info, 173 __store_trace(entry, head, S390_lowcore.thread_info,
173 S390_lowcore.thread_info + THREAD_SIZE); 174 S390_lowcore.thread_info + THREAD_SIZE);
174} 175}
176
177/* Perf defintions for PMU event attributes in sysfs */
178ssize_t cpumf_events_sysfs_show(struct device *dev,
179 struct device_attribute *attr, char *page)
180{
181 struct perf_pmu_events_attr *pmu_attr;
182
183 pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
184 return sprintf(page, "event=0x%04llx,name=%s\n",
185 pmu_attr->id, attr->attr.name);
186}