• Shawn Bohrer's avatar
    Compute load in nanoseconds · 6e217da6
    Shawn Bohrer authored
    When computing the load_slice per irq we take the topology object load
    divided by the interrupt count for the object.  Both of these values are
    integervalues which means if the interrupt count is larger than the load
    we get a load_slice of 0.  It seems likely that on modern processors
    interrupt durations will be at least multiple nanoseconds long so if we
    compute load in nanoseconds it should be >= the interrupt count.
    The load is recomputed every SLEEP_INTERVAL which is currently 10s which
    makes the maximum possible load 10e9 which easily fits in a uint64_t.
    Note: corrected error checking on sysconf usage
    Signed-off-by: 's avatarShawn Bohrer <sbohrer@rgmadvisors.com>
    Signed-off-by: 's avatarNeil Horman <nhorman@tuxdriver.com>