Re: [PATCH v2 2/3] perf/x86/rapl: Support multiple rapl unit quirks

From
Zhang Rui <rui.zhang@intel.com>
Date
2020-08-12 03:29:20
Also in
lkml
Reply to
Joe Perches, 2020-08-11
Hi,

Thanks for reviewing.

On Tue, 2020-08-11 at 11:19 -0700, Joe Perches wrote:
On Tue, 2020-08-11 at 23:31 +0800, Zhang Rui wrote:
quoted
There will be more platforms with different fixed energy units.
Enhance the code to support different rapl unit quirks for
different
platforms.
This seems like one quirk per platform.

Should multiple quirks on individual platforms be supported?
enum rapl_unit_quirk is just used as a flag.
multiple quirks can be deployed with the same flag, just like what I
did in patch 3/3.
Also different platforms can either have different flags or share the
same flag.

thanks,
rui
quoted
diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c
[]
quoted
@@ -130,11 +130,16 @@ struct rapl_pmus {
 	struct rapl_pmu		*pmus[];
 };
 
+enum rapl_unit_quirk {
+	RAPL_UNIT_QUIRK_NONE,
+	RAPL_UNIT_QUIRK_INTEL_HSW,
+};
+
 struct rapl_model {
 	struct perf_msr *rapl_msrs;
 	unsigned long	events;
 	unsigned int	msr_power_unit;
-	bool		apply_quirk;
+	enum rapl_unit_quirk	unit_quirk;
 };
  
Thread (7 messages) 7 messages, 2 authors, last reply 2020-08-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help