1. 18 6月, 2015 2 次提交
  2. 28 5月, 2015 5 次提交
  3. 19 4月, 2015 7 次提交
  4. 14 4月, 2015 3 次提交
  5. 11 2月, 2015 1 次提交
  6. 10 2月, 2015 6 次提交
    • L
      tools/power turbostat: update parameters, documentation · d8af6f5f
      Len Brown 提交于
      Long format options added, though the short ones should still work.
      eg. the new "--Counter 0x10" is the same as the old "-C 0x10"
      
      Note this Incompatibility:
      Old:
      -v displayed verbose debug output
      
      New:
      -v and --version simpaly display version
      
      Additional parameters:
      -d and --debug display verbose debug output
      -h and --help display a help message
      
      Updated turbosat.8 man page accordingly.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d8af6f5f
    • L
      tools/power turbostat: Skip printing disabled package C-states · ee7e38e3
      Len Brown 提交于
      Replaced previously open-coded Package C-state Limit decoding
      with table-driven decoding.  In doing so, updated to match January 2015
      "Intel(R) 64 and IA-23 Architectures Software Developer's Manual".
      
      In the past, turbostat would print package C-state residency columns
      for all package states supported by the model's architecture, even though
      a particular SKU may not support them, or they may be disabled by the BIOS.
      Now turbostat will skip printing colunns if MSRs indicate that they are not enabled.
      eg. many SKUs don't support PC7, and so that column will no longer be printed.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      ee7e38e3
    • L
      tools/power turbostat: relax dependency on APERF_MSR · a729617c
      Len Brown 提交于
      While turbostat is significantly less useful on systems
      with no APERF_MSR, it seems more friendly
      to run on such systems and report what we can,
      rather than refusing to run.
      
      Update man page to reflect recent changes.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      a729617c
    • L
      tools/power turbostat: relax dependency on invariant TSC · d7899447
      Len Brown 提交于
      Turbostat can be useful on systems that do not support invariant TSC,
      so allow it to run on those systgems.
      
      All arithmetic in turbostat using the TSC value is per-processsor,
      so it does not depend on the TSC values being in sync acrosss processors.
      
      Turbostat uses gettimeofday() for the measurement interval
      rather than using the TSC directly, so that key metric
      is also immune from variable TSC.
      
      Turbostat prints a TSC sanity check column:
      
      TSC_MHz = TSC_delta/interval
      
      If this column is constant and is close to the processor
      base frequency, then the TSC is behaving properly.
      
      The other key turbostat columns are calculated this way:
      
      Avg_Mhz = APERF_delta/interval
      
      %Busy = MPERF_delta/TSC_delta
      
      Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/interval
      
      Tested on Core2 and Core2-Xeon, and so this patch includes
      a few other changes to remove the assumption that target
      systems are Nehalem and newer.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d7899447
    • L
      tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS · 3a9a941d
      Len Brown 提交于
      The Processor generation code-named Haswell
      added MSR_{CORE | GFX | RING}_PERF_LIMIT_REASONS
      to explain when and how the processor limits frequency.
      
      turbostat -v
      will now decode these bits.
      
      Each MSR has an "Active" set of bits which describe
      current conditions, and a "Logged" set of bits,
      which describe what has happened since last cleared.
      
      Turbostat currently doesn't clear the log bits.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      3a9a941d
    • L
      tools/power turbostat: relax dependency on root permission · 98481e79
      Len Brown 提交于
      For turbostat to run as non-root, it needs to permissions:
      
      1. read access to /dev/cpu/*/msr
      	via standard user/group/world file permissions
      
      2. CAP_SYS_RAWIO
      	eg.  # setcap cap_sys_rawio=ep turbostat
      
      Yes, running as root still works.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      98481e79
  7. 16 8月, 2014 1 次提交
  8. 07 5月, 2014 1 次提交
    • J
      tools / power: turbostat: Drop temperature checks · 3482124a
      Jean Delvare 提交于
      The Intel 64 and IA-32 Architectures Software Developer's Manual says
      that TjMax is stored in bits 23:16 of MSR_TEMPERATURE TARGET (0x1a2).
      That's 8 bits, not 7, so it must be masked with 0xFF rather than 0x7F.
      
      The manual has no mention of which values should be considered valid,
      which kind of implies that they all are. Arbitrarily discarding values
      outside a specific range is wrong. The upper range check had to be
      fixed recently (commit 144b44b1) and the lower range check is just as
      wrong. See bug #75071:
      
      https://bugzilla.kernel.org/show_bug.cgi?id=75071
      
      There are many Xeon processor series with TjMax of 70, 71 or 80
      degrees Celsius, way below the arbitrary 85 degrees Celsius limit.
      There may be other (past or future) models with even lower limits.
      
      So drop this arbitrary check. The only value that would be clearly
      invalid is 0. Everything else should be accepted.
      
      After these changes, turbostat is aligned with what the coretemp
      driver does.
      Signed-off-by: NJean Delvare <jdelvare@suse.de>
      Cc: Len Brown <len.brown@intel.com>
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3482124a
  9. 06 3月, 2014 2 次提交
    • L
      tools/power turbostat: Run on Broadwell · 4e8e863f
      Len Brown 提交于
      Signed-off-by: NLen Brown <len.brown@intel.com>
      4e8e863f
    • L
      tools/power turbostat: simplify output, add Avg_MHz · fc04cc67
      Len Brown 提交于
      Use 8 columns for each number ouput.
      We don't fit into 80 columns on most machines,
      so keep the format simple.
      
      Print frequency in MHz instead of GHz.
      We've got 8 columns now, so use them to
      show low frequency in a more natural unit.
      
      Many users didn't understand what %c0 meant,
      so re-name it to be %Busy.
      
      Add Avg_MHz column, which is the frequency that many
      users expect to see -- the total number of cycles executed
      over the measurement interval.
      
      People found the previous GHz to be confusing, since
      it was the speed only over the non-idle interval.
      That measurement has been re-named Bzy_MHz.
      
      Suggested-by: Dirk J. Brandewie
      Signed-off-by: NLen Brown <len.brown@intel.com>
      fc04cc67
  10. 02 2月, 2014 2 次提交
  11. 19 1月, 2014 9 次提交
    • 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
      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
  12. 13 11月, 2013 1 次提交
    • L
      tools / power turbostat: Support Silvermont · 144b44b1
      Len Brown 提交于
      Support the next generation Intel Atom processor
      mirco-architecture, formerly called Silvermont.
      
      The server version, formerly called "Avoton",
      is named the "Intel(R) Atom(TM) Processor C2000 Product Family".
      
      The client version, formerly called "Bay Trail",
      is named the "Intel Atom Processor Z3000 Series",
      as well as various "Intel Pentium Processor"
      and "Intel Celeron Processor" brands, depending
      on form-factor.
      
      Silvermont has a set of MSRs not far off from NHM,
      but the RAPL register set is a sub-set of those previously supported.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      144b44b1