diff --git a/cpupower-4.11.tar.bz2 b/cpupower-4.11.tar.bz2 deleted file mode 100644 index bd9ae8f..0000000 --- a/cpupower-4.11.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ff98f9bf5a780af6ab7a92dbcc41cf27bfa9344a0e118c7412e8b8f7f524d73a -size 71809 diff --git a/cpupower-4.15.tar.bz2 b/cpupower-4.15.tar.bz2 new file mode 100644 index 0000000..2dd0dae --- /dev/null +++ b/cpupower-4.15.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae1259669ae3a8dd9c7d7ab47fa5d4570d287046c011d82a1976ef8738763031 +size 72292 diff --git a/cpupower.changes b/cpupower.changes index 3e5ecc0..facc901 100644 --- a/cpupower.changes +++ b/cpupower.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Jan 11 16:00:56 UTC 2018 - trenn@suse.de + +- Update cpupower to latest kernel version (version name 4.15, but + checked out against latest kernel tag 4.15-rc7. There will not + be important changes any more, maybe a fix). +- cpu online/offline fixes +- This is the first cpupower package (with updated version) which + includes x86_energy_perf_policy binary. + This is important for later package dependencies, namely tuned. +A cpupower_exclude_kernel_Makefile.patch + ------------------------------------------------------------------- Tue Jan 9 16:07:07 UTC 2018 - trenn@suse.de diff --git a/cpupower.spec b/cpupower.spec index 54fc2e3..f5c7b6d 100644 --- a/cpupower.spec +++ b/cpupower.spec @@ -20,7 +20,7 @@ Name: cpupower # Use this as version when things are in mainline kernel %define version %(rpm -q --qf '%VERSION' kernel-source) -Version: 4.11 +Version: 4.15 Release: 0 %define tsversion 17.04.12 %define pbversion 17.05.11 @@ -35,6 +35,7 @@ Source3: x86_energy_perf_policy-%{pbversion}.tar.bz2 Patch1: cpupower_rapl.patch Patch2: rapl_monitor.patch +Patch3: cpupower_exclude_kernel_Makefile.patch Patch20: turbostat_fix_man_perm.patch Patch22: turbostat_makefile_fix_asm_header.patch @@ -90,6 +91,8 @@ powersave module. %setup -D -b 1 -b 3 %patch1 -p1 %patch2 -p1 +%patch3 -p1 + cd ../turbostat-%tsversion %patch20 -p1 %patch22 -p1 @@ -103,7 +106,7 @@ cd ../x86_energy_perf_policy-%{pbversion} # This package failed when testing with -Wl,-as-needed being default. # So we disable it here, if you want to retest, just delete this comment and the line below. export SUSE_ASNEEDED=0 -CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true STRIP=true VERSION=%version" +CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true VERSION=%version" export CFLAGS="%optflags -I ." make $CONF %{?_smp_mflags} diff --git a/cpupower_exclude_kernel_Makefile.patch b/cpupower_exclude_kernel_Makefile.patch new file mode 100644 index 0000000..a0f418e --- /dev/null +++ b/cpupower_exclude_kernel_Makefile.patch @@ -0,0 +1,13 @@ +Index: cpupower-4.15/Makefile +=================================================================== +--- cpupower-4.15.orig/Makefile 2018-01-11 16:49:23.619489210 +0100 ++++ cpupower-4.15/Makefile 2018-01-11 16:50:32.263630773 +0100 +@@ -30,8 +30,6 @@ OUTDIR := $(shell cd $(OUTPUT) && pwd) + $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) + endif + +-include ../../scripts/Makefile.arch +- + # --- CONFIGURATION BEGIN --- + + # Set the following to `true' to make a unstripped, unoptimized diff --git a/cpupower_export_tarball_from_git.sh b/cpupower_export_tarball_from_git.sh index dfa4be2..3744d46 100644 --- a/cpupower_export_tarball_from_git.sh +++ b/cpupower_export_tarball_from_git.sh @@ -6,9 +6,10 @@ GIT_TAG=HEAD VERSION="" +TOOL="" function usage(){ - echo "$(basename $0) [ -k git_tag ] [ -v tag_to_use ] -t cpupower | turbostat | x86_perf_bias " + echo "$(basename $0) [ -k git_tag ] [ -v tag_to_use ] -t cpupower | turbostat | x86_perf_bias " echo echo "git_tag Must be a valid kernel git tag, for example v3.1" echo " if git_tag is not passed HEAD will be used which" @@ -34,7 +35,10 @@ function parse_args() GIT_TAG="$OPTARG" ;; t) - TOOL="$OPTARG" + echo XXXXXXXXX + TOOL="$OPTARG" + echo $TOOL + echo YYYYYYYY ;; ?|h) usage @@ -70,19 +74,17 @@ function export_cpupower() { # --remote= param seem not to be configured for kernel.org gits git archive --format=tar $GIT_TAG tools/power/cpupower |tar -x - pushd "$DIR" - mv tools/power/cpupower cpupower${VERSION} - tar -cvjf cpupower${VERSION}.tar.bz2 cpupower${VERSION} + mv tools/power/cpupower cpupower-${VERSION} + tar -cvjf cpupower-${VERSION}.tar.bz2 cpupower-${VERSION} popd - mv "$DIR/cpupower${VERSION}".tar.bz2 . - echo cpupower${VERSION}.tar.bz2 + mv "$DIR/cpupower-${VERSION}".tar.bz2 . + echo cpupower-${VERSION}.tar.bz2 } function export_turbostat() { git archive --format=tar $GIT_TAG tools/power/x86/turbostat |tar -x - pushd "$DIR" if [ "$TURBOSTAT_VERSION"x == ""x ];then TURBOSTAT_VERSION=$(grep "turbostat version" tools/power/x86/turbostat/turbostat.c |grep fprintf |sed 's/.*turbostat version \([0-9][0-9].[0-9][0-9].[0-9][0-9]\).*/\1/') @@ -123,13 +125,14 @@ parse_args $* DIR=`mktemp -d` pushd $DIR -TOOL="$1" + if [ "$GIT_DIR" = "" ];then export GIT_DIR=/archteam/trenn/git/linux-2.6/.git fi case $TOOL in cpupower) + echo XXX export_cpupower ;; turbostat) diff --git a/cpupower_rapl.patch b/cpupower_rapl.patch index 5b93645..ce0c3b9 100644 --- a/cpupower_rapl.patch +++ b/cpupower_rapl.patch @@ -25,11 +25,11 @@ more detailed info later. Like that other args can be added easily later as well Signed-off-by: Thomas Renninger -Index: cpupower-4.10/Makefile +Index: cpupower-4.15/Makefile =================================================================== ---- cpupower-4.10.orig/Makefile 2017-03-31 18:14:02.031075768 +0200 -+++ cpupower-4.10/Makefile 2017-03-31 18:35:37.412218184 +0200 -@@ -135,7 +135,7 @@ UTIL_OBJS = utils/helpers/amd.o utils/h +--- cpupower-4.15.orig/Makefile 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/Makefile 2018-01-11 16:49:11.946784841 +0100 +@@ -141,7 +141,7 @@ UTIL_OBJS = utils/helpers/amd.o utils/h utils/idle_monitor/mperf_monitor.o utils/idle_monitor/cpupower-monitor.o \ utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \ utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \ @@ -38,7 +38,7 @@ Index: cpupower-4.10/Makefile UTIL_SRC := $(UTIL_OBJS:.o=.c) -@@ -145,9 +145,9 @@ UTIL_HEADERS = utils/helpers/helpers.h u +@@ -151,9 +151,9 @@ UTIL_HEADERS = utils/helpers/helpers.h u utils/helpers/bitmask.h \ utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def @@ -51,7 +51,7 @@ Index: cpupower-4.10/Makefile LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS)) CFLAGS += -pipe -@@ -278,6 +278,7 @@ install-lib: +@@ -284,6 +284,7 @@ install-lib: $(INSTALL) -d $(DESTDIR)${includedir} $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h $(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h @@ -59,7 +59,7 @@ Index: cpupower-4.10/Makefile install-tools: $(INSTALL) -d $(DESTDIR)${bindir} -@@ -292,6 +293,7 @@ install-man: +@@ -298,6 +299,7 @@ install-man: $(INSTALL_DATA) -D man/cpupower-set.1 $(DESTDIR)${mandir}/man1/cpupower-set.1 $(INSTALL_DATA) -D man/cpupower-info.1 $(DESTDIR)${mandir}/man1/cpupower-info.1 $(INSTALL_DATA) -D man/cpupower-monitor.1 $(DESTDIR)${mandir}/man1/cpupower-monitor.1 @@ -67,7 +67,7 @@ Index: cpupower-4.10/Makefile install-gmo: $(INSTALL) -d $(DESTDIR)${localedir} -@@ -321,6 +323,7 @@ uninstall: +@@ -327,6 +329,7 @@ uninstall: - rm -f $(DESTDIR)${mandir}/man1/cpupower-set.1 - rm -f $(DESTDIR)${mandir}/man1/cpupower-info.1 - rm -f $(DESTDIR)${mandir}/man1/cpupower-monitor.1 @@ -75,11 +75,11 @@ Index: cpupower-4.10/Makefile - for HLANG in $(LANGUAGES); do \ rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \ done; -Index: cpupower-4.10/bench/Makefile +Index: cpupower-4.15/bench/Makefile =================================================================== ---- cpupower-4.10.orig/bench/Makefile 2017-03-31 18:14:02.035075995 +0200 -+++ cpupower-4.10/bench/Makefile 2017-03-31 18:14:16.675904015 +0200 -@@ -8,7 +8,7 @@ endif +--- cpupower-4.15.orig/bench/Makefile 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/bench/Makefile 2018-01-11 16:49:11.946784841 +0100 +@@ -9,7 +9,7 @@ endif ifeq ($(strip $(STATIC)),true) LIBS = -L../ -L$(OUTPUT) -lm OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \ @@ -88,10 +88,10 @@ Index: cpupower-4.10/bench/Makefile else LIBS = -L../ -L$(OUTPUT) -lm -lcpupower OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o -Index: cpupower-4.10/lib/powercap.c +Index: cpupower-4.15/lib/powercap.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ cpupower-4.10/lib/powercap.c 2017-03-31 18:37:15.529756175 +0200 ++++ cpupower-4.15/lib/powercap.c 2018-01-11 16:49:11.950785082 +0100 @@ -0,0 +1,290 @@ +/* + * (C) 2016 Thomas Renninger @@ -383,10 +383,10 @@ Index: cpupower-4.10/lib/powercap.c + } + return 0; +} -Index: cpupower-4.10/lib/powercap.h +Index: cpupower-4.15/lib/powercap.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ cpupower-4.10/lib/powercap.h 2017-03-31 18:14:16.675904015 +0200 ++++ cpupower-4.15/lib/powercap.h 2018-01-11 16:49:11.950785082 +0100 @@ -0,0 +1,54 @@ +/* + * (C) 2016 Thomas Renninger @@ -442,11 +442,11 @@ Index: cpupower-4.10/lib/powercap.h + + +#endif /* __CPUPOWER_RAPL_H__ */ -Index: cpupower-4.10/utils/builtin.h +Index: cpupower-4.15/utils/builtin.h =================================================================== ---- cpupower-4.10.orig/utils/builtin.h 2017-03-31 18:14:02.035075995 +0200 -+++ cpupower-4.10/utils/builtin.h 2017-03-31 18:14:16.675904015 +0200 -@@ -7,6 +7,8 @@ extern int cmd_freq_set(int argc, const +--- cpupower-4.15.orig/utils/builtin.h 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/utils/builtin.h 2018-01-11 16:49:11.950785082 +0100 +@@ -8,6 +8,8 @@ extern int cmd_freq_set(int argc, const extern int cmd_freq_info(int argc, const char **argv); extern int cmd_idle_set(int argc, const char **argv); extern int cmd_idle_info(int argc, const char **argv); @@ -455,11 +455,11 @@ Index: cpupower-4.10/utils/builtin.h extern int cmd_monitor(int argc, const char **argv); #endif -Index: cpupower-4.10/utils/cpupower.c +Index: cpupower-4.15/utils/cpupower.c =================================================================== ---- cpupower-4.10.orig/utils/cpupower.c 2017-03-31 18:14:02.035075995 +0200 -+++ cpupower-4.10/utils/cpupower.c 2017-03-31 18:14:16.675904015 +0200 -@@ -51,6 +51,7 @@ static struct cmd_struct commands[] = { +--- cpupower-4.15.orig/utils/cpupower.c 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/utils/cpupower.c 2018-01-11 16:49:11.954785323 +0100 +@@ -53,6 +53,7 @@ static struct cmd_struct commands[] = { { "frequency-set", cmd_freq_set, 1 }, { "idle-info", cmd_idle_info, 0 }, { "idle-set", cmd_idle_set, 1 }, @@ -467,10 +467,10 @@ Index: cpupower-4.10/utils/cpupower.c { "set", cmd_set, 1 }, { "info", cmd_info, 0 }, { "monitor", cmd_monitor, 0 }, -Index: cpupower-4.10/utils/powercap-info.c +Index: cpupower-4.15/utils/powercap-info.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ cpupower-4.10/utils/powercap-info.c 2017-03-31 18:14:16.675904015 +0200 ++++ cpupower-4.15/utils/powercap-info.c 2018-01-11 16:49:11.954785323 +0100 @@ -0,0 +1,113 @@ +#include +#include @@ -585,10 +585,10 @@ Index: cpupower-4.10/utils/powercap-info.c + powercap_show(); + return 0; +} -Index: cpupower-4.10/utils/helpers/sysfs.c +Index: cpupower-4.15/utils/helpers/sysfs.c =================================================================== ---- cpupower-4.10.orig/utils/helpers/sysfs.c 2017-03-31 18:14:02.035075995 +0200 -+++ cpupower-4.10/utils/helpers/sysfs.c 2017-03-31 18:14:16.675904015 +0200 +--- cpupower-4.15.orig/utils/helpers/sysfs.c 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/utils/helpers/sysfs.c 2018-01-11 16:49:11.954785323 +0100 @@ -18,7 +18,7 @@ unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen) @@ -615,10 +615,10 @@ Index: cpupower-4.10/utils/helpers/sysfs.c buf[numread] = '\0'; close(fd); -Index: cpupower-4.10/man/cpupower-powercap-info.1 +Index: cpupower-4.15/man/cpupower-powercap-info.1 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ cpupower-4.10/man/cpupower-powercap-info.1 2017-03-31 18:14:16.679904240 +0200 ++++ cpupower-4.15/man/cpupower-powercap-info.1 2018-01-11 16:49:11.958785565 +0100 @@ -0,0 +1,25 @@ +.TH CPUPOWER\-POWERCAP\-INFO "1" "05/08/2016" "" "cpupower Manual" +.SH NAME diff --git a/rapl_monitor.patch b/rapl_monitor.patch index a398c3e..d4651dc 100644 --- a/rapl_monitor.patch +++ b/rapl_monitor.patch @@ -3,11 +3,11 @@ cpupower: rapl monitor - shows the used power consumption in uj for each rapl do Signed-off-by: Thomas Renninger -diff --git a/Makefile b/Makefile -index bf968ec..9e746be 100644 ---- a/Makefile -+++ b/Makefile -@@ -136,6 +136,7 @@ UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \ +Index: cpupower-4.15/Makefile +=================================================================== +--- cpupower-4.15.orig/Makefile 2018-01-11 16:49:11.946784841 +0100 ++++ cpupower-4.15/Makefile 2018-01-11 16:49:23.619489210 +0100 +@@ -139,6 +139,7 @@ UTIL_OBJS = utils/helpers/amd.o utils/h utils/idle_monitor/hsw_ext_idle.o \ utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \ utils/idle_monitor/mperf_monitor.o utils/idle_monitor/cpupower-monitor.o \ @@ -15,10 +15,10 @@ index bf968ec..9e746be 100644 utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \ utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \ utils/cpuidle-set.o utils/powercap-info.o -diff --git a/utils/idle_monitor/cpupower-monitor.c b/utils/idle_monitor/cpupower-monitor.c -index 05f953f..da1857a 100644 ---- a/utils/idle_monitor/cpupower-monitor.c -+++ b/utils/idle_monitor/cpupower-monitor.c +Index: cpupower-4.15/utils/idle_monitor/cpupower-monitor.c +=================================================================== +--- cpupower-4.15.orig/utils/idle_monitor/cpupower-monitor.c 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/utils/idle_monitor/cpupower-monitor.c 2018-01-11 16:49:23.619489210 +0100 @@ -454,9 +454,10 @@ int cmd_monitor(int argc, char **argv) print_results(1, cpu); } @@ -33,10 +33,10 @@ index 05f953f..da1857a 100644 cpu_topology_release(cpu_top); return 0; } -diff --git a/utils/idle_monitor/idle_monitors.def b/utils/idle_monitor/idle_monitors.def -index 0d6ba4d..7c926e9 100644 ---- a/utils/idle_monitor/idle_monitors.def -+++ b/utils/idle_monitor/idle_monitors.def +Index: cpupower-4.15/utils/idle_monitor/idle_monitors.def +=================================================================== +--- cpupower-4.15.orig/utils/idle_monitor/idle_monitors.def 2018-01-10 20:18:31.000000000 +0100 ++++ cpupower-4.15/utils/idle_monitor/idle_monitors.def 2018-01-11 16:49:23.619489210 +0100 @@ -4,5 +4,6 @@ DEF(intel_nhm) DEF(intel_snb) DEF(intel_hsw_ext) @@ -44,11 +44,10 @@ index 0d6ba4d..7c926e9 100644 +DEF(rapl) #endif DEF(cpuidle_sysfs) -diff --git a/utils/idle_monitor/rapl_monitor.c b/utils/idle_monitor/rapl_monitor.c -new file mode 100644 -index 0000000..2b02b21 ---- /dev/null -+++ b/utils/idle_monitor/rapl_monitor.c +Index: cpupower-4.15/utils/idle_monitor/rapl_monitor.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ cpupower-4.15/utils/idle_monitor/rapl_monitor.c 2018-01-11 16:49:23.623489452 +0100 @@ -0,0 +1,141 @@ +/* + * (C) 2016 Thomas Renninger