public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/9] perf: Add PMU_FORMAT_ATTR_SHOW
@ 2023-01-04 20:13 kan.liang
  2023-01-04 20:13 ` [PATCH V2 2/9] perf/x86: Add Meteor Lake support kan.liang
                   ` (8 more replies)
  0 siblings, 9 replies; 25+ messages in thread
From: kan.liang @ 2023-01-04 20:13 UTC (permalink / raw)
  To: peterz, mingo, acme, linux-kernel; +Cc: ak, eranian, irogers, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

The macro PMU_FORMAT_ATTR facilitates the definition of both the "show"
function and "format_attr". But it only works for a non-hybrid platform.
For a hybrid platform, the name "format_attr_hybrid_" is used.

The definition of the "show" function can be shared between a non-hybrid
platform and a hybrid platform. Add a new macro PMU_FORMAT_ATTR_SHOW.

No functional change. The PMU_FORMAT_ATTR_SHOW will be used in the
following patch.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---

No change since V1

 include/linux/perf_event.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c6a3bac76966..ad92ad37600e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1724,7 +1724,7 @@ static struct perf_pmu_events_attr _var = {				    \
 		  .id = _id, }						\
 	})[0].attr.attr)
 
-#define PMU_FORMAT_ATTR(_name, _format)					\
+#define PMU_FORMAT_ATTR_SHOW(_name, _format)				\
 static ssize_t								\
 _name##_show(struct device *dev,					\
 			       struct device_attribute *attr,		\
@@ -1733,6 +1733,9 @@ _name##_show(struct device *dev,					\
 	BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE);			\
 	return sprintf(page, _format "\n");				\
 }									\
+
+#define PMU_FORMAT_ATTR(_name, _format)					\
+	PMU_FORMAT_ATTR_SHOW(_name, _format)				\
 									\
 static struct device_attribute format_attr_##_name = __ATTR_RO(_name)
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-02-06 14:51 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 20:13 [PATCH V2 1/9] perf: Add PMU_FORMAT_ATTR_SHOW kan.liang
2023-01-04 20:13 ` [PATCH V2 2/9] perf/x86: Add Meteor Lake support kan.liang
2023-01-09 17:02   ` [tip: perf/core] " tip-bot2 for Kan Liang
2023-01-04 20:13 ` [PATCH V2 3/9] perf/x86: Support Retire Latency kan.liang
2023-01-09 17:02   ` [tip: perf/core] " tip-bot2 for Kan Liang
2023-01-04 20:13 ` [PATCH V2 4/9] x86/cpufeatures: Add Architectural PerfMon Extension bit kan.liang
2023-01-09 17:02   ` [tip: perf/core] " tip-bot2 for Kan Liang
2023-01-04 20:13 ` [PATCH V2 5/9] perf/x86/intel: Support Architectural PerfMon Extension leaf kan.liang
2023-01-09 17:02   ` [tip: perf/core] " tip-bot2 for Kan Liang
2023-01-04 20:13 ` [PATCH V2 6/9] perf/x86/cstate: Add Meteor Lake support kan.liang
2023-01-09 11:15   ` [tip: perf/urgent] " tip-bot2 for Kan Liang
2023-01-09 17:02   ` [tip: perf/core] " tip-bot2 for Kan Liang
2023-01-04 20:13 ` [PATCH V2 7/9] perf/x86/msr: " kan.liang
2023-01-09 11:15   ` [tip: perf/urgent] " tip-bot2 for Kan Liang
2023-01-09 17:02   ` [tip: perf/core] " tip-bot2 for Kan Liang
2023-02-02  1:47   ` [PATCH V2 7/9] " Arnaldo Carvalho de Melo
2023-02-02 14:34     ` Liang, Kan
2023-02-02 14:45       ` Arnaldo Carvalho de Melo
2023-02-03 20:21       ` Arnaldo Carvalho de Melo
2023-02-03 20:28         ` Arnaldo Carvalho de Melo
2023-02-06 14:32           ` Liang, Kan
2023-02-06 14:51             ` Arnaldo Carvalho de Melo
2023-01-04 20:13 ` [PATCH V2 8/9] perf report: Support Retire Latency kan.liang
2023-01-04 20:13 ` [PATCH V2 9/9] perf script: " kan.liang
2023-01-09 17:02 ` [tip: perf/core] perf: Add PMU_FORMAT_ATTR_SHOW tip-bot2 for Kan Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox