1. 01 12月, 2016 2 次提交
    • L
      tools/power turbostat: Gracefully handle ACPI S3 · ba3dec99
      Len Brown 提交于
      turbostat gives valid results across suspend to idle, aka freeze,
      whether invoked in  interval mode, or in command mode.
      Indeed, this can be used to measure suspend to idle:
      
      turbostat echo freeze > /sys/power/state
      
      But this does not work across suspend to ACPI S3, because the
      processor counters, including the TSC, are reset on resume.
      Further, when turbostat detects a problem, it does't forgive
      the hardware, and interval mode will print *'s from there on out.
      
      Instead, upon detecting counters going backwards, simply
      reset and start over.
      
      Interval mode across ACPI S3: (observe TSC going backwards)
      
      root@sharkbay:/home/lenb/turbostat-src# ./turbostat -M 0x10
           CPU Avg_MHz   Busy% Bzy_MHz TSC_MHz           MSR 0x010
             -       1    0.06     858    2294  0x0000000000000000
             0       0    0.06     847    2294  0x0000002a254b98ac
             1       1    0.06     878    2294  0x0000002a254efa3a
             2       1    0.07     843    2294  0x0000002a2551df65
             3       0    0.05     863    2294  0x0000002a2553fea2
      turbostat: re-initialized with num_cpus 4
           CPU Avg_MHz   Busy% Bzy_MHz TSC_MHz           MSR 0x010
             -       2    0.20     849    2294  0x0000000000000000
             0       2    0.26     856    2294  0x0000000449abb60d
             1       2    0.20     844    2294  0x0000000449b087ec
             2       2    0.21     850    2294  0x0000000449b35d5d
             3       1    0.12     839    2294  0x0000000449b5fd5a
      ^C
      
      Command mode across ACPI S3:
      root@sharkbay:/home/lenb/turbostat-src# ./turbostat -M 0x10 sleep 10
      ./turbostat: Counter reset detected
      14.196299 sec
      Signed-off-by: NLen Brown <len.brown@intel.com>
      ba3dec99
    • L
      tools/power turbostat: tidy up output on Joule counter overflow · e975db5d
      Len Brown 提交于
      The RAPL Joules counter is limited in capacity.
      Turbostat estimates how soon it can roll-over
      based on the max TDP of the processor --
      which tells us the maximum increment rate.
      
      eg.
      RAPL: 2759 sec. Joule Counter Range, at 95 Watts
      
      So if a sample duration is longer than 2759 seconds on this system,
      '**' replace the decimal place in the display to indicate
      that the results may be suspect.
      
      But the display had an extra ' ' in this case, throwing off the columns.
      
      Also, the -J "Joules" option appended an extra "time" column
      to the display.  While this may be useful, it printed the interval time,
      which may not be the accurate time per processor.  Remove this column,
      which appeared only when using '-J',
      as we plan to add accurate per-cpu interval times in a future commit.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      e975db5d
  2. 07 7月, 2016 1 次提交
  3. 08 4月, 2016 7 次提交
  4. 13 3月, 2016 15 次提交
  5. 03 3月, 2016 1 次提交
    • C
      tools/power turbostat: fix various build warnings · 1b69317d
      Colin Ian King 提交于
      When building with gcc 6 we're getting various build warnings that just
      require some trivial function declaration and call fixes:
      
        turbostat.c: In function ‘dump_cstate_pstate_config_info’:
        turbostat.c:1973:1: warning: type of ‘family’ defaults to ‘int’
         dump_cstate_pstate_config_info(family, model)
        turbostat.c:1973:1: warning: type of ‘model’ defaults to ‘int’
        turbostat.c: In function ‘get_tdp’:
        turbostat.c:2145:8: warning: type of ‘model’ defaults to ‘int’
         double get_tdp(model)
        turbostat.c: In function ‘perf_limit_reasons_probe’:
        turbostat.c:2259:6: warning: type of ‘family’ defaults to ‘int’
         void perf_limit_reasons_probe(family, model)
        turbostat.c:2259:6: warning: type of ‘model’ defaults to ‘int’
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/n/tip-wbicer8n0s9qe6ql8h9x478e@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b69317d
  6. 17 2月, 2016 4 次提交
  7. 14 11月, 2015 1 次提交
  8. 22 10月, 2015 1 次提交
  9. 20 10月, 2015 1 次提交
    • L
      tools/power turbostat: simplify Bzy_MHz calculation · 21ed5574
      Len Brown 提交于
          Bzy_MHz = TSC_delta*tsc_tweak/APERF_delta/MPERF_delta/measurement_interval
      
      becomes
      
          Bzy_MHz = base_mhz/APERF_delta/MPERF_delta
      
      on systems which support MSR_NHM_PLATFORM_INFO.
      
      base_mhz is calculated directly from the base_ratio
      reported in MSR_NHM_PLATFORM_INFO * bclk,
      and bclk is discovered via MSR or cpuid.
      
      This reduces the dependency of Bzy_MHz calculation on the TSC.
      Previously, there were 4 TSC readings required in each caculation,
      the raw TSC delta combined with the measurement_interval.
      This also removes the "tsc_tweak" correction factor used when
      TSC runs on a different base clock from the CPU's bclk.
      
      After this change, tsc_tweak is used only for %Busy.
      
      The end-result should be a Bzy_MHz result slightly less prone to jitter.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      21ed5574
  10. 26 9月, 2015 4 次提交
    • L
      tools/power turbosat: update version number · af71b980
      Len Brown 提交于
      Signed-off-by: NLen Brown <len.brown@intel.com>
      af71b980
    • L
      tools/power turbostat: SKL: Adjust for TSC difference from base frequency · a2b7b749
      Len Brown 提交于
      On a Skylake with 1500MHz base frequency,
      the TSC runs at 1512MHz.
      
      This is because the TSC is no longer in the n*100 MHz BCLK domain,
      but is now in the m*24MHz crystal clock domain. (24 MHz * 63 = 1512 MHz)
      
      This adds error to several calculations in turbostat,
      unless the TSC sample sizes are adjusted for this difference.
      
      Note that calculations in the time domain are immune
      from this issue, as the timing sub-system has already
      calibrated the TSC against a known wall clock.
      
      AVG_MHz = APERF_delta/measurement_interval
      
      	need no adjustment.  APERF_delta is in the BCLK domain,
      	and measurement_interval is in the time domain.
      
      TSC_MHz  =  TSC_delta/measurement_interval
      
      	needs no adjustment -- as we really do want to report
      	the actual measured TSC delta here, and measurement_interval
      	is in the accurate time domain.
      
      %Busy = MPERF_delta/TSC_delta
      
      	needs adjustment to use TSC_BCLK_DOMAIN_delta.
      	TSC_BCLK_DOMAIN_delta = TSC_delta * base_hz / tsc_hz
      
      Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
      
      	need adjustment as above.
      
      No other metrics in turbostat need to be adjusted.
      
      Before:
      
           CPU Avg_MHz   %Busy Bzy_MHz TSC_MHz
             -     550   24.84    2216    1512
             0    2191   98.73    2219    1514
             2       0    0.01    2130    1512
             1       9    0.43    2016    1512
             3       2    0.08    2016    1512
      
      After:
      
           CPU Avg_MHz   %Busy Bzy_MHz TSC_MHz
             -     550   25.05    2198    1512
             0    2190   99.62    2199    1512
             2       0    0.01    2152    1512
             1       9    0.46    2000    1512
             3       2    0.10    2000    1512
      
      Note that in this example, the "Before" Bzy_MHz
      was reported as exceeding the 2200 max turbo rate.
      Also, even a pinned spin loop would not be reported
      as over 99% busy.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      a2b7b749
    • H
      tools/power turbostat: KNL workaround for %Busy and Avg_MHz · b2b34dfe
      Hubert Chrzaniuk 提交于
      KNL increments APERF and MPERF every 1024 clocks.
      This is compliant with the architecture specification,
      which requires that only the ratio of APERF/MPERF need be valid.
      
      However, turbostat takes advantage of the fact that these
      two MSRs increment every un-halted clock
      at the actual and base frequency:
      
      AVG_MHz = APERF_delta/measurement_interval
      
      %Busy = MPERF_delta/TSC_delta
      
      This quirk is needed for these calculations to also work on KNL,
      which would otherwise show a value 1024x smaller than expected.
      Signed-off-by: NHubert Chrzaniuk <hubert.chrzaniuk@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b2b34dfe
    • L
      tools/power turbostat: IVB Xeon: fix --debug regression · 756357b8
      Len Brown 提交于
      Staring in Linux-4.3-rc1,
      commit 6fb3143b ("tools/power turbostat: dump CONFIG_TDP")
      touches MSR 0x648, which is not supported on IVB-Xeon.
      This results in "turbostat --debug" exiting on those systems:
      
      turbostat: /dev/cpu/2/msr offset 0x648 read failed: Input/output error
      
      Remove IVB-Xeon from the list of machines supporting with that MSR.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      756357b8
  11. 24 7月, 2015 1 次提交
  12. 16 7月, 2015 1 次提交
  13. 18 6月, 2015 1 次提交
    • L
      tools/power turbostat: dump CONFIG_TDP · 6fb3143b
      Len Brown 提交于
      Config TDP is a feature that allows parts to be configured
      for different thermal limits after they have left the factory.
      
      This can have an effect on the operation of the part,
      particularly in determiniing...
      
      Max Non-turbo Ratio
      Turbo Activation Ratio
      Signed-off-by: NLen Brown <len.brown@intel.com>
      6fb3143b