summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/perf_event.h
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2013-12-11 12:44:40 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-16 14:37:50 +0100
commitc716832513f30430179b60ac5ffd203c53f7eb40 (patch)
treec9b29a4b189b928661cca6751c72db5b29d07573 /arch/s390/include/asm/perf_event.h
parentcf48ad83278aad39d4a0158cd085b6038b2941e6 (diff)
downloadlinux-stable-c716832513f30430179b60ac5ffd203c53f7eb40.tar.gz
linux-stable-c716832513f30430179b60ac5ffd203c53f7eb40.tar.bz2
linux-stable-c716832513f30430179b60ac5ffd203c53f7eb40.zip
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/include/asm/perf_event.h')
-rw-r--r--arch/s390/include/asm/perf_event.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/s390/include/asm/perf_event.h b/arch/s390/include/asm/perf_event.h
index 1141fb3e7b21..34185020ae0a 100644
--- a/arch/s390/include/asm/perf_event.h
+++ b/arch/s390/include/asm/perf_event.h
@@ -1,11 +1,18 @@
/*
* Performance event support - s390 specific definitions.
*
- * Copyright IBM Corp. 2009, 2012
+ * Copyright IBM Corp. 2009, 2013
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
* Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
*/
+#ifndef _ASM_S390_PERF_EVENT_H
+#define _ASM_S390_PERF_EVENT_H
+
+#ifdef CONFIG_64BIT
+
+#include <linux/perf_event.h>
+#include <linux/device.h>
#include <asm/cpu_mf.h>
/* CPU-measurement counter facility */
@@ -15,7 +22,18 @@
#define PMU_F_RESERVED 0x1000
#define PMU_F_ENABLED 0x2000
-#ifdef CONFIG_64BIT
+/* Perf defintions for PMU event attributes in sysfs */
+extern __init const struct attribute_group **cpumf_cf_event_group(void);
+extern ssize_t cpumf_events_sysfs_show(struct device *dev,
+ struct device_attribute *attr,
+ char *page);
+#define EVENT_VAR(_cat, _name) event_attr_##_cat##_##_name
+#define EVENT_PTR(_cat, _name) (&EVENT_VAR(_cat, _name).attr.attr)
+
+#define CPUMF_EVENT_ATTR(cat, name, id) \
+ PMU_EVENT_ATTR(name, EVENT_VAR(cat, name), id, cpumf_events_sysfs_show)
+#define CPUMF_EVENT_PTR(cat, name) EVENT_PTR(cat, name)
+
/* Perf callbacks */
struct pt_regs;
@@ -24,3 +42,4 @@ extern unsigned long perf_misc_flags(struct pt_regs *regs);
#define perf_misc_flags(regs) perf_misc_flags(regs)
#endif /* CONFIG_64BIT */
+#endif /* _ASM_S390_PERF_EVENT_H */