diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/perf_event.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 5cad0e6f3552..2cdc9d422bed 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -907,12 +907,22 @@ struct perf_pmu_events_attr { | |||
| 907 | const char *event_str; | 907 | const char *event_str; |
| 908 | }; | 908 | }; |
| 909 | 909 | ||
| 910 | ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr, | ||
| 911 | char *page); | ||
| 912 | |||
| 910 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ | 913 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ |
| 911 | static struct perf_pmu_events_attr _var = { \ | 914 | static struct perf_pmu_events_attr _var = { \ |
| 912 | .attr = __ATTR(_name, 0444, _show, NULL), \ | 915 | .attr = __ATTR(_name, 0444, _show, NULL), \ |
| 913 | .id = _id, \ | 916 | .id = _id, \ |
| 914 | }; | 917 | }; |
| 915 | 918 | ||
| 919 | #define PMU_EVENT_ATTR_STRING(_name, _var, _str) \ | ||
| 920 | static struct perf_pmu_events_attr _var = { \ | ||
| 921 | .attr = __ATTR(_name, 0444, perf_event_sysfs_show, NULL), \ | ||
| 922 | .id = 0, \ | ||
| 923 | .event_str = _str, \ | ||
| 924 | }; | ||
| 925 | |||
| 916 | #define PMU_FORMAT_ATTR(_name, _format) \ | 926 | #define PMU_FORMAT_ATTR(_name, _format) \ |
| 917 | static ssize_t \ | 927 | static ssize_t \ |
| 918 | _name##_show(struct device *dev, \ | 928 | _name##_show(struct device *dev, \ |
