2012-10-09 23:31:44 +08:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
BUILD_OUTPUT := $(PWD)
|
|
|
|
PREFIX := /usr
|
|
|
|
DESTDIR :=
|
|
|
|
|
2010-10-23 11:53:03 +08:00
|
|
|
turbostat : turbostat.c
|
tools/power: turbostat v2 - re-write for efficiency
Measuring large profoundly-idle configurations
requires turbostat to be more lightweight.
Otherwise, the operation of turbostat itself
can interfere with the measurements.
This re-write makes turbostat topology aware.
Hardware is accessed in "topology order".
Redundant hardware accesses are deleted.
Redundant output is deleted.
Also, output is buffered and
local RDTSC use replaces remote MSR access for TSC.
From a feature point of view, the output
looks different since redundant figures are absent.
Also, there are now -c and -p options -- to restrict
output to the 1st thread in each core, and the 1st
thread in each package, respectively. This is helpful
to reduce output on big systems, where more detail
than the "-s" system summary is desired.
Finally, periodic mode output is now on stdout, not stderr.
Turbostat v2 is also slightly more robust in
handling run-time CPU online/offline events,
as it now checks the actual map of on-line cpus rather
than just the total number of on-line cpus.
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-04 12:56:40 +08:00
|
|
|
CFLAGS += -Wall
|
2012-12-19 04:34:29 +08:00
|
|
|
CFLAGS += -I../../../../arch/x86/include/uapi/
|
2010-10-23 11:53:03 +08:00
|
|
|
|
2012-10-09 23:31:44 +08:00
|
|
|
%: %.c
|
|
|
|
@mkdir -p $(BUILD_OUTPUT)
|
|
|
|
$(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
|
2010-10-23 11:53:03 +08:00
|
|
|
|
2012-10-09 23:31:44 +08:00
|
|
|
.PHONY : clean
|
2010-10-23 11:53:03 +08:00
|
|
|
clean :
|
2012-10-09 23:31:44 +08:00
|
|
|
@rm -f $(BUILD_OUTPUT)/turbostat
|
2010-10-23 11:53:03 +08:00
|
|
|
|
2012-10-09 23:31:44 +08:00
|
|
|
install : turbostat
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/man/man8
|
|
|
|
install turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8
|