• Kirill Smelkov's avatar
    hardirqs, softirqs: Fix distribution mode units handling · f2d125e2
    Kirill Smelkov authored
    Even if units was μs and thus factor=1000 `hardirqs -d` and `softirqs
    -d` were printing actual data in nanoseconds but with distribution unit
    labeled as "usecs", e.g.:
    
        softirq = sched
             usecs               : count     distribution
                 0 -> 1          : 0        |                                        |
                 2 -> 3          : 0        |                                        |
                 4 -> 7          : 0        |                                        |
                 8 -> 15         : 0        |                                        |
                16 -> 31         : 0        |                                        |
                32 -> 63         : 0        |                                        |
                64 -> 127        : 0        |                                        |
               128 -> 255        : 0        |                                        |
               256 -> 511        : 0        |                                        |
               512 -> 1023       : 0        |                                        |
              1024 -> 2047       : 6        |*****                                   |
              2048 -> 4095       : 3        |**                                      |
              4096 -> 8191       : 8        |*******                                 |
              8192 -> 16383      : 31       |*****************************           |
             16384 -> 32767      : 42       |****************************************|
             32768 -> 65535      : 18       |*****************                       |
    
    Fix it.
    
    NOTE: not putting "/ FACTOR" into common code because for counting mode
    we do not want to round intermediate results as e.g. there could be lots
    of say 0.5μs interrupts that should be all accounted as N*0.5, not N*0.0.
    f2d125e2
softirqs.py 3.95 KB