Hello community,

here is the log from the commit of package cpupower for openSUSE:Factory 
checked in at 2014-02-06 06:47:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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        2013-07-08 
22:24:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cpupower.new/cpupower.changes   2014-02-06 
06:47:23.000000000 +0100
@@ -1,0 +2,16 @@
+Fri Jan 31 15:48:18 UTC 2014 - [email protected]
+
+- Update cpupower to latest kernel version (3.13-rc7, rc7 missed out,
+  there won't be any changes in cpupower anymore and obs does not like
+  -rc7 in version tag.
+- All patches are now included mainline, therefore:
+  Drop cpupower_make_get_idlestate_count_unsigned.patch
+  Drop cpupower_disable_cstates.patch
+  Drop introduce_cpupower_idle_set.patch
+  Drop cpupower-haswell_support.patch
+  Drop cpupower_hsw_special.patch
+- Add turbostat utility (fate#315666):
+  Add turbostat-3.13.tar.bz2
+  Add turbostat_fix_man_perm.patch
+
+-------------------------------------------------------------------

Old:
----
  cpupower-3.8.tar.bz2
  cpupower-haswell_support.patch
  cpupower_disable_cstates.patch
  cpupower_hsw_special.patch
  cpupower_make_get_idlestate_count_unsigned.patch
  introduce_cpupower_idle_set.patch

New:
----
  cpupower-3.13.tar.bz2
  turbostat-3.13.tar.bz2
  turbostat_fix_man_perm.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cpupower.spec ++++++
--- /var/tmp/diff_new_pack.QquB7V/_old  2014-02-06 06:47:24.000000000 +0100
+++ /var/tmp/diff_new_pack.QquB7V/_new  2014-02-06 06:47:24.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package cpupower
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # Author: Thomas Renninger <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
@@ -22,18 +22,16 @@
 Url:            
http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html
 # Use this as version when things are in mainline kernel
 %define version %(rpm -q --qf '%{VERSION}' kernel-source)
-Version:        3.8
+Version:        3.13
 Release:        0
+%define tsversion      3.13
 Summary:        Tools to determine and set CPU Power related Settings
 License:        GPL-2.0
 Group:          System/Base
 Source:         %{name}-%{version}.tar.bz2
-Source1:        cpupower_export_tarball_from_git.sh
-Patch1:         cpupower_make_get_idlestate_count_unsigned.patch
-Patch2:         cpupower_disable_cstates.patch
-Patch3:         introduce_cpupower_idle_set.patch
-Patch4:         cpupower-haswell_support.patch
-Patch5:         cpupower_hsw_special.patch
+Source1:        turbostat-%{tsversion}.tar.bz2
+Source2:        cpupower_export_tarball_from_git.sh
+Patch1:         turbostat_fix_man_perm.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  gettext-tools
 BuildRequires:  pciutils
@@ -77,21 +75,21 @@
 powersave module.
 
 %prep
-%setup -q
+%setup -D -b 1
+cd ../turbostat-%{tsversion}
 %patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -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.
 export SUSE_ASNEEDED=0
 CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir 
libdir=%_libdir CPUFRQ_BENCH=true STRIP=true VERSION=%{version}"
-export CFLAGS="$RPM_OPT_FLAGS"
+export CFLAGS="$RPM_OPT_FLAGS -I ."
 make $CONF %{?_smp_mflags}
 
+cd ../turbostat-%{tsversion}
+make %{?_smp_mflags}
+
 %install
 export SUSE_ASNEEDED=0
 CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir 
libdir=%_libdir CPUFRQ_BENCH=true DESTDIR=$RPM_BUILD_ROOT sbindir=/usr/sbin 
docdir=%{_docdir}/%{name} confdir=/etc VERSION=%{version}"
@@ -102,6 +100,9 @@
 mv $RPM_BUILD_ROOT/%{_docdir}/%{name}/cpufreq-bench_script.sh 
$RPM_BUILD_ROOT/%{_docdir}/%{name}/examples
 %find_lang %{name}
 
+cd ../turbostat-%{tsversion}
+make install -e DESTDIR="$RPM_BUILD_ROOT"
+
 %post -n libcpupower0 -p /sbin/ldconfig
 
 %postun -n libcpupower0 -p /sbin/ldconfig
@@ -109,7 +110,9 @@
 %files -f %{name}.lang
 %defattr (-,root,root)
 %{_mandir}/man1/cpupower*
+%{_mandir}/man8/turbostat*
 /usr/bin/cpupower
+/usr/bin/turbostat
 
 %files bench
 %defattr (-,root,root)

++++++ cpupower-3.8.tar.bz2 -> cpupower-3.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/Makefile new/cpupower-3.13/Makefile
--- old/cpupower-3.8/Makefile   2013-02-12 17:17:35.000000000 +0100
+++ new/cpupower-3.13/Makefile  2014-01-05 00:12:14.000000000 +0100
@@ -128,10 +128,12 @@
        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 \
+       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 \
        utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \
-       utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o
+       utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \
+       utils/cpuidle-set.o
 
 UTIL_SRC := $(UTIL_OBJS:.o=.c)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/debug/i386/intel_gsic.c 
new/cpupower-3.13/debug/i386/intel_gsic.c
--- old/cpupower-3.8/debug/i386/intel_gsic.c    2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/debug/i386/intel_gsic.c   2014-01-05 00:12:14.000000000 
+0100
@@ -66,7 +66,7 @@
                printf("ecx = 0x%.8x\n", r.ecx);
                printf("edx = 0x%.8x\n", r.edx);
                printf("Note also that some BIOS do not support the initial "
-                      "GSIC call, but the newer\nspeeedstep-smi driver may "
+                      "GSIC call, but the newer\nspeedstep-smi driver may "
                       "work.\nFor this, you need to pass some arguments to "
                       "the speedstep-smi driver:\n");
                printf("\tsmi_cmd=0x?? smi_port=0x?? smi_sig=1\n");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/man/cpupower-idle-info.1 
new/cpupower-3.13/man/cpupower-idle-info.1
--- old/cpupower-3.8/man/cpupower-idle-info.1   2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/man/cpupower-idle-info.1  2014-01-05 00:12:14.000000000 
+0100
@@ -87,4 +87,5 @@
 .fi
 .SH "SEE ALSO"
 .LP
-cpupower(1), cpupower\-monitor(1), cpupower\-info(1), cpupower\-set(1)
+cpupower(1), cpupower\-monitor(1), cpupower\-info(1), cpupower\-set(1),
+cpupower\-idle\-set(1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/man/cpupower-idle-set.1 
new/cpupower-3.13/man/cpupower-idle-set.1
--- old/cpupower-3.8/man/cpupower-idle-set.1    1970-01-01 01:00:00.000000000 
+0100
+++ new/cpupower-3.13/man/cpupower-idle-set.1   2014-01-05 00:12:14.000000000 
+0100
@@ -0,0 +1,71 @@
+.TH "CPUPOWER-IDLE-SET" "1" "0.1" "" "cpupower Manual"
+.SH "NAME"
+.LP
+cpupower idle\-set \- Utility to set cpu idle state specific kernel options
+.SH "SYNTAX"
+.LP
+cpupower [ \-c cpulist ] idle\-info [\fIoptions\fP]
+.SH "DESCRIPTION"
+.LP
+The cpupower idle\-set subcommand allows to set cpu idle, also called cpu
+sleep state, specific options offered by the kernel. One example is disabling
+sleep states. This can be handy for power vs performance tuning.
+.SH "OPTIONS"
+.LP
+.TP
+\fB\-d\fR \fB\-\-disable\fR
+Disable a specific processor sleep state.
+.TP
+\fB\-e\fR \fB\-\-enable\fR
+Enable a specific processor sleep state.
+
+.SH "REMARKS"
+.LP
+Cpuidle Governors Policy on Disabling Sleep States
+
+.RS 4
+Depending on the used  cpuidle governor, implementing the kernel policy
+how to choose sleep states, subsequent sleep states on this core, might get
+disabled as well.
+
+There are two cpuidle governors ladder and menu. While the ladder
+governor is always available, if CONFIG_CPU_IDLE is selected, the
+menu governor additionally requires CONFIG_NO_HZ.
+
+The behavior and the effect of the disable variable depends on the
+implementation of a particular governor. In the ladder governor, for
+example, it is not coherent, i.e. if one is disabling a light state,
+then all deeper states are disabled as well. Likewise, if one enables a
+deep state but a lighter state still is disabled, then this has no effect.
+.RE
+.LP
+Disabling the Lightest Sleep State may not have any Affect
+
+.RS 4
+If criteria are not met to enter deeper sleep states and the lightest sleep
+state is chosen when idle, the kernel may still enter this sleep state,
+irrespective of whether it is disabled or not. This is also reflected in
+the usage count of the disabled sleep state when using the cpupower idle-info
+command.
+.RE
+.LP
+Selecting specific CPU Cores
+
+.RS 4
+By default processor sleep states of all CPU cores are set. Please refer
+to the cpupower(1) manpage in the \-\-cpu option section how to disable
+C-states of specific cores.
+.RE
+.SH "FILES"
+.nf
+\fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP
+\fI/sys/devices/system/cpu/cpuidle/*\fP
+.fi
+.SH "AUTHORS"
+.nf
+Thomas Renninger <[email protected]>
+.fi
+.SH "SEE ALSO"
+.LP
+cpupower(1), cpupower\-monitor(1), cpupower\-info(1), cpupower\-set(1),
+cpupower\-idle\-info(1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/man/cpupower-monitor.1 
new/cpupower-3.13/man/cpupower-monitor.1
--- old/cpupower-3.8/man/cpupower-monitor.1     2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/man/cpupower-monitor.1    2014-01-05 00:12:14.000000000 
+0100
@@ -110,13 +110,21 @@
 kernel frequency driver periodically cleared aperf/mperf registers in those
 kernels.
 
-.SS "Nehalem" "SandyBridge"
+.SS "Nehalem" "SandyBridge" "HaswellExtended"
 Intel Core and Package sleep state counters.
 Threads (hyperthreaded cores) may not be able to enter deeper core states if
 its sibling is utilized.
 Deepest package sleep states may in reality show up as machine/platform wide
 sleep states and can only be entered if all cores are idle. Look up Intel
 manuals (some are provided in the References section) for further details.
+The monitors are named after the CPU family where the sleep state capabilities
+got introduced and may not match exactly the CPU name of the platform.
+For example an IvyBridge processor has sleep state capabilities which got
+introduced in Nehalem and SandyBridge processor families.
+Thus on an IvyBridge processor one will get Nehalem and SandyBridge sleep
+state monitors.
+HaswellExtended extra package sleep state capabilities are available only in a
+specific Haswell (family 0x45) and probably also other future processors.
 
 .SS "Fam_12h" "Fam_14h"
 AMD laptop and desktop processor (family 12h and 14h) sleep state counters.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/builtin.h 
new/cpupower-3.13/utils/builtin.h
--- old/cpupower-3.8/utils/builtin.h    2013-02-12 17:17:35.000000000 +0100
+++ new/cpupower-3.13/utils/builtin.h   2014-01-05 00:12:14.000000000 +0100
@@ -5,6 +5,7 @@
 extern int cmd_info(int argc, const char **argv);
 extern int cmd_freq_set(int argc, const char **argv);
 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);
 extern int cmd_monitor(int argc, const char **argv);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/cpuidle-info.c 
new/cpupower-3.13/utils/cpuidle-info.c
--- old/cpupower-3.8/utils/cpuidle-info.c       2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/utils/cpuidle-info.c      2014-01-05 00:12:14.000000000 
+0100
@@ -22,7 +22,7 @@
 
 static void cpuidle_cpu_output(unsigned int cpu, int verbose)
 {
-       int idlestates, idlestate;
+       unsigned int idlestates, idlestate;
        char *tmp;
 
        printf(_ ("Analyzing CPU %d:\n"), cpu);
@@ -31,10 +31,8 @@
        if (idlestates == 0) {
                printf(_("CPU %u: No idle states\n"), cpu);
                return;
-       } else if (idlestates <= 0) {
-               printf(_("CPU %u: Can't read idle state info\n"), cpu);
-               return;
        }
+
        printf(_("Number of idle states: %d\n"), idlestates);
        printf(_("Available idle states:"));
        for (idlestate = 0; idlestate < idlestates; idlestate++) {
@@ -50,10 +48,14 @@
                return;
 
        for (idlestate = 0; idlestate < idlestates; idlestate++) {
+               int disabled = sysfs_is_idlestate_disabled(cpu, idlestate);
+               /* Disabled interface not supported on older kernels */
+               if (disabled < 0)
+                       disabled = 0;
                tmp = sysfs_get_idlestate_name(cpu, idlestate);
                if (!tmp)
                        continue;
-               printf("%s:\n", tmp);
+               printf("%s%s:\n", tmp, (disabled) ? " (DISABLED) " : "");
                free(tmp);
 
                tmp = sysfs_get_idlestate_desc(cpu, idlestate);
@@ -98,21 +100,13 @@
 static void proc_cpuidle_cpu_output(unsigned int cpu)
 {
        long max_allowed_cstate = 2000000000;
-       int cstates, cstate;
+       unsigned int cstate, cstates;
 
        cstates = sysfs_get_idlestate_count(cpu);
        if (cstates == 0) {
-               /*
-                * Go on and print same useless info as you'd see with
-                * cat /proc/acpi/processor/../power
-                *      printf(_("CPU %u: No C-states available\n"), cpu);
-                *      return;
-                */
-       } else if (cstates <= 0) {
-               printf(_("CPU %u: Can't read C-state info\n"), cpu);
+               printf(_("CPU %u: No C-states info\n"), cpu);
                return;
        }
-       /* printf("Cstates: %d\n", cstates); */
 
        printf(_("active state:            C0\n"));
        printf(_("max_cstate:              C%u\n"), cstates-1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/cpuidle-set.c 
new/cpupower-3.13/utils/cpuidle-set.c
--- old/cpupower-3.8/utils/cpuidle-set.c        1970-01-01 01:00:00.000000000 
+0100
+++ new/cpupower-3.13/utils/cpuidle-set.c       2014-01-05 00:12:14.000000000 
+0100
@@ -0,0 +1,118 @@
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <getopt.h>
+
+#include "cpufreq.h"
+#include "helpers/helpers.h"
+#include "helpers/sysfs.h"
+
+static struct option info_opts[] = {
+       { .name = "disable",    .has_arg = required_argument,   .flag = NULL,   
.val = 'd'},
+       { .name = "enable",     .has_arg = required_argument,   .flag = NULL,   
.val = 'e'},
+       { },
+};
+
+
+int cmd_idle_set(int argc, char **argv)
+{
+       extern char *optarg;
+       extern int optind, opterr, optopt;
+       int ret = 0, cont = 1, param = 0, idlestate = 0;
+       unsigned int cpu = 0;
+
+       do {
+               ret = getopt_long(argc, argv, "d:e:", info_opts, NULL);
+               if (ret == -1)
+                       break;
+               switch (ret) {
+               case '?':
+                       param = '?';
+                       cont = 0;
+                       break;
+               case 'd':
+                       if (param) {
+                               param = -1;
+                               cont = 0;
+                               break;
+                       }
+                       param = ret;
+                       idlestate = atoi(optarg);
+                       break;
+               case 'e':
+                       if (param) {
+                               param = -1;
+                               cont = 0;
+                               break;
+                       }
+                       param = ret;
+                       idlestate = atoi(optarg);
+                       break;
+               case -1:
+                       cont = 0;
+                       break;
+               }
+       } while (cont);
+
+       switch (param) {
+       case -1:
+               printf(_("You can't specify more than one "
+                        "output-specific argument\n"));
+               exit(EXIT_FAILURE);
+       case '?':
+               printf(_("invalid or unknown argument\n"));
+               exit(EXIT_FAILURE);
+       }
+
+       /* Default is: set all CPUs */
+       if (bitmask_isallclear(cpus_chosen))
+               bitmask_setall(cpus_chosen);
+
+       for (cpu = bitmask_first(cpus_chosen);
+            cpu <= bitmask_last(cpus_chosen); cpu++) {
+
+               if (!bitmask_isbitset(cpus_chosen, cpu))
+                       continue;
+
+               switch (param) {
+
+               case 'd':
+                       ret = sysfs_idlestate_disable(cpu, idlestate, 1);
+                       if (ret == 0)
+               printf(_("Idlestate %u disabled on CPU %u\n"),  idlestate, cpu);
+                       else if (ret == -1)
+               printf(_("Idlestate %u not available on CPU %u\n"),
+                      idlestate, cpu);
+                       else if (ret == -2)
+               printf(_("Idlestate disabling not supported by kernel\n"));
+                       else
+               printf(_("Idlestate %u not disabled on CPU %u\n"),
+                      idlestate, cpu);
+                       break;
+               case 'e':
+                       ret = sysfs_idlestate_disable(cpu, idlestate, 0);
+                       if (ret == 0)
+               printf(_("Idlestate %u enabled on CPU %u\n"),  idlestate, cpu);
+                       else if (ret == -1)
+               printf(_("Idlestate %u not available on CPU %u\n"),
+                      idlestate, cpu);
+                       else if (ret == -2)
+               printf(_("Idlestate enabling not supported by kernel\n"));
+                       else
+               printf(_("Idlestate %u not enabled on CPU %u\n"),
+                      idlestate, cpu);
+                       break;
+               default:
+                       /* Not reachable with proper args checking */
+                       printf(_("Invalid or unknown argument\n"));
+                       exit(EXIT_FAILURE);
+                       break;
+               }
+       }
+       return EXIT_SUCCESS;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/cpupower-set.c 
new/cpupower-3.13/utils/cpupower-set.c
--- old/cpupower-3.8/utils/cpupower-set.c       2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/utils/cpupower-set.c      2014-01-05 00:12:14.000000000 
+0100
@@ -18,9 +18,9 @@
 #include "helpers/bitmask.h"
 
 static struct option set_opts[] = {
-       { .name = "perf-bias",  .has_arg = optional_argument,   .flag = NULL,   
.val = 'b'},
-       { .name = "sched-mc",   .has_arg = optional_argument,   .flag = NULL,   
.val = 'm'},
-       { .name = "sched-smt",  .has_arg = optional_argument,   .flag = NULL,   
.val = 's'},
+       { .name = "perf-bias",  .has_arg = required_argument,   .flag = NULL,   
.val = 'b'},
+       { .name = "sched-mc",   .has_arg = required_argument,   .flag = NULL,   
.val = 'm'},
+       { .name = "sched-smt",  .has_arg = required_argument,   .flag = NULL,   
.val = 's'},
        { },
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/cpupower.c 
new/cpupower-3.13/utils/cpupower.c
--- old/cpupower-3.8/utils/cpupower.c   2013-02-12 17:17:35.000000000 +0100
+++ new/cpupower-3.13/utils/cpupower.c  2014-01-05 00:12:14.000000000 +0100
@@ -17,12 +17,6 @@
 #include "helpers/helpers.h"
 #include "helpers/bitmask.h"
 
-struct cmd_struct {
-       const char *cmd;
-       int (*main)(int, const char **);
-       int needs_root;
-};
-
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
 static int cmd_help(int argc, const char **argv);
@@ -43,10 +37,17 @@
 
 static void print_help(void);
 
+struct cmd_struct {
+       const char *cmd;
+       int (*main)(int, const char **);
+       int needs_root;
+};
+
 static struct cmd_struct commands[] = {
        { "frequency-info",     cmd_freq_info,  0       },
        { "frequency-set",      cmd_freq_set,   1       },
        { "idle-info",          cmd_idle_info,  0       },
+       { "idle-set",           cmd_idle_set,   1       },
        { "set",                cmd_set,        1       },
        { "info",               cmd_info,       0       },
        { "monitor",            cmd_monitor,    0       },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/helpers/sysfs.c 
new/cpupower-3.13/utils/helpers/sysfs.c
--- old/cpupower-3.8/utils/helpers/sysfs.c      2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/utils/helpers/sysfs.c     2014-01-05 00:12:14.000000000 
+0100
@@ -89,6 +89,33 @@
 
 /* CPUidle idlestate specific /sys/devices/system/cpu/cpuX/cpuidle/ access */
 
+
+/* CPUidle idlestate specific /sys/devices/system/cpu/cpuX/cpuidle/ access */
+
+/*
+ * helper function to check whether a file under "../cpuX/cpuidle/stateX/" dir
+ * exists.
+ * For example the functionality to disable c-states was introduced in later
+ * kernel versions, this function can be used to explicitly check for this
+ * feature.
+ *
+ * returns 1 if the file exists, 0 otherwise.
+ */
+unsigned int sysfs_idlestate_file_exists(unsigned int cpu,
+                                        unsigned int idlestate,
+                                        const char *fname)
+{
+       char path[SYSFS_PATH_MAX];
+       struct stat statbuf;
+
+
+       snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s",
+                cpu, idlestate, fname);
+       if (stat(path, &statbuf) != 0)
+               return 0;
+       return 1;
+}
+
 /*
  * helper function to read file from /sys into given buffer
  * fname is a relative path under "cpuX/cpuidle/stateX/" dir
@@ -121,6 +148,40 @@
        return (unsigned int) numread;
 }
 
+/* 
+ * helper function to write a new value to a /sys file
+ * fname is a relative path under "../cpuX/cpuidle/cstateY/" dir
+ *
+ * Returns the number of bytes written or 0 on error
+ */
+static
+unsigned int sysfs_idlestate_write_file(unsigned int cpu,
+                                       unsigned int idlestate,
+                                       const char *fname,
+                                       const char *value, size_t len)
+{
+       char path[SYSFS_PATH_MAX];
+       int fd;
+       ssize_t numwrite;
+
+       snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s",
+                cpu, idlestate, fname);
+
+       fd = open(path, O_WRONLY);
+       if (fd == -1)
+               return 0;
+
+       numwrite = write(fd, value, len);
+       if (numwrite < 1) {
+               close(fd);
+               return 0;
+       }
+
+       close(fd);
+
+       return (unsigned int) numwrite;
+}
+
 /* read access to files which contain one numeric value */
 
 enum idlestate_value {
@@ -128,6 +189,7 @@
        IDLESTATE_POWER,
        IDLESTATE_LATENCY,
        IDLESTATE_TIME,
+       IDLESTATE_DISABLE,
        MAX_IDLESTATE_VALUE_FILES
 };
 
@@ -136,6 +198,7 @@
        [IDLESTATE_POWER] = "power",
        [IDLESTATE_LATENCY] = "latency",
        [IDLESTATE_TIME]  = "time",
+       [IDLESTATE_DISABLE]  = "disable",
 };
 
 static unsigned long long sysfs_idlestate_get_one_value(unsigned int cpu,
@@ -205,8 +268,59 @@
        return result;
 }
 
+/*
+ * Returns:
+ *    1  if disabled
+ *    0  if enabled
+ *    -1 if idlestate is not available
+ *    -2 if disabling is not supported by the kernel
+ */
+int sysfs_is_idlestate_disabled(unsigned int cpu,
+                               unsigned int idlestate)
+{
+       if (sysfs_get_idlestate_count(cpu) <= idlestate)
+               return -1;
+
+       if (!sysfs_idlestate_file_exists(cpu, idlestate,
+                                idlestate_value_files[IDLESTATE_DISABLE]))
+               return -2;
+       return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_DISABLE);
+}
+
+/*
+ * Pass 1 as last argument to disable or 0 to enable the state
+ * Returns:
+ *    0  on success
+ *    negative values on error, for example:
+ *      -1 if idlestate is not available
+ *      -2 if disabling is not supported by the kernel
+ *      -3 No write access to disable/enable C-states
+ */
+int sysfs_idlestate_disable(unsigned int cpu,
+                           unsigned int idlestate,
+                           unsigned int disable)
+{
+       char value[SYSFS_PATH_MAX];
+       int bytes_written;
+
+       if (sysfs_get_idlestate_count(cpu) <= idlestate)
+               return -1;
+
+       if (!sysfs_idlestate_file_exists(cpu, idlestate,
+                                idlestate_value_files[IDLESTATE_DISABLE]))
+               return -2;
+
+       snprintf(value, SYSFS_PATH_MAX, "%u", disable);
+
+       bytes_written = sysfs_idlestate_write_file(cpu, idlestate, "disable",
+                                                  value, sizeof(disable));
+       if (bytes_written)
+               return 0;
+       return -3;
+}
+
 unsigned long sysfs_get_idlestate_latency(unsigned int cpu,
-                                       unsigned int idlestate)
+                                         unsigned int idlestate)
 {
        return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_LATENCY);
 }
@@ -238,7 +352,7 @@
  * Negativ in error case
  * Zero if cpuidle does not export any C-states
  */
-int sysfs_get_idlestate_count(unsigned int cpu)
+unsigned int sysfs_get_idlestate_count(unsigned int cpu)
 {
        char file[SYSFS_PATH_MAX];
        struct stat statbuf;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/helpers/sysfs.h 
new/cpupower-3.13/utils/helpers/sysfs.h
--- old/cpupower-3.8/utils/helpers/sysfs.h      2013-02-12 17:17:35.000000000 
+0100
+++ new/cpupower-3.13/utils/helpers/sysfs.h     2014-01-05 00:12:14.000000000 
+0100
@@ -7,8 +7,16 @@
 
 extern unsigned int sysfs_read_file(const char *path, char *buf, size_t 
buflen);
 
+extern unsigned int sysfs_idlestate_file_exists(unsigned int cpu,
+                                               unsigned int idlestate,
+                                               const char *fname);
+
 extern int sysfs_is_cpu_online(unsigned int cpu);
 
+extern int sysfs_is_idlestate_disabled(unsigned int cpu,
+                                      unsigned int idlestate);
+extern int sysfs_idlestate_disable(unsigned int cpu, unsigned int idlestate,
+                                  unsigned int disable);
 extern unsigned long sysfs_get_idlestate_latency(unsigned int cpu,
                                                unsigned int idlestate);
 extern unsigned long sysfs_get_idlestate_usage(unsigned int cpu,
@@ -19,7 +27,7 @@
                                unsigned int idlestate);
 extern char *sysfs_get_idlestate_desc(unsigned int cpu,
                                unsigned int idlestate);
-extern int sysfs_get_idlestate_count(unsigned int cpu);
+extern unsigned int sysfs_get_idlestate_count(unsigned int cpu);
 
 extern char *sysfs_get_cpuidle_governor(void);
 extern char *sysfs_get_cpuidle_driver(void);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/idle_monitor/hsw_ext_idle.c 
new/cpupower-3.13/utils/idle_monitor/hsw_ext_idle.c
--- old/cpupower-3.8/utils/idle_monitor/hsw_ext_idle.c  1970-01-01 
01:00:00.000000000 +0100
+++ new/cpupower-3.13/utils/idle_monitor/hsw_ext_idle.c 2014-01-05 
00:12:14.000000000 +0100
@@ -0,0 +1,196 @@
+/*
+ *  (C) 2010,2011       Thomas Renninger <[email protected]>, Novell Inc.
+ *
+ *  Licensed under the terms of the GNU GPL License version 2.
+ *
+ *  Based on SandyBridge monitor. Implements the new package C-states
+ *  (PC8, PC9, PC10) coming with a specific Haswell (family 0x45) CPU.
+ */
+
+#if defined(__i386__) || defined(__x86_64__)
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "helpers/helpers.h"
+#include "idle_monitor/cpupower-monitor.h"
+
+#define MSR_PKG_C8_RESIDENCY           0x00000630
+#define MSR_PKG_C9_RESIDENCY           0x00000631
+#define MSR_PKG_C10_RESIDENCY          0x00000632
+
+#define MSR_TSC        0x10
+
+enum intel_hsw_ext_id { PC8 = 0, PC9, PC10, HSW_EXT_CSTATE_COUNT,
+                       TSC = 0xFFFF };
+
+static int hsw_ext_get_count_percent(unsigned int self_id, double *percent,
+                                unsigned int cpu);
+
+static cstate_t hsw_ext_cstates[HSW_EXT_CSTATE_COUNT] = {
+       {
+               .name                   = "PC8",
+               .desc                   = N_("Processor Package C8"),
+               .id                     = PC8,
+               .range                  = RANGE_PACKAGE,
+               .get_count_percent      = hsw_ext_get_count_percent,
+       },
+       {
+               .name                   = "PC9",
+               .desc                   = N_("Processor Package C9"),
+               .desc                   = N_("Processor Package C2"),
+               .id                     = PC9,
+               .range                  = RANGE_PACKAGE,
+               .get_count_percent      = hsw_ext_get_count_percent,
+       },
+       {
+               .name                   = "PC10",
+               .desc                   = N_("Processor Package C10"),
+               .id                     = PC10,
+               .range                  = RANGE_PACKAGE,
+               .get_count_percent      = hsw_ext_get_count_percent,
+       },
+};
+
+static unsigned long long tsc_at_measure_start;
+static unsigned long long tsc_at_measure_end;
+static unsigned long long *previous_count[HSW_EXT_CSTATE_COUNT];
+static unsigned long long *current_count[HSW_EXT_CSTATE_COUNT];
+/* valid flag for all CPUs. If a MSR read failed it will be zero */
+static int *is_valid;
+
+static int hsw_ext_get_count(enum intel_hsw_ext_id id, unsigned long long *val,
+                       unsigned int cpu)
+{
+       int msr;
+
+       switch (id) {
+       case PC8:
+               msr = MSR_PKG_C8_RESIDENCY;
+               break;
+       case PC9:
+               msr = MSR_PKG_C9_RESIDENCY;
+               break;
+       case PC10:
+               msr = MSR_PKG_C10_RESIDENCY;
+               break;
+       case TSC:
+               msr = MSR_TSC;
+               break;
+       default:
+               return -1;
+       };
+       if (read_msr(cpu, msr, val))
+               return -1;
+       return 0;
+}
+
+static int hsw_ext_get_count_percent(unsigned int id, double *percent,
+                                unsigned int cpu)
+{
+       *percent = 0.0;
+
+       if (!is_valid[cpu])
+               return -1;
+
+       *percent = (100.0 *
+               (current_count[id][cpu] - previous_count[id][cpu])) /
+               (tsc_at_measure_end - tsc_at_measure_start);
+
+       dprint("%s: previous: %llu - current: %llu - (%u)\n",
+               hsw_ext_cstates[id].name, previous_count[id][cpu],
+               current_count[id][cpu], cpu);
+
+       dprint("%s: tsc_diff: %llu - count_diff: %llu - percent: %2.f (%u)\n",
+              hsw_ext_cstates[id].name,
+              (unsigned long long) tsc_at_measure_end - tsc_at_measure_start,
+              current_count[id][cpu] - previous_count[id][cpu],
+              *percent, cpu);
+
+       return 0;
+}
+
+static int hsw_ext_start(void)
+{
+       int num, cpu;
+       unsigned long long val;
+
+       for (num = 0; num < HSW_EXT_CSTATE_COUNT; num++) {
+               for (cpu = 0; cpu < cpu_count; cpu++) {
+                       hsw_ext_get_count(num, &val, cpu);
+                       previous_count[num][cpu] = val;
+               }
+       }
+       hsw_ext_get_count(TSC, &tsc_at_measure_start, 0);
+       return 0;
+}
+
+static int hsw_ext_stop(void)
+{
+       unsigned long long val;
+       int num, cpu;
+
+       hsw_ext_get_count(TSC, &tsc_at_measure_end, 0);
+
+       for (num = 0; num < HSW_EXT_CSTATE_COUNT; num++) {
+               for (cpu = 0; cpu < cpu_count; cpu++) {
+                       is_valid[cpu] = !hsw_ext_get_count(num, &val, cpu);
+                       current_count[num][cpu] = val;
+               }
+       }
+       return 0;
+}
+
+struct cpuidle_monitor intel_hsw_ext_monitor;
+
+static struct cpuidle_monitor *hsw_ext_register(void)
+{
+       int num;
+
+       if (cpupower_cpu_info.vendor != X86_VENDOR_INTEL
+           || cpupower_cpu_info.family != 6)
+               return NULL;
+
+       switch (cpupower_cpu_info.model) {
+       case 0x45: /* HSW */
+               break;
+       default:
+               return NULL;
+       }
+
+       is_valid = calloc(cpu_count, sizeof(int));
+       for (num = 0; num < HSW_EXT_CSTATE_COUNT; num++) {
+               previous_count[num] = calloc(cpu_count,
+                                       sizeof(unsigned long long));
+               current_count[num]  = calloc(cpu_count,
+                                       sizeof(unsigned long long));
+       }
+       intel_hsw_ext_monitor.name_len = strlen(intel_hsw_ext_monitor.name);
+       return &intel_hsw_ext_monitor;
+}
+
+void hsw_ext_unregister(void)
+{
+       int num;
+       free(is_valid);
+       for (num = 0; num < HSW_EXT_CSTATE_COUNT; num++) {
+               free(previous_count[num]);
+               free(current_count[num]);
+       }
+}
+
+struct cpuidle_monitor intel_hsw_ext_monitor = {
+       .name                   = "HaswellExtended",
+       .hw_states              = hsw_ext_cstates,
+       .hw_states_num          = HSW_EXT_CSTATE_COUNT,
+       .start                  = hsw_ext_start,
+       .stop                   = hsw_ext_stop,
+       .do_register            = hsw_ext_register,
+       .unregister             = hsw_ext_unregister,
+       .needs_root             = 1,
+       .overflow_s             = 922000000 /* 922337203 seconds TSC overflow
+                                              at 20GHz */
+};
+#endif /* defined(__i386__) || defined(__x86_64__) */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/idle_monitor/idle_monitors.def 
new/cpupower-3.13/utils/idle_monitor/idle_monitors.def
--- old/cpupower-3.8/utils/idle_monitor/idle_monitors.def       2013-02-12 
17:17:35.000000000 +0100
+++ new/cpupower-3.13/utils/idle_monitor/idle_monitors.def      2014-01-05 
00:12:14.000000000 +0100
@@ -2,6 +2,7 @@
 DEF(amd_fam14h)
 DEF(intel_nhm)
 DEF(intel_snb)
+DEF(intel_hsw_ext)
 DEF(mperf)
 #endif
 DEF(cpuidle_sysfs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpupower-3.8/utils/idle_monitor/snb_idle.c 
new/cpupower-3.13/utils/idle_monitor/snb_idle.c
--- old/cpupower-3.8/utils/idle_monitor/snb_idle.c      2013-02-12 
17:17:35.000000000 +0100
+++ new/cpupower-3.13/utils/idle_monitor/snb_idle.c     2014-01-05 
00:12:14.000000000 +0100
@@ -155,6 +155,10 @@
        case 0x2D: /* SNB Xeon */
        case 0x3A: /* IVB */
        case 0x3E: /* IVB Xeon */
+       case 0x3C: /* HSW */
+       case 0x3F: /* HSW */
+       case 0x45: /* HSW */
+       case 0x46: /* HSW */
                break;
        default:
                return NULL;

++++++ cpupower_export_tarball_from_git.sh ++++++
--- /var/tmp/diff_new_pack.QquB7V/_old  2014-02-06 06:47:24.000000000 +0100
+++ /var/tmp/diff_new_pack.QquB7V/_new  2014-02-06 06:47:24.000000000 +0100
@@ -5,19 +5,21 @@
 # the General Public Licence v2
 
 function usage(){
-    echo "$(basename $0) [ git_tag ]"
+    echo "$(basename $0) [ git_tag [ tag_to_use ] ]"
     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"
-    echo "          may produce a package incompatible tarball name"
-    echo "          BEST ALWAYS PASS AN EXISTING TAG"
-    echo "          cpupower got introduced in 3.1-rc1"
+    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"
+    echo "            may produce a package incompatible tarball name"
+    echo "            BEST ALWAYS PASS AN EXISTING TAG"
+    echo "            cpupower got introduced in 3.1-rc1"
+    echo "tag_to_use  obs does not like -rcX as a version tag. Pass a verion"
+    echo "            tag you like to use (e.g. 3.13 instead of 3.13-rc7"
     echo
     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"
 }
 
-if [ $# -eq 1 ];then
+if [ $# -gt 0 ];then
     if [ "$1" = "-h" ] || [ "$1" == "--help" ];then
        usage
        exit 0
@@ -25,9 +27,18 @@
     GIT_TAG="$1"
     echo "Exporting cpupower from kernel version $GIT_TAG"
     # convert - to . as package versions do not allow -
-    VERSION="${GIT_TAG/-/.}"
-    # remove leading v
-    VERSION="-${VERSION#v}"
+    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
 else
     GIT_TAG="HEAD"
     VERSION=""
@@ -43,7 +54,19 @@
 mv tools/power/cpupower cpupower${VERSION}
 tar -cvjf cpupower${VERSION}.tar.bz2 cpupower${VERSION}
 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
+cp "${GIT_DIR}"/../arch/x86/include/uapi/asm/msr-index.h 
turbostat${VERSION}/asm
+tar -cvjf turbostat${VERSION}.tar.bz2 turbostat${VERSION}
+popd
 mv "$DIR/cpupower${VERSION}".tar.bz2 .
 rm -rf "$DIR"
+mv "$TDIR/turbostat${VERSION}".tar.bz2 .
+rm -rf "$TDIR"
 # set +x
-echo cpupower${VERSION}.tar.bz2
\ No newline at end of file
+echo cpupower${VERSION}.tar.bz2
+echo turbostat${VERSION}.tar.bz2

++++++ turbostat_fix_man_perm.patch ++++++
Index: turbostat-3.13/Makefile
===================================================================
--- turbostat-3.13.orig/Makefile
+++ turbostat-3.13/Makefile
@@ -19,4 +19,4 @@ 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
+       install -m 0644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to