Skip to content

Commit b109246

Browse files
committed
Merge tag 'linux-cpupower-6.17-rc1-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux
Merge cpupower utility changes for 6.17-rc1 from Shuah Khan: "Fixes - snapshot-order of tsc,mperf, clock in mperf_stop() - printing of CORE, CPU fields in cpupower-monitor Improves Python binding's Makefile" * tag 'linux-cpupower-6.17-rc1-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: Improve Python binding's Makefile pm: cpupower: Fix printing of CORE, CPU fields in cpupower-monitor pm: cpupower: Fix the snapshot-order of tsc,mperf, clock in mperf_stop()
2 parents d7b8f8e + b74710e commit b109246

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

tools/power/cpupower/bindings/python/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
# This Makefile expects you have already run `make install-lib` in the lib
55
# directory for the bindings to be created.
66

7-
CC := gcc
7+
CC ?= gcc
8+
# CFLAGS ?=
9+
LDFLAGS ?= -lcpupower
810
HAVE_SWIG := $(shell if which swig >/dev/null 2>&1; then echo 1; else echo 0; fi)
911
HAVE_PYCONFIG := $(shell if which python-config >/dev/null 2>&1; then echo 1; else echo 0; fi)
1012

11-
PY_INCLUDE = $(firstword $(shell python-config --includes))
12-
INSTALL_DIR = $(shell python3 -c "import site; print(site.getsitepackages()[0])")
13+
PY_INCLUDE ?= $(firstword $(shell python-config --includes))
14+
INSTALL_DIR ?= $(shell python3 -c "import site; print(site.getsitepackages()[0])")
1315

1416
all: _raw_pylibcpupower.so
1517

1618
_raw_pylibcpupower.so: raw_pylibcpupower_wrap.o
17-
$(CC) -shared -lcpupower raw_pylibcpupower_wrap.o -o _raw_pylibcpupower.so
19+
$(CC) -shared $(LDFLAGS) raw_pylibcpupower_wrap.o -o _raw_pylibcpupower.so
1820

1921
raw_pylibcpupower_wrap.o: raw_pylibcpupower_wrap.c
20-
$(CC) -fPIC -c raw_pylibcpupower_wrap.c $(PY_INCLUDE)
22+
$(CC) $(CFLAGS) $(PY_INCLUDE) -fPIC -c raw_pylibcpupower_wrap.c
2123

2224
raw_pylibcpupower_wrap.c: raw_pylibcpupower.swg
2325
ifeq ($(HAVE_SWIG),0)

tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ void print_header(int topology_depth)
121121
switch (topology_depth) {
122122
case TOPOLOGY_DEPTH_PKG:
123123
printf(" PKG|");
124-
break;
125124
case TOPOLOGY_DEPTH_CORE:
126125
printf("CORE|");
127-
break;
128126
case TOPOLOGY_DEPTH_CPU:
129127
printf(" CPU|");
130128
break;
@@ -167,10 +165,8 @@ void print_results(int topology_depth, int cpu)
167165
switch (topology_depth) {
168166
case TOPOLOGY_DEPTH_PKG:
169167
printf("%4d|", cpu_top.core_info[cpu].pkg);
170-
break;
171168
case TOPOLOGY_DEPTH_CORE:
172169
printf("%4d|", cpu_top.core_info[cpu].core);
173-
break;
174170
case TOPOLOGY_DEPTH_CPU:
175171
printf("%4d|", cpu_top.core_info[cpu].cpu);
176172
break;

tools/power/cpupower/utils/idle_monitor/mperf_monitor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ static int mperf_stop(void)
240240
int cpu;
241241

242242
for (cpu = 0; cpu < cpu_count; cpu++) {
243-
mperf_measure_stats(cpu);
244-
mperf_get_tsc(&tsc_at_measure_end[cpu]);
245243
clock_gettime(CLOCK_REALTIME, &time_end[cpu]);
244+
mperf_get_tsc(&tsc_at_measure_end[cpu]);
245+
mperf_measure_stats(cpu);
246246
}
247247

248248
return 0;

0 commit comments

Comments
 (0)