linux/Documentation/cpu-freq/cpufreq-stats.txt
<<
>>
Prefs
   1
   2     CPU frequency and voltage scaling statistics in the Linux(TM) kernel
   3
   4
   5             L i n u x    c p u f r e q - s t a t s   d r i v e r
   6
   7                       - information for users -
   8
   9
  10             Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  11
  12Contents
  131. Introduction
  142. Statistics Provided (with example)
  153. Configuring cpufreq-stats
  16
  17
  181. Introduction
  19
  20cpufreq-stats is a driver that provides CPU frequency statistics for each CPU.
  21These statistics are provided in /sysfs as a bunch of read_only interfaces. This
  22interface (when configured) will appear in a separate directory under cpufreq
  23in /sysfs (<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/) for each CPU.
  24Various statistics will form read_only files under this directory.
  25
  26This driver is designed to be independent of any particular cpufreq_driver
  27that may be running on your CPU. So, it will work with any cpufreq_driver.
  28
  29
  302. Statistics Provided (with example)
  31
  32cpufreq stats provides following statistics (explained in detail below).
  33-  time_in_state
  34-  total_trans
  35-  trans_table
  36
  37All the statistics will be from the time the stats driver has been inserted 
  38to the time when a read of a particular statistic is done. Obviously, stats 
  39driver will not have any information about the frequency transitions before
  40the stats driver insertion.
  41
  42--------------------------------------------------------------------------------
  43<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l
  44total 0
  45drwxr-xr-x  2 root root    0 May 14 16:06 .
  46drwxr-xr-x  3 root root    0 May 14 15:58 ..
  47-r--r--r--  1 root root 4096 May 14 16:06 time_in_state
  48-r--r--r--  1 root root 4096 May 14 16:06 total_trans
  49-r--r--r--  1 root root 4096 May 14 16:06 trans_table
  50--------------------------------------------------------------------------------
  51
  52-  time_in_state
  53This gives the amount of time spent in each of the frequencies supported by
  54this CPU. The cat output will have "<frequency> <time>" pair in each line, which
  55will mean this CPU spent <time> usertime units of time at <frequency>. Output
  56will have one line for each of the supported frequencies. usertime units here 
  57is 10mS (similar to other time exported in /proc).
  58
  59--------------------------------------------------------------------------------
  60<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat time_in_state 
  613600000 2089
  623400000 136
  633200000 34
  643000000 67
  652800000 172488
  66--------------------------------------------------------------------------------
  67
  68
  69-  total_trans
  70This gives the total number of frequency transitions on this CPU. The cat 
  71output will have a single count which is the total number of frequency
  72transitions.
  73
  74--------------------------------------------------------------------------------
  75<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat total_trans
  7620
  77--------------------------------------------------------------------------------
  78
  79-  trans_table
  80This will give a fine grained information about all the CPU frequency
  81transitions. The cat output here is a two dimensional matrix, where an entry
  82<i,j> (row i, column j)re is a two dimensional matrix, w13" cnts.tmentace frequeumentation 
  738/a>
  748/a>--------------------8-----84freqFon/cj)ismentatscendk witrd aboutcy
ncreanumb  matridimensi matrix, whealsoh/cpufreq-stats.txt#L82" id="L82" class="line" name="L75">  758/a><mysystem>:/sy8/devi8es/sy36/8CPUch of tctuf="atistdiv ctation/cpu-nsion th matrixtionbett abs doabiliteq/cpufreq-stats.txt#L25" id="L25" class="line" name="876">  768/a>20
  778/a>--------------------8-----8-----------------------------------------------------
   8
  798/a>-  trans_table
  809/a>This will give a fin9 grai9ipadi <venk:ocuion/cpu-Docun/cpu-Doc2n/cpu-Doc0n/cpu-Doation/cp/cpufreq-stats.txt#L9" id="L9" class="line" name="L9"81">  819/a>transitions. The cat9outpu91padi &ion/cpu: <venk0 <venk5 <venk0 <venk0 <venk0 /cpufreq-stats.txt#L9" id="L9" class="line" name="L9"82">  829/a><i,j> (row i, 9olumn9age scacun/cpu: <venk4 <venk0 <venk2 <venk0 <venk0 /cpufreq-stats.txt#L9" id="L9" class="line" name="L9"73">  739/a>
  749/a>--------------------9-----94ge scac0n/cpu: <venk0 <venk0 <venk1 <venk0 <venk3 /cpufreq-stats.txt#L9" id="L9" class="line" name="L9"75">  759/a><mysystem>:/sy9/devi9 p u f ation/c: <venk0 <venk0 <venk0 <venk2 <venk0 /cpufreq-stats.txt#L9" id="L9" class="line" name="L9"76">  769/a>20
  779/a>--------------------9-----9-freq/cpufreq-stats.txt#L68" id="L68" class="line" name="9">   8
   9
  10             Venkatesh grash freq/cpufreq-stats.txt#L10" id="L10" class="line" name="L111">  11<0/a>
  12<0/a>Contents
  13<0/a>1. Introduction
  14<0/a>2. Statistics Provide04grash4ormation for users -tionF. The catTM) kern reqfreq/cpufreq-stats.txt#L11" id="L11" class="line" name="L015">  15<0/a>3. Configuring cpufre05grash p u f r e q - s tttttttttttt[*]-tionF. The catTM) ker/cpufreq-stats.txt#L11" id="L11" class="line" name="L016">  16<0/a>
  17<0/a>
  18<0/a>1. Introduction
  19<0/a>
  10<             Venkatessh Pa1lipadi  11
  12<Contents
  13<1. Introduction
  14<2. Statistics Provideed (w1th exabasice the stats duency
ncluned  tion/cpu-freqn thon/cpu-freqn/cpufreq-stats.txt#L10" id="L10" class="line" name="LL15">  15<3. Configuring cpufreeq-st11-freq/cpufreq-stats.txt#L26" id="L26" class="line" name="1L16">  16<
  17<
  18<1. Introduction
  19<
  201cpufreq-stats is a d1river12ipadi & appear i. Iics for eaca duoeq his
  11<These statistics are1 prov121padi &uencn/cpufreq-stats.txt#L10" id="L10" class="line" name="L212">  12Contents
  231in /sysfs (<sysfs1 root1gt;/deOncrted sen ent
pref="Dh ofenfreqcun thany cpuf units hsrcstatistics ,hany/cpufreq-stats.txt#L10" id="L10" class="line" name="LL14">  14<Various statistics w1ill f1rm readriver hfreq larseementation/cpu-freqnel
  15<
  261This driver is desig1ned t12-freq/cpufreq-stats.txt#L17" id="L17" class="line" name="LL27">  271that may be running 1on yo12-freq/cpufreq-stats.txt#L18" id="L18" class="line" name="LL28">  281
  291

ensi rigief="LXR softwh ofbyionsicpufreq-shttp://sny c-frege.netpu-fjects/lxe">LXR common/cyfreq,umentaexpeqi.txt#l ver hrefbyicpufreq-smon/to:lxe@ltati.no">lxe@ltati.nofreq.
 id="fie_con

lxe.ltati.no kindly hosu-freqicpufreq-shttp://www.redpriv-ltau-f.no">Redpriventau-f ASfreq,us for eationLtati=ara="cokerna thopeqaref="Dserats # numcrt1995.
 id="file/bodyfie/htmlea