Hello community,
here is the log from the commit of package cpupower for openSUSE:Factory checked in at 2016-05-04 08:19:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cpupower (Old)
and /work/SRC/openSUSE:Factory/.cpupower.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cpupower"
Changes:
--------
--- /work/SRC/openSUSE:Factory/cpupower/cpupower.changes 2016-04-28 16:58:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cpupower.new/cpupower.changes 2016-05-04 08:19:58.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Apr 28 12:28:09 UTC 2016 - trenn@suse.de
+
+- Update turbostat to version 4.12
+- Update cpupower to latest sources
+- Let turbostat only build against a local msr-index.h
+ Also add the msr-index.h export to the tarball from git repo script
+*Delete make_header_file_passable_from_outside.patch
+
+-------------------------------------------------------------------
Old:
----
make_header_file_passable_from_outside.patch
msr-index.h
turbostat-4.8.tar.bz2
New:
----
turbostat-4.12.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cpupower.spec ++++++
--- /var/tmp/diff_new_pack.ZeOTjc/_old 2016-05-04 08:19:59.000000000 +0200
+++ /var/tmp/diff_new_pack.ZeOTjc/_new 2016-05-04 08:19:59.000000000 +0200
@@ -22,7 +22,7 @@
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
Version: 4.6
Release: 0
-%define tsversion 4.8
+%define tsversion 4.12
Summary: Tools to determine and set CPU Power related Settings
License: GPL-2.0
Group: System/Base
@@ -30,15 +30,10 @@
Source: %{name}-%{version}.tar.bz2
Source1: turbostat-%{tsversion}.tar.bz2
Source2: cpupower_export_tarball_from_git.sh
-Source3: msr-index.h
Patch1: library_cleanup.patch
Patch20: turbostat_fix_man_perm.patch
-Patch21: make_header_file_passable_from_outside.patch
Patch22: turbostat_set_asm_header_fixed.patch
-%if 0%{?suse_version} > 1315
-BuildRequires: linux-glibc-devel
-%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gettext-tools
BuildRequires: pciutils
@@ -86,10 +81,7 @@
%patch1 -p1
cd ../turbostat-%{tsversion}
%patch20 -p1
-%patch21 -p1
-%if 0%{?suse_version} <= 1315
%patch22 -p1
-%endif
%build
# This package failed when testing with -Wl,-as-needed being default.
@@ -101,10 +93,8 @@
%ifarch ix86 x86_64
cd ../turbostat-%{tsversion}
-%if 0%{?suse_version} <= 1315
-cp %{SOURCE3} .
-%endif
-CFLAGS="%optflags -I. -DMSRHEADER=\"\"" make %{?_smp_mflags}
+export CFLAGS="%optflags -I ."
+make %{?_smp_mflags}
%endif
%install
++++++ cpupower-4.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpupower-4.6/Makefile new/cpupower-4.6/Makefile
--- old/cpupower-4.6/Makefile 2015-12-07 16:45:21.000000000 +0100
+++ new/cpupower-4.6/Makefile 2016-04-27 01:25:51.000000000 +0200
@@ -47,6 +47,11 @@
# cpufreq-bench benchmarking tool
CPUFREQ_BENCH ?= true
+# Do not build libraries, but build the code in statically
+# Libraries are still built, otherwise the Makefile code would
+# be rather ugly.
+export STATIC ?= false
+
# Prefix to the directories we're installing to
DESTDIR ?=
@@ -161,6 +166,12 @@
COMPILE_BENCH += compile-bench
endif
+ifeq ($(strip $(STATIC)),true)
+ UTIL_OBJS += $(LIB_OBJS)
+ UTIL_HEADERS += $(LIB_HEADERS)
+ UTIL_SRC += $(LIB_SRC)
+endif
+
CFLAGS += $(WARNINGS)
ifeq ($(strip $(V)),false)
@@ -209,7 +220,11 @@
$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
$(ECHO) " CC " $@
+ifeq ($(strip $(STATIC)),true)
+ $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lrt -lpci -L$(OUTPUT) -o $@
+else
$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lcpupower -lrt -lpci -L$(OUTPUT) -o $@
+endif
$(QUIET) $(STRIPCMD) $@
$(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)
@@ -291,7 +306,11 @@
@#DESTDIR must be set from outside to survive
@sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT) install
+ifeq ($(strip $(STATIC)),true)
+install: all install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
+else
install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
+endif
uninstall:
- rm -f $(DESTDIR)${libdir}/libcpupower.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpupower-4.6/bench/Makefile new/cpupower-4.6/bench/Makefile
--- old/cpupower-4.6/bench/Makefile 2015-12-07 16:45:21.000000000 +0100
+++ new/cpupower-4.6/bench/Makefile 2016-04-27 01:25:51.000000000 +0200
@@ -5,9 +5,15 @@
endif
endif
+ifeq ($(strip $(STATIC)),true)
+LIBS = -L../ -L$(OUTPUT) -lm
+OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
+ $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
+else
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
-
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
+endif
+
CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
$(OUTPUT)%.o : %.c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpupower-4.6/utils/cpufreq-info.c new/cpupower-4.6/utils/cpufreq-info.c
--- old/cpupower-4.6/utils/cpufreq-info.c 2015-12-07 16:45:21.000000000 +0100
+++ new/cpupower-4.6/utils/cpufreq-info.c 2016-04-27 01:25:51.000000000 +0200
@@ -10,10 +10,12 @@
#include
#include
#include
+#include
#include
#include "cpufreq.h"
+#include "helpers/sysfs.h"
#include "helpers/helpers.h"
#include "helpers/bitmask.h"
@@ -244,149 +246,21 @@
return 0;
}
-static void debug_output_one(unsigned int cpu)
-{
- char *driver;
- struct cpufreq_affected_cpus *cpus;
- struct cpufreq_available_frequencies *freqs;
- unsigned long min, max, freq_kernel, freq_hardware;
- unsigned long total_trans, latency;
- unsigned long long total_time;
- struct cpufreq_policy *policy;
- struct cpufreq_available_governors *governors;
- struct cpufreq_stats *stats;
-
- if (cpufreq_cpu_exists(cpu))
- return;
-
- freq_kernel = cpufreq_get_freq_kernel(cpu);
- freq_hardware = cpufreq_get_freq_hardware(cpu);
-
- driver = cpufreq_get_driver(cpu);
- if (!driver) {
- printf(_(" no or unknown cpufreq driver is active on this CPU\n"));
- } else {
- printf(_(" driver: %s\n"), driver);
- cpufreq_put_driver(driver);
- }
-
- cpus = cpufreq_get_related_cpus(cpu);
- if (cpus) {
- printf(_(" CPUs which run at the same hardware frequency: "));
- while (cpus->next) {
- printf("%d ", cpus->cpu);
- cpus = cpus->next;
- }
- printf("%d\n", cpus->cpu);
- cpufreq_put_related_cpus(cpus);
- }
-
- cpus = cpufreq_get_affected_cpus(cpu);
- if (cpus) {
- printf(_(" CPUs which need to have their frequency coordinated by software: "));
- while (cpus->next) {
- printf("%d ", cpus->cpu);
- cpus = cpus->next;
- }
- printf("%d\n", cpus->cpu);
- cpufreq_put_affected_cpus(cpus);
- }
-
- latency = cpufreq_get_transition_latency(cpu);
- if (latency) {
- printf(_(" maximum transition latency: "));
- print_duration(latency);
- printf(".\n");
- }
-
- if (!(cpufreq_get_hardware_limits(cpu, &min, &max))) {
- printf(_(" hardware limits: "));
- print_speed(min);
- printf(" - ");
- print_speed(max);
- printf("\n");
- }
-
- freqs = cpufreq_get_available_frequencies(cpu);
- if (freqs) {
- printf(_(" available frequency steps: "));
- while (freqs->next) {
- print_speed(freqs->frequency);
- printf(", ");
- freqs = freqs->next;
- }
- print_speed(freqs->frequency);
- printf("\n");
- cpufreq_put_available_frequencies(freqs);
- }
-
- governors = cpufreq_get_available_governors(cpu);
- if (governors) {
- printf(_(" available cpufreq governors: "));
- while (governors->next) {
- printf("%s, ", governors->governor);
- governors = governors->next;
- }
- printf("%s\n", governors->governor);
- cpufreq_put_available_governors(governors);
- }
-
- policy = cpufreq_get_policy(cpu);
- if (policy) {
- printf(_(" current policy: frequency should be within "));
- print_speed(policy->min);
- printf(_(" and "));
- print_speed(policy->max);
-
- printf(".\n ");
- printf(_("The governor \"%s\" may"
- " decide which speed to use\n within this range.\n"),
- policy->governor);
- cpufreq_put_policy(policy);
- }
-
- if (freq_kernel || freq_hardware) {
- printf(_(" current CPU frequency is "));
- if (freq_hardware) {
- print_speed(freq_hardware);
- printf(_(" (asserted by call to hardware)"));
- } else
- print_speed(freq_kernel);
- printf(".\n");
- }
- stats = cpufreq_get_stats(cpu, &total_time);
- if (stats) {
- printf(_(" cpufreq stats: "));
- while (stats) {
- print_speed(stats->frequency);
- printf(":%.2f%%", (100.0 * stats->time_in_state) / total_time);
- stats = stats->next;
- if (stats)
- printf(", ");
- }
- cpufreq_put_stats(stats);
- total_trans = cpufreq_get_transitions(cpu);
- if (total_trans)
- printf(" (%lu)\n", total_trans);
- else
- printf("\n");
- }
- get_boost_mode(cpu);
-
-}
-
/* --freq / -f */
static int get_freq_kernel(unsigned int cpu, unsigned int human)
{
unsigned long freq = cpufreq_get_freq_kernel(cpu);
- if (!freq)
+ printf(_(" current CPU frequency: "));
+ if (!freq) {
+ printf(_(" Unable to call to kernel\n"));
return -EINVAL;
+ }
if (human) {
print_speed(freq);
- printf("\n");
} else
- printf("%lu\n", freq);
+ printf("%lu", freq);
+ printf(_(" (asserted by call to kernel)\n"));
return 0;
}
@@ -396,13 +270,16 @@
static int get_freq_hardware(unsigned int cpu, unsigned int human)
{
unsigned long freq = cpufreq_get_freq_hardware(cpu);
- if (!freq)
+ printf(_(" current CPU frequency: "));
+ if (!freq) {
+ printf("Unable to call hardware\n");
return -EINVAL;
+ }
if (human) {
print_speed(freq);
- printf("\n");
} else
- printf("%lu\n", freq);
+ printf("%lu", freq);
+ printf(_(" (asserted by call to hardware)\n"));
return 0;
}
@@ -411,9 +288,17 @@
static int get_hardware_limits(unsigned int cpu)
{
unsigned long min, max;
- if (cpufreq_get_hardware_limits(cpu, &min, &max))
+
+ printf(_(" hardware limits: "));
+ if (cpufreq_get_hardware_limits(cpu, &min, &max)) {
+ printf(_("Not Available\n"));
return -EINVAL;
- printf("%lu %lu\n", min, max);
+ }
+
+ print_speed(min);
+ printf(" - ");
+ print_speed(max);
+ printf("\n");
return 0;
}
@@ -422,9 +307,11 @@
static int get_driver(unsigned int cpu)
{
char *driver = cpufreq_get_driver(cpu);
- if (!driver)
+ if (!driver) {
+ printf(_(" no or unknown cpufreq driver is active on this CPU\n"));
return -EINVAL;
- printf("%s\n", driver);
+ }
+ printf(" driver: %s\n", driver);
cpufreq_put_driver(driver);
return 0;
}
@@ -434,9 +321,19 @@
static int get_policy(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_get_policy(cpu);
- if (!policy)
+ if (!policy) {
+ printf(_(" Unable to determine current policy\n"));
return -EINVAL;
- printf("%lu %lu %s\n", policy->min, policy->max, policy->governor);
+ }
+ printf(_(" current policy: frequency should be within "));
+ print_speed(policy->min);
+ printf(_(" and "));
+ print_speed(policy->max);
+
+ printf(".\n ");
+ printf(_("The governor \"%s\" may decide which speed to use\n"
+ " within this range.\n"),
+ policy->governor);
cpufreq_put_policy(policy);
return 0;
}
@@ -447,8 +344,12 @@
{
struct cpufreq_available_governors *governors =
cpufreq_get_available_governors(cpu);
- if (!governors)
+
+ printf(_(" available cpufreq governors: "));
+ if (!governors) {
+ printf(_("Not Available\n"));
return -EINVAL;
+ }
while (governors->next) {
printf("%s ", governors->governor);
@@ -465,8 +366,12 @@
static int get_affected_cpus(unsigned int cpu)
{
struct cpufreq_affected_cpus *cpus = cpufreq_get_affected_cpus(cpu);
- if (!cpus)
+
+ printf(_(" CPUs which need to have their frequency coordinated by software: "));
+ if (!cpus) {
+ printf(_("Not Available\n"));
return -EINVAL;
+ }
while (cpus->next) {
printf("%d ", cpus->cpu);
@@ -482,8 +387,12 @@
static int get_related_cpus(unsigned int cpu)
{
struct cpufreq_affected_cpus *cpus = cpufreq_get_related_cpus(cpu);
- if (!cpus)
+
+ printf(_(" CPUs which run at the same hardware frequency: "));
+ if (!cpus) {
+ printf(_("Not Available\n"));
return -EINVAL;
+ }
while (cpus->next) {
printf("%d ", cpus->cpu);
@@ -524,8 +433,12 @@
static int get_latency(unsigned int cpu, unsigned int human)
{
unsigned long latency = cpufreq_get_transition_latency(cpu);
- if (!latency)
+
+ printf(_(" maximum transition latency: "));
+ if (!latency || latency == UINT_MAX) {
+ printf(_(" Cannot determine or is not supported.\n"));
return -EINVAL;
+ }
if (human) {
print_duration(latency);
@@ -535,6 +448,36 @@
return 0;
}
+static void debug_output_one(unsigned int cpu)
+{
+ struct cpufreq_available_frequencies *freqs;
+
+ get_driver(cpu);
+ get_related_cpus(cpu);
+ get_affected_cpus(cpu);
+ get_latency(cpu, 1);
+ get_hardware_limits(cpu);
+
+ freqs = cpufreq_get_available_frequencies(cpu);
+ if (freqs) {
+ printf(_(" available frequency steps: "));
+ while (freqs->next) {
+ print_speed(freqs->frequency);
+ printf(", ");
+ freqs = freqs->next;
+ }
+ print_speed(freqs->frequency);
+ printf("\n");
+ cpufreq_put_available_frequencies(freqs);
+ }
+
+ get_available_governors(cpu);
+ get_policy(cpu);
+ if (get_freq_hardware(cpu, 1) < 0)
+ get_freq_kernel(cpu, 1);
+ get_boost_mode(cpu);
+}
+
static struct option info_opts[] = {
{"debug", no_argument, NULL, 'e'},
{"boost", no_argument, NULL, 'b'},
@@ -647,11 +590,14 @@
if (!bitmask_isbitset(cpus_chosen, cpu))
continue;
- if (cpufreq_cpu_exists(cpu)) {
- printf(_("couldn't analyze CPU %d as it doesn't seem to be present\n"), cpu);
+
+ printf(_("analyzing CPU %d:\n"), cpu);
+
+ if (sysfs_is_cpu_online(cpu) != 1) {
+ printf(_(" *is offline\n"));
+ printf("\n");
continue;
}
- printf(_("analyzing CPU %d:\n"), cpu);
switch (output_param) {
case 'b':
@@ -693,6 +639,7 @@
}
if (ret)
return ret;
+ printf("\n");
}
return ret;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpupower-4.6/utils/cpuidle-info.c new/cpupower-4.6/utils/cpuidle-info.c
--- old/cpupower-4.6/utils/cpuidle-info.c 2015-12-07 16:45:21.000000000 +0100
+++ new/cpupower-4.6/utils/cpuidle-info.c 2016-04-27 01:25:51.000000000 +0200
@@ -12,7 +12,6 @@
#include
#include
#include
-#include
#include "helpers/helpers.h"
#include "helpers/sysfs.h"
@@ -25,8 +24,6 @@
unsigned int idlestates, idlestate;
char *tmp;
- printf(_ ("Analyzing CPU %d:\n"), cpu);
-
idlestates = sysfs_get_idlestate_count(cpu);
if (idlestates == 0) {
printf(_("CPU %u: No idle states\n"), cpu);
@@ -71,7 +68,6 @@
printf(_("Duration: %llu\n"),
sysfs_get_idlestate_time(cpu, idlestate));
}
- printf("\n");
}
static void cpuidle_general_output(void)
@@ -189,10 +185,17 @@
for (cpu = bitmask_first(cpus_chosen);
cpu <= bitmask_last(cpus_chosen); cpu++) {
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
- cpufreq_cpu_exists(cpu))
+ if (!bitmask_isbitset(cpus_chosen, cpu))
continue;
+ printf(_("analyzing CPU %d:\n"), cpu);
+
+ if (sysfs_is_cpu_online(cpu) != 1) {
+ printf(_(" *is offline\n"));
+ printf("\n");
+ continue;
+ }
+
switch (output_param) {
case 'o':
@@ -203,6 +206,7 @@
cpuidle_cpu_output(cpu, verbose);
break;
}
+ printf("\n");
}
return EXIT_SUCCESS;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpupower-4.6/utils/cpupower-info.c new/cpupower-4.6/utils/cpupower-info.c
--- old/cpupower-4.6/utils/cpupower-info.c 2015-12-07 16:45:21.000000000 +0100
+++ new/cpupower-4.6/utils/cpupower-info.c 2016-04-27 01:25:51.000000000 +0200
@@ -12,7 +12,6 @@
#include
#include
-#include
#include "helpers/helpers.h"
#include "helpers/sysfs.h"
@@ -83,12 +82,16 @@
for (cpu = bitmask_first(cpus_chosen);
cpu <= bitmask_last(cpus_chosen); cpu++) {
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
- cpufreq_cpu_exists(cpu))
+ if (!bitmask_isbitset(cpus_chosen, cpu))
continue;
printf(_("analyzing CPU %d:\n"), cpu);
+ if (sysfs_is_cpu_online(cpu) != 1){
+ printf(_(" *is offline\n"));
+ continue;
+ }
+
if (params.perf_bias) {
ret = msr_intel_get_perf_bias(cpu);
if (ret < 0) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpupower-4.6/utils/cpupower-set.c new/cpupower-4.6/utils/cpupower-set.c
--- old/cpupower-4.6/utils/cpupower-set.c 2015-12-07 16:45:21.000000000 +0100
+++ new/cpupower-4.6/utils/cpupower-set.c 2016-04-27 01:25:51.000000000 +0200
@@ -12,7 +12,6 @@
#include
#include
-#include
#include "helpers/helpers.h"
#include "helpers/sysfs.h"
#include "helpers/bitmask.h"
@@ -78,10 +77,15 @@
for (cpu = bitmask_first(cpus_chosen);
cpu <= bitmask_last(cpus_chosen); cpu++) {
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
- cpufreq_cpu_exists(cpu))
+ if (!bitmask_isbitset(cpus_chosen, cpu))
continue;
+ if (sysfs_is_cpu_online(cpu) != 1){
+ fprintf(stderr, _("Cannot set values on CPU %d:"), cpu);
+ fprintf(stderr, _(" *is offline\n"));
+ continue;
+ }
+
if (params.perf_bias) {
ret = msr_intel_set_perf_bias(cpu, perf_bias);
if (ret) {
++++++ cpupower_export_tarball_from_git.sh ++++++
--- /var/tmp/diff_new_pack.ZeOTjc/_old 2016-05-04 08:19:59.000000000 +0200
+++ /var/tmp/diff_new_pack.ZeOTjc/_new 2016-05-04 08:19:59.000000000 +0200
@@ -56,18 +56,19 @@
popd
TDIR=`mktemp -d`
pushd "$TDIR"
-set -x
+
git archive --format=tar $GIT_TAG tools/power/x86/turbostat |tar -x
-mv tools/power/x86/turbostat turbostat${VERSION}
-mkdir turbostat${VERSION}/asm
+TURBOSTAT_VERSION=$(grep "turbostat version" tools/power/x86/turbostat/turbostat.c |grep fprintf |sed 's/.*turbostat version \([0-9].[0-9][0-9]\).*/\1/')
+TURBOSTAT_VERSION=$(echo "-$TURBOSTAT_VERSION")
+mv tools/power/x86/turbostat turbostat${TURBOSTAT_VERSION}
[ ! -e "$GIT_DIR"/../arch/x86/include/asm/msr-index.h ] && echo "msr-index.h does not exist" && exit 1
-cp "$GIT_DIR"/../arch/x86/include/uapi/asm/msr-index.h turbostat${VERSION}/asm
-tar -cvjf turbostat${VERSION}.tar.bz2 turbostat${VERSION}
+cp "$GIT_DIR"/../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${VERSION}".tar.bz2 .
+mv "$TDIR/turbostat${TURBOSTAT_VERSION}".tar.bz2 .
rm -rf "$TDIR"
# set +x
echo cpupower${VERSION}.tar.bz2
-echo turbostat${VERSION}.tar.bz2
+echo turbostat${TURBOSTAT_VERSION}.tar.bz2
++++++ library_cleanup.patch ++++++
--- /var/tmp/diff_new_pack.ZeOTjc/_old 2016-05-04 08:19:59.000000000 +0200
+++ /var/tmp/diff_new_pack.ZeOTjc/_new 2016-05-04 08:19:59.000000000 +0200
@@ -1,43 +1,8 @@
-cpupower: Add cpuidle parts into library
-
-cpupower was built from cpufrequtils and enhanced by quite some neat cpuidle
-userspace tools.
-
-Now the cpu idle functions have been separated and added to the cpupower.so
-library.
-
-Here again pasted for better review of the interfaces:
-
-======================================
-int cpuidle_is_state_disabled(unsigned int cpu,
- unsigned int idlestate);
-int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate,
- unsigned int disable);
-unsigned long cpuidle_state_latency(unsigned int cpu,
- unsigned int idlestate);
-unsigned long cpuidle_state_usage(unsigned int cpu,
- unsigned int idlestate);
-unsigned long long cpuidle_state_time(unsigned int cpu,
- unsigned int idlestate);
-char *cpuidle_state_name(unsigned int cpu,
- unsigned int idlestate);
-char *cpuidle_state_desc(unsigned int cpu,
- unsigned int idlestate);
-unsigned int cpuidle_state_count(unsigned int cpu);
-
-char *cpuidle_get_governor(void);
-char *cpuidle_get_driver(void);
-
-======================================
-
-
-Signed-off-by: Thomas Renninger
-
diff --git a/Makefile b/Makefile
-index 2e2ba2e..1ca525d 100644
+index 0adaf0c..8358863 100644
--- a/Makefile
+++ b/Makefile
-@@ -58,7 +58,7 @@ DESTDIR ?=
+@@ -63,7 +63,7 @@ DESTDIR ?=
# and _should_ modify the PACKAGE_BUGREPORT definition
VERSION= $(shell ./utils/version-gen.sh)
@@ -46,7 +11,7 @@
LIB_MIN= 0
PACKAGE = cpupower
-@@ -124,7 +124,7 @@ WARNINGS += -Wshadow
+@@ -129,7 +129,7 @@ WARNINGS += -Wshadow
CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
-DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
@@ -55,7 +20,7 @@
utils/helpers/sysfs.o utils/helpers/misc.o utils/helpers/cpuid.o \
utils/helpers/pci.o utils/helpers/bitmask.o \
utils/idle_monitor/nhm_idle.o utils/idle_monitor/snb_idle.o \
-@@ -143,9 +143,9 @@ UTIL_HEADERS = utils/helpers/helpers.h utils/idle_monitor/cpupower-monitor.h \
+@@ -148,9 +148,9 @@ UTIL_HEADERS = utils/helpers/helpers.h utils/idle_monitor/cpupower-monitor.h \
utils/helpers/bitmask.h \
utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def
@@ -68,7 +33,7 @@
LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS))
CFLAGS += -pipe
-@@ -265,6 +265,7 @@ install-lib:
+@@ -280,6 +280,7 @@ install-lib:
$(CP) $(OUTPUT)libcpupower.so* $(DESTDIR)${libdir}/
$(INSTALL) -d $(DESTDIR)${includedir}
$(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
@@ -76,7 +41,7 @@
install-tools:
$(INSTALL) -d $(DESTDIR)${bindir}
-@@ -296,6 +297,7 @@ install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENC
+@@ -315,6 +316,7 @@ endif
uninstall:
- rm -f $(DESTDIR)${libdir}/libcpupower.*
- rm -f $(DESTDIR)${includedir}/cpufreq.h
@@ -2337,28 +2302,6 @@
-extern int sysfs_modify_freq_policy_governor(unsigned int cpu, char *governor);
-extern int sysfs_set_frequency(unsigned int cpu,
- unsigned long target_frequency);
-diff --git a/utils/cpufreq-info.c b/utils/cpufreq-info.c
-index 0e67643..e9679f4 100644
---- a/utils/cpufreq-info.c
-+++ b/utils/cpufreq-info.c
-@@ -256,7 +256,7 @@ static void debug_output_one(unsigned int cpu)
- struct cpufreq_available_governors *governors;
- struct cpufreq_stats *stats;
-
-- if (cpufreq_cpu_exists(cpu))
-+ if (cpupower_is_cpu_online(cpu))
- return;
-
- freq_kernel = cpufreq_get_freq_kernel(cpu);
-@@ -647,7 +647,7 @@ int cmd_freq_info(int argc, char **argv)
-
- if (!bitmask_isbitset(cpus_chosen, cpu))
- continue;
-- if (cpufreq_cpu_exists(cpu)) {
-+ if (cpupower_is_cpu_online(cpu)) {
- printf(_("couldn't analyze CPU %d as it doesn't seem to be present\n"), cpu);
- continue;
- }
diff --git a/utils/cpufreq-set.c b/utils/cpufreq-set.c
index 0fbd1a2..b4bf769 100644
--- a/utils/cpufreq-set.c
@@ -2396,30 +2339,31 @@
printf(_("Setting cpu: %d\n"), cpu);
diff --git a/utils/cpuidle-info.c b/utils/cpuidle-info.c
-index 750c1d8..8473ec4 100644
+index 8bf8ab5..b59c85d 100644
--- a/utils/cpuidle-info.c
+++ b/utils/cpuidle-info.c
-@@ -13,9 +13,9 @@
+@@ -13,8 +13,10 @@
#include
#include
- #include
-+#include
- #include "helpers/helpers.h"
--#include "helpers/sysfs.h"
+-#include "helpers/helpers.h"
++#include
++
+ #include "helpers/sysfs.h"
++#include "helpers/helpers.h"
#include "helpers/bitmask.h"
#define LINE_LEN 10
-@@ -27,7 +27,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
-
- printf(_ ("Analyzing CPU %d:\n"), cpu);
+@@ -24,7 +26,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
+ unsigned int idlestates, idlestate;
+ char *tmp;
- idlestates = sysfs_get_idlestate_count(cpu);
+ idlestates = cpuidle_state_count(cpu);
if (idlestates == 0) {
printf(_("CPU %u: No idle states\n"), cpu);
return;
-@@ -36,7 +36,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
+@@ -33,7 +35,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
printf(_("Number of idle states: %d\n"), idlestates);
printf(_("Available idle states:"));
for (idlestate = 0; idlestate < idlestates; idlestate++) {
@@ -2428,7 +2372,7 @@
if (!tmp)
continue;
printf(" %s", tmp);
-@@ -48,28 +48,28 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
+@@ -45,28 +47,28 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
return;
for (idlestate = 0; idlestate < idlestates; idlestate++) {
@@ -2461,9 +2405,9 @@
- sysfs_get_idlestate_time(cpu, idlestate));
+ cpuidle_state_time(cpu, idlestate));
}
- printf("\n");
}
-@@ -78,7 +78,7 @@ static void cpuidle_general_output(void)
+
+@@ -74,7 +76,7 @@ static void cpuidle_general_output(void)
{
char *tmp;
@@ -2472,7 +2416,7 @@
if (!tmp) {
printf(_("Could not determine cpuidle driver\n"));
return;
-@@ -87,7 +87,7 @@ static void cpuidle_general_output(void)
+@@ -83,7 +85,7 @@ static void cpuidle_general_output(void)
printf(_("CPUidle driver: %s\n"), tmp);
free(tmp);
@@ -2481,7 +2425,7 @@
if (!tmp) {
printf(_("Could not determine cpuidle governor\n"));
return;
-@@ -102,7 +102,7 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
+@@ -98,7 +100,7 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
long max_allowed_cstate = 2000000000;
unsigned int cstate, cstates;
@@ -2490,7 +2434,7 @@
if (cstates == 0) {
printf(_("CPU %u: No C-states info\n"), cpu);
return;
-@@ -117,11 +117,11 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
+@@ -113,11 +115,11 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
"type[C%d] "), cstate, cstate);
printf(_("promotion[--] demotion[--] "));
printf(_("latency[%03lu] "),
@@ -2505,15 +2449,6 @@
}
}
-@@ -190,7 +190,7 @@ int cmd_idle_info(int argc, char **argv)
- cpu <= bitmask_last(cpus_chosen); cpu++) {
-
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
-- cpufreq_cpu_exists(cpu))
-+ cpupower_is_cpu_online(cpu))
- continue;
-
- switch (output_param) {
diff --git a/utils/cpuidle-set.c b/utils/cpuidle-set.c
index d6b6ae4..691c24d 100644
--- a/utils/cpuidle-set.c
@@ -2602,55 +2537,6 @@
(cpu, idlestate, 0);
if (ret == 0)
printf(_("Idlestate %u enabled on CPU %u\n"), idlestate, cpu);
-diff --git a/utils/cpupower-info.c b/utils/cpupower-info.c
-index 10299f2..0a02485 100644
---- a/utils/cpupower-info.c
-+++ b/utils/cpupower-info.c
-@@ -13,8 +13,9 @@
- #include
-
- #include
-+#include
-+
- #include "helpers/helpers.h"
--#include "helpers/sysfs.h"
-
- static struct option set_opts[] = {
- {"perf-bias", optional_argument, NULL, 'b'},
-@@ -84,7 +85,7 @@ int cmd_info(int argc, char **argv)
- cpu <= bitmask_last(cpus_chosen); cpu++) {
-
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
-- cpufreq_cpu_exists(cpu))
-+ cpupower_is_cpu_online(cpu))
- continue;
-
- printf(_("analyzing CPU %d:\n"), cpu);
-diff --git a/utils/cpupower-set.c b/utils/cpupower-set.c
-index 3e6f374..cf24c09 100644
---- a/utils/cpupower-set.c
-+++ b/utils/cpupower-set.c
-@@ -12,9 +12,9 @@
- #include
- #include
-
--#include
-+#include
-+
- #include "helpers/helpers.h"
--#include "helpers/sysfs.h"
- #include "helpers/bitmask.h"
-
- static struct option set_opts[] = {
-@@ -79,7 +79,7 @@ int cmd_set(int argc, char **argv)
- cpu <= bitmask_last(cpus_chosen); cpu++) {
-
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
-- cpufreq_cpu_exists(cpu))
-+ cpupower_is_cpu_online(cpu))
- continue;
-
- if (params.perf_bias) {
diff --git a/utils/helpers/helpers.h b/utils/helpers/helpers.h
index aa9e954..afb66f8 100644
--- a/utils/helpers/helpers.h
++++++ turbostat-4.8.tar.bz2 -> turbostat-4.12.tar.bz2 ++++++
++++ 3512 lines of diff (skipped)