Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf: add PMU_EVENT_ATTR_STRING() helper

Helper for constructing static struct perf_pmu_events_attr s.

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>

authored by

Cody P Schafer and committed by
Michael Ellerman
f0405b81 fd979c01

+7
+7
include/linux/perf_event.h
··· 906 906 .id = _id, \ 907 907 }; 908 908 909 + #define PMU_EVENT_ATTR_STRING(_name, _var, _str) \ 910 + static struct perf_pmu_events_attr _var = { \ 911 + .attr = __ATTR(_name, 0444, perf_event_sysfs_show, NULL), \ 912 + .id = 0, \ 913 + .event_str = _str, \ 914 + }; 915 + 909 916 #define PMU_FORMAT_ATTR(_name, _format) \ 910 917 static ssize_t \ 911 918 _name##_show(struct device *dev, \