Inter-revision diff: patch 5

Comparing v2 (message) to v4 (message)

--- v2
+++ v4
@@ -1,45 +1,32 @@
-From: Cody P Schafer <dev@codyps.com>
+From: Cody P Schafer <cody@linux.vnet.ibm.com>
 
+Helper for constructing static struct perf_pmu_events_attr s.
+
+CC: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
 CC: Haren Myneni <hbabu@us.ibm.com>
 CC: Cody P Schafer <dev@codyps.com>
 Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
-Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
 ---
- tools/perf/util/pmu.c | 4 ++--
- tools/perf/util/pmu.h | 6 +++---
- 2 files changed, 5 insertions(+), 5 deletions(-)
+ include/linux/perf_event.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
 
-diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
-index 7a811eb..9bf5827 100644
---- a/tools/perf/util/pmu.c
-+++ b/tools/perf/util/pmu.c
-@@ -14,8 +14,8 @@
- 
- struct perf_pmu_alias {
- 	char *name;
--	struct list_head terms;
--	struct list_head list;
-+	struct list_head terms; /* HEAD struct parse_events_term -> list */
-+	struct list_head list;  /* ELEM */
- 	char unit[UNIT_MAX_LEN+1];
- 	double scale;
- };
-diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
-index c14a543..1c1e2ee 100644
---- a/tools/perf/util/pmu.h
-+++ b/tools/perf/util/pmu.h
-@@ -17,9 +17,9 @@ struct perf_pmu {
- 	char *name;
- 	__u32 type;
- 	struct cpu_map *cpus;
--	struct list_head format;
--	struct list_head aliases;
--	struct list_head list;
-+	struct list_head format;  /* HEAD struct perf_pmu_format -> list */
-+	struct list_head aliases; /* HEAD struct perf_pmu_alias -> list */
-+	struct list_head list;    /* ELEM */
+diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
+index da442a0..4840c7f 100644
+--- a/include/linux/perf_event.h
++++ b/include/linux/perf_event.h
+@@ -903,6 +903,13 @@ static struct perf_pmu_events_attr _var = {				\
+ 	.id   =  _id,							\
  };
  
- struct perf_pmu *perf_pmu__find(const char *name);
++#define PMU_EVENT_ATTR_STRING(_name, _var, _value)			\
++static struct perf_pmu_events_attr _var = {				\
++	.attr = __ATTR(_name, 0444, perf_event_sysfs_show, NULL),	\
++	.event_str = _value,						\
++};
++
++
+ #define PMU_FORMAT_ATTR(_name, _format)					\
+ static ssize_t								\
+ _name##_show(struct device *dev,					\
 -- 
 1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help