1. 02 2月, 2014 2 次提交
  2. 24 1月, 2014 3 次提交
  3. 21 1月, 2014 8 次提交
  4. 19 1月, 2014 11 次提交
    • D
      turbostat: Add option to report joules consumed per sample · 5c56be9a
      Dirk Brandewie 提交于
      Add "-J" option to report energy consumed in joules per sample.  This option
      also adds the sample time to the reported values.
      Signed-off-by: NDirk Brandewie <dirk.j.brandewie@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      5c56be9a
    • L
      turbostat: run on HSX · e6f9bb3c
      Len Brown 提交于
      Haswell Xeon has slightly different RAPL support than client HSW,
      which prevented the previous version of turbostat from running on HSX.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      e6f9bb3c
    • J
    • J
      turbostat: Clean up error handling; disambiguate error messages; use err and errx · b2c95d90
      Josh Triplett 提交于
      Most of turbostat's error handling consists of printing an error (often
      including an errno) and exiting.  Since perror doesn't support a format
      string, those error messages are often ambiguous, such as just showing a
      file path, which doesn't uniquely identify which call failed.
      
      turbostat already uses _GNU_SOURCE, so switch to the err and errx
      functions from err.h, which take a format string.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b2c95d90
    • J
      turbostat: Factor out common function to open file and exit on failure · 57a42a34
      Josh Triplett 提交于
      Several different functions in turbostat contain the same pattern of
      opening a file and exiting on failure.  Factor out a common fopen_or_die
      function for that.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      57a42a34
    • J
      turbostat: Add a helper to parse a single int out of a file · 95aebc44
      Josh Triplett 提交于
      Many different chunks of code in turbostat open a file, parse a single
      int out of it, and close it.  Factor that out into a common function.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      95aebc44
    • J
      turbostat: Check return value of fscanf · 74823419
      Josh Triplett 提交于
      Some systems declare fscanf with the warn_unused_result attribute.  On
      such systems, turbostat generates the following warnings:
      
      turbostat.c: In function 'get_core_id':
      turbostat.c:1203:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
      turbostat.c: In function 'get_physical_package_id':
      turbostat.c:1186:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
      turbostat.c: In function 'cpu_is_first_core_in_package':
      turbostat.c:1169:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
      turbostat.c: In function 'cpu_is_first_sibling_in_core':
      turbostat.c:1148:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
      
      Fix these by checking the return value of those four calls to fscanf.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      74823419
    • J
      turbostat: Use GCC's CPUID functions to support PIC · 2b92865e
      Josh Triplett 提交于
      turbostat uses inline assembly to call cpuid.  On 32-bit x86, on systems
      that have certain security features enabled by default that make -fPIC
      the default, this causes a build error:
      
      turbostat.c: In function ‘check_cpuid’:
      turbostat.c:1906:2: error: PIC register clobbered by ‘ebx’ in ‘asm’
        asm("cpuid" : "=a" (fms), "=c" (ecx), "=d" (edx) : "a" (1) : "ebx");
        ^
      
      GCC provides a header cpuid.h, containing a __get_cpuid function that
      works with both PIC and non-PIC.  (On PIC, it saves and restores ebx
      around the cpuid instruction.)  Use that instead.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLen Brown <len.brown@intel.com>
      2b92865e
    • J
      turbostat: Don't attempt to printf an off_t with %zx · 2e9c6bc7
      Josh Triplett 提交于
      turbostat uses the format %zx to print an off_t.  However, %zx wants a
      size_t, not an off_t.  On 32-bit targets, those refer to different
      types, potentially even with different sizes.  Use %llx and a cast
      instead, since printf does not have a length modifier for off_t.
      
      Without this patch, when compiling for a 32-bit target:
      
      turbostat.c: In function 'get_msr':
      turbostat.c:231:3: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'off_t' [-Wformat]
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      2e9c6bc7
    • J
      turbostat: Don't put unprocessed uapi headers in the include path · b731f311
      Josh Triplett 提交于
      turbostat's Makefile puts arch/x86/include/uapi/ in the include path, so
      that it can include <asm/msr.h> from it.  It isn't in general safe to
      include even uapi headers directly from the kernel tree without
      processing them through scripts/headers_install.sh, but asm/msr.h
      happens to work.
      
      However, that include path can break with some versions of system
      headers, by overriding some system headers with the unprocessed versions
      directly from the kernel source.  For instance:
      
      In file included from /build/x86-generic/usr/include/bits/sigcontext.h:28:0,
                       from /build/x86-generic/usr/include/signal.h:339,
                       from /build/x86-generic/usr/include/sys/wait.h:31,
                       from turbostat.c:27:
      ../../../../arch/x86/include/uapi/asm/sigcontext.h:4:28: fatal error: linux/compiler.h: No such file or directory
      
      This occurs because the system bits/sigcontext.h on that build system
      includes <asm/sigcontext.h>, and asm/sigcontext.h in the kernel source
      includes <linux/compiler.h>, which scripts/headers_install.sh would have
      filtered out.
      
      Since turbostat really only wants a single header, just include that one
      header rather than putting an entire directory of kernel headers on the
      include path.
      
      In the process, switch from msr.h to msr-index.h, since turbostat just
      wants the MSR numbers.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b731f311
    • S
      ktest: Add BISECT_TRIES to bisect test · 961d9cac
      Steven Rostedt (Red Hat) 提交于
      For those cases that it takes several tries to hit a bug, it would be
      useful for ktest.pl to try a test multiple times before it considers
      the test as a pass. To accomplish this, BISECT_TRIES ktest config
      option has been added. It is default to one, as most of the time a
      bisect only needs to try a test once. But the user can now up this
      to make ktest run a given test multiple times. The first failure
      that is detected will set a bisect bad. It only repeats on success.
      
      Note, as with all race bugs, there's no guarantee that if it succeeds,
      it is really a good bisect. But it helps in case the bug is somewhat
      reliable.
      
      You can set BISECT_TRIES to zero, and all tests will be considered
      good, unless you also set BISECT_MANUAL.
      Suggested-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      961d9cac
  5. 17 1月, 2014 16 次提交