summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-03-19 20:14:46 +0100
committerIngo Molnar <mingo@kernel.org>2012-03-19 20:14:46 +0100
commit9521d830b6341d1887dcfc2aebde23fbfa5f1473 (patch)
treedb6b03aaca5ca4a254912ae1a7f3e5e89ee182e4 /include/linux
parentbea95c152dee1791dd02cbc708afbb115bb00f9a (diff)
parentc31a94570552dcaa517c4f7a043ffd28835016be (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Fixes for the last batch from Namhyung and the initial GTK report browser from Pekka. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/perf_event.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index bd9f55a5958d..57ae485e80fc 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -550,6 +550,7 @@ struct perf_guest_info_callbacks {
#include <linux/irq_work.h>
#include <linux/static_key.h>
#include <linux/atomic.h>
+#include <linux/sysfs.h>
#include <asm/local.h>
#define PERF_MAX_STACK_DEPTH 255
@@ -1291,5 +1292,18 @@ do { \
register_cpu_notifier(&fn##_nb); \
} while (0)
+
+#define PMU_FORMAT_ATTR(_name, _format) \
+static ssize_t \
+_name##_show(struct device *dev, \
+ struct device_attribute *attr, \
+ char *page) \
+{ \
+ BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE); \
+ return sprintf(page, _format "\n"); \
+} \
+ \
+static struct device_attribute format_attr_##_name = __ATTR_RO(_name)
+
#endif /* __KERNEL__ */
#endif /* _LINUX_PERF_EVENT_H */