diff options
author | Cody P Schafer <cody@linux.vnet.ibm.com> | 2015-01-30 22:45:57 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-02-02 07:56:36 +0100 |
commit | fd979c0132074856975a6e79bc2226b99435ec5b (patch) | |
tree | ad01ab6039dec30b6e1180759b435f84cd2780b0 /kernel/events | |
parent | powerpc/kernel: Avoid initializing device-tree pointer twice (diff) | |
download | linux-fd979c0132074856975a6e79bc2226b99435ec5b.tar.xz linux-fd979c0132074856975a6e79bc2226b99435ec5b.zip |
perf: provide sysfs_show for struct perf_pmu_events_attr
(struct perf_pmu_events_attr) is defined in include/linux/perf_event.h,
but the only "show" for it is in x86 and contains x86 specific stuff.
Make a generic one for those of us who are just using the event_str.
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 4c1ee7f2bebc..934687f8d51b 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -8276,6 +8276,18 @@ void __init perf_event_init(void) != 1024); } +ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr, + char *page) +{ + struct perf_pmu_events_attr *pmu_attr = + container_of(attr, struct perf_pmu_events_attr, attr); + + if (pmu_attr->event_str) + return sprintf(page, "%s\n", pmu_attr->event_str); + + return 0; +} + static int __init perf_event_sysfs_init(void) { struct pmu *pmu; |