Commit 361b8fc7 authored by Patryk Wlazlyn's avatar Patryk Wlazlyn Committed by Len Brown
Browse files

tools/power turbostat: Extend --add option with perf counters



User can now read perf counters using "--add perf/<device>/<event>".
Other details work similarly to how --add works with MSRs.

Signed-off-by: default avatarPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 67bab430
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ snapshot: turbostat
	@echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h

	@echo '#define BUILD_BUG_ON(cond) do { enum { compile_time_check ## __COUNTER__ = 1/(!(cond)) }; } while (0)' > $(SNAPSHOT)/build_bug.h
	@echo '#define __must_be_array(arr) 0' >> $(SNAPSHOT)/build_bug.h

	@echo PWD=. > $(SNAPSHOT)/Makefile
	@echo "CFLAGS +=	-DMSRHEADER='\"msr-index.h\"'" >> $(SNAPSHOT)/Makefile
+4 −1
Original line number Diff line number Diff line
@@ -28,10 +28,13 @@ name as necessary to disambiguate it from others is necessary. Note that option
.PP
\fB--add attributes\fP add column with counter having specified 'attributes'.  The 'location' attribute is required, all others are optional.
.nf
	location: {\fBmsrDDD\fP | \fBmsr0xXXX\fP | \fB/sys/path...\fP}
	location: {\fBmsrDDD\fP | \fBmsr0xXXX\fP | \fB/sys/path...\fP | \fBperf/<device>/<event>\fP}
		msrDDD is a decimal offset, eg. msr16
		msr0xXXX is a hex offset, eg. msr0x10
		/sys/path... is an absolute path to a sysfs attribute
		<device> is a perf device from /sys/bus/event_source/devices/<device> eg. cstate_core
		<event> is a perf event for given device from /sys/bus/event_source/devices/<device>/events/<event> eg. c1-residency
			perf/cstate_core/c1-residency would then use /sys/bus/event_source/devices/cstate_core/events/c1-residency

	scope: {\fBcpu\fP | \fBcore\fP | \fBpackage\fP}
		sample and print the counter for every cpu, core, or package.
+552 −10

File changed.

Preview size limit exceeded, changes collapsed.