Skip to contentSkip to conversation

perf: support PERF_COUNT_SW_RAPL_ENERGY in perf tool

RFC PATCH In review Zhang Rui 1 participant 1 message Aug 18, 2010 perf events

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

RFC PATCH 3/3 perf: support PERF_COUNT_SW_RAPL_ENERGY in perf tool

Support PERF_COUNT_SW_RAPL_ENERGY in perf tool.

---
 tools/perf/design.txt          |    1 +
 tools/perf/util/parse-events.c |    2 ++
 2 files changed, 3 insertions(+)
tools/perf/design.txt +1 -0
Index: linux-2.6-clean/tools/perf/design.txt
===================================================================
@@ -139,6 +139,7 @@
 	PERF_COUNT_SW_PAGE_FAULTS_MAJ	= 6,
 	PERF_COUNT_SW_ALIGNMENT_FAULTS	= 7,
 	PERF_COUNT_SW_EMULATION_FAULTS	= 8,
+	PERF_COUNT_SW_RAPL_ENERGY	= 9,
 };
 
 Counters of the type PERF_TYPE_TRACEPOINT are available when the ftrace event
tools/perf/util/parse-events.c +2 -0
Index: linux-2.6-clean/tools/perf/util/parse-events.c
===================================================================
@@ -51,6 +51,7 @@
   { CSW(CPU_MIGRATIONS),	"cpu-migrations",	"migrations"	},
   { CSW(ALIGNMENT_FAULTS),	"alignment-faults",	""		},
   { CSW(EMULATION_FAULTS),	"emulation-faults",	""		},
+  { CSW(RAPL_ENERGY),		"energy",		""		},
 };
 
 #define __PERF_EVENT_FIELD(config, name) \
@@ -81,6 +82,7 @@
 	"major-faults",
 	"alignment-faults",
 	"emulation-faults",
+	"cpu-energy-in-Joules",
 };
 
 #define MAX_ALIASES 8