Search code examples
linuxperformanceperfcontext-switch

what is the meaning of the units displayed against context switch in perf stat?


 8.014196 task-clock                #    0.004 CPUs utilized          
           204 context-switches          #    0.025 M/sec                  
            32 cpu-migrations            #    0.004 M/sec                  
             0 page-faults               #    0.000 K/sec                  
    11,841,196 cycles                    #    1.478 GHz                     [46.17%]
     9,982,788 stalled-cycles-frontend   #   84.31% frontend cycles idle    [80.26%]
     8,122,708 stalled-cycles-backend    #   68.60% backend  cycles idle   
     5,462,302 instructions              #    0.46  insns per cycle        
                                         #    1.83  stalled cycles per insn
     1,098,309 branches                  #  137.045 M/sec                  
        94,430 branch-misses             #    8.60% of all branches         [77.23%]

In the above stat, I can see context switches stat mentioned as 204. But what does the statement after # 0.025 M/sec mean when it comes to context switch ? I can not interpret it as number of switches per seconds. I tried checking the wiki page and manual but was unable to find anything regarding this ?


Solution

  • # 0.025 M/sec means 0.025 million (from mega - from metric/SI prefix) context switches per second (so 25 thousand per second).

    • M/sec - million per second
    • K/sec - thousand per second