Hello community, here is the log from the commit of package cpupower for openSUSE:Factory checked in at 2018-01-10 23:36:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cpupower (Old) and /work/SRC/openSUSE:Factory/.cpupower.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cpupower" Wed Jan 10 23:36:44 2018 rev:34 rq:563090 version:4.11 Changes: -------- --- /work/SRC/openSUSE:Factory/cpupower/cpupower.changes 2017-10-21 20:21:42.695180852 +0200 +++ /work/SRC/openSUSE:Factory/.cpupower.new/cpupower.changes 2018-01-10 23:36:49.299368036 +0100 @@ -1,0 +2,10 @@ +Tue Jan 9 16:07:07 UTC 2018 - tr...@suse.de + +- Add x86_energy_perf_bias tool + This is a tool which is, same as turbostat, located in kernel sources here: + tools/power/x86/ +A x86_energy_perf_policy-17.05.11.tar.bz2 +A x86_perf_fix_man_permissions.patch +A x86_perf_makefile_fix_asm_header.patch + +------------------------------------------------------------------- New: ---- x86_energy_perf_policy-17.05.11.tar.bz2 x86_perf_fix_man_permissions.patch x86_perf_makefile_fix_asm_header.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cpupower.spec ++++++ --- /var/tmp/diff_new_pack.gkog6n/_old 2018-01-10 23:36:50.491312112 +0100 +++ /var/tmp/diff_new_pack.gkog6n/_new 2018-01-10 23:36:50.495311925 +0100 @@ -1,7 +1,7 @@ # # spec file for package cpupower # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Author: Thomas Renninger <tr...@suse.de> # # All modifications and additions to the file contributed by third parties @@ -23,6 +23,7 @@ Version: 4.11 Release: 0 %define tsversion 17.04.12 +%define pbversion 17.05.11 Summary: Tools to determine and set CPU Power related Settings License: GPL-2.0 Group: System/Base @@ -30,6 +31,7 @@ Source: %name-%version.tar.bz2 Source1: turbostat-%tsversion.tar.bz2 Source2: cpupower_export_tarball_from_git.sh +Source3: x86_energy_perf_policy-%{pbversion}.tar.bz2 Patch1: cpupower_rapl.patch Patch2: rapl_monitor.patch @@ -38,6 +40,10 @@ Patch22: turbostat_makefile_fix_asm_header.patch # Fixes bsc#1048546: Patch23: turbostat_decode_MSR_IA32_MISC_ENABLE_only_on_Intel.patch + +Patch30: x86_perf_makefile_fix_asm_header.patch +Patch31: x86_perf_fix_man_permissions.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: gettext-tools BuildRequires: pciutils @@ -81,7 +87,7 @@ powersave module. %prep -%setup -D -b 1 +%setup -D -b 1 -b 3 %patch1 -p1 %patch2 -p1 cd ../turbostat-%tsversion @@ -89,6 +95,10 @@ %patch22 -p1 %patch23 -p1 +cd ../x86_energy_perf_policy-%{pbversion} +%patch30 -p1 +%patch31 -p1 + %build # 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. @@ -101,6 +111,8 @@ cd ../turbostat-%tsversion export CFLAGS="%optflags -I ." make %{?_smp_mflags} +cd ../x86_energy_perf_policy-%{pbversion} +make %{?_smp_mflags} %endif %install @@ -116,6 +128,8 @@ %ifarch ix86 x86_64 cd ../turbostat-%tsversion %make_install -e +cd ../x86_energy_perf_policy-%{pbversion} +%make_install %endif %post -n libcpupower0 -p /sbin/ldconfig @@ -129,6 +143,8 @@ %ifarch ix86 x86_64 %_mandir/man8/turbostat* %_bindir/turbostat +%_mandir/man8/x86_energy_perf_policy* +%_bindir/x86_energy_perf_policy %endif %files bench ++++++ cpupower_export_tarball_from_git.sh ++++++ --- /var/tmp/diff_new_pack.gkog6n/_old 2018-01-10 23:36:50.547309485 +0100 +++ /var/tmp/diff_new_pack.gkog6n/_new 2018-01-10 23:36:50.547309485 +0100 @@ -4,8 +4,11 @@ # This code is covered and distributed under # the General Public Licence v2 +GIT_TAG=HEAD +VERSION="" + function usage(){ - echo "$(basename $0) [ git_tag [ tag_to_use ] ]" + 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" @@ -18,61 +21,128 @@ echo "export GIT_DIR= environment variable if the git repo is not the current directory" echo "For example: GIT_DIR=/path_to_git_repo/.git" } -set -x -if [ $# -gt 0 ];then - if [ "$1" = "-h" ] || [ "$1" == "--help" ];then - usage - exit 0 - fi - GIT_TAG="$1" + +function parse_args() +{ + while getopts hv:k:t: name ; do + case $name in + v) + VERSION="$OPTARG" + ;; + + k) + GIT_TAG="$OPTARG" + ;; + t) + TOOL="$OPTARG" + ;; + ?|h) + usage + exit 1 + ;; + esac + done + shift $(($OPTIND -1)) +} + + +function export_cpupower() { + echo "Exporting cpupower from kernel version $GIT_TAG" - # convert - to . as package versions do not allow - - if [ $# -eq 1 ];then - VERSION="${GIT_TAG/-/.}" - # remove leading v - VERSION="-${VERSION#v}" - elif [ $# -eq 2 ];then - VERSION="${2/-/.}" - # remove leading v - VERSION="-${VERSION#v}" - elif [ $# -gt 2 ];then - usage - exit 1 + + if [ "$VERSION" = "" ];then + # convert - to . as package versions do not allow - + if [ $# -eq 1 ];then + VERSION="${GIT_TAG/-/.}" + # remove leading v + VERSION="-${VERSION#v}" + elif [ $# -eq 2 ];then + VERSION="${2/-/.}" + # remove leading v + VERSION="-${VERSION#v}" + elif [ $# -gt 2 ];then + usage + exit 1 + fi fi -else - GIT_TAG="HEAD" - VERSION="" -fi -# Tried to do this with one git archive command, but -# --remote= param seem not to be configured for kernel.org gits + # Tried to do this with one git archive command, but + # --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} + popd + 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/') + fi + TURBOSTAT_VERSION=$(echo "-$TURBOSTAT_VERSION") + mv tools/power/x86/turbostat turbostat${TURBOSTAT_VERSION} + git checkout $GIT_TAG arch/x86/include/asm/msr-index.h + git checkout $GIT_TAG arch/x86/include/asm/intel-family.h + cp arch/x86/include/asm/intel-family.h turbostat${TURBOSTAT_VERSION} + cp arch/x86/include/asm/msr-index.h turbostat${TURBOSTAT_VERSION} + tar -cvjf turbostat${TURBOSTAT_VERSION}.tar.bz2 turbostat${TURBOSTAT_VERSION} + popd + mv "$DIR/turbostat${TURBOSTAT_VERSION}".tar.bz2 . + echo turbostat${TURBOSTAT_VERSION}.tar.bz2 +} + +function export_x86_perf_bias() { + +set -x + git archive --format=tar $GIT_TAG tools/power/x86/x86_energy_perf_policy |tar -x + + if [ "$PERF_BIAS_VERSION"x == ""x ];then + PERF_BIAS_VERSION=$(grep 'printf("x86_energy_perf_policy .* (C) Len Brown <len.br...@intel.com' tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c |sed 's/.*x86_energy_perf_policy \([0-9][0-9].[0-9][0-9].[0-9][0-9]\).*/\1/') + fi + PERF_BIAS_VERSION=$(echo "-$PERF_BIAS_VERSION") + mv tools/power/x86/x86_energy_perf_policy x86_energy_perf_policy${PERF_BIAS_VERSION} +set +x + git checkout $GIT_TAG arch/x86/include/asm/msr-index.h + cp arch/x86/include/asm/msr-index.h x86_energy_perf_policy${PERF_BIAS_VERSION} + tar -cvjf x86_energy_perf_policy${PERF_BIAS_VERSION}.tar.bz2 x86_energy_perf_policy${PERF_BIAS_VERSION} + popd + mv "$DIR/x86_energy_perf_policy${PERF_BIAS_VERSION}".tar.bz2 . + echo x86_energy_perf_policy${PERF_BIAS_VERSION}.tar.bz2 + +} + +parse_args $* -# set -x DIR=`mktemp -d` -pushd "$DIR" -git archive --format=tar $GIT_TAG tools/power/cpupower |tar -x -mv tools/power/cpupower cpupower${VERSION} -tar -cvjf cpupower${VERSION}.tar.bz2 cpupower${VERSION} -popd -TDIR=`mktemp -d` -pushd "$TDIR" - -git archive --format=tar $GIT_TAG tools/power/x86/turbostat |tar -x -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/') +pushd $DIR +TOOL="$1" +if [ "$GIT_DIR" = "" ];then + export GIT_DIR=/archteam/trenn/git/linux-2.6/.git fi -TURBOSTAT_VERSION=$(echo "-$TURBOSTAT_VERSION") -mv tools/power/x86/turbostat turbostat${TURBOSTAT_VERSION} -git checkout $GIT_TAG arch/x86/include/asm/msr-index.h -git checkout $GIT_TAG arch/x86/include/asm/intel-family.h -cp arch/x86/include/asm/intel-family.h turbostat${TURBOSTAT_VERSION} -cp arch/x86/include/asm/msr-index.h turbostat${TURBOSTAT_VERSION} -tar -cvjf turbostat${TURBOSTAT_VERSION}.tar.bz2 turbostat${TURBOSTAT_VERSION} -popd -mv "$DIR/cpupower${VERSION}".tar.bz2 . -rm -rf "$DIR" -mv "$TDIR/turbostat${TURBOSTAT_VERSION}".tar.bz2 . -rm -rf "$TDIR" -# set +x -echo cpupower${VERSION}.tar.bz2 -echo turbostat${TURBOSTAT_VERSION}.tar.bz2 + +case $TOOL in + cpupower) + export_cpupower + ;; + turbostat) + export_turbostat + ;; + x86_perf_bias) + export_x86_perf_bias + ;; + *) + echo "You have to provide the tool you want to export cpupower|turbostat|x86_energy_perf_bias" + usage + rm -rf "$DIR" + exit 1 + ;; +esac +#rm -rf "$DIR" ++++++ x86_perf_fix_man_permissions.patch ++++++ Index: x86_energy_perf_policy-17.05.11/Makefile =================================================================== --- x86_energy_perf_policy-17.05.11.orig/Makefile 2018-01-09 16:59:12.831811429 +0100 +++ x86_energy_perf_policy-17.05.11/Makefile 2018-01-09 16:59:33.133035858 +0100 @@ -24,5 +24,5 @@ install : x86_energy_perf_policy install -d $(DESTDIR)$(PREFIX)/bin install $(BUILD_OUTPUT)/x86_energy_perf_policy $(DESTDIR)$(PREFIX)/bin/x86_energy_perf_policy install -d $(DESTDIR)$(PREFIX)/share/man/man8 - install x86_energy_perf_policy.8 $(DESTDIR)$(PREFIX)/share/man/man8 + install -m 644 x86_energy_perf_policy.8 $(DESTDIR)$(PREFIX)/share/man/man8 ++++++ x86_perf_makefile_fix_asm_header.patch ++++++ Index: x86_energy_perf_policy-17.05.11/Makefile =================================================================== --- x86_energy_perf_policy-17.05.11.orig/Makefile 2017-12-21 01:52:01.000000000 +0100 +++ x86_energy_perf_policy-17.05.11/Makefile 2018-01-09 16:17:56.058472491 +0100 @@ -10,7 +10,7 @@ endif x86_energy_perf_policy : x86_energy_perf_policy.c CFLAGS += -Wall -CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' +CFLAGS += -DMSRHEADER='"msr-index.h"' %: %.c @mkdir -p $(BUILD_OUTPUT)