• Patryk Wlazlyn's avatar
    tools/power turbostat: Enable non-privileged users to read sysfs counters · 0e39702f
    Patryk Wlazlyn authored
    A group of counters called "sysfs" displays software
    C-state request counts and resulting perceived C-state residency.
    
    They are not built-in counters that turbostat knows about ahead of time,
    rather they are discovered in sysfs when turbostat starts.
    
    Thus, they are added dynamically, using the same interface
    as user-added MSR counters.
    
    When turbostat enters "no-msr" mode, such as when running as a
    non-privileged user, it clears all added counters.
    
    Updating that to clear only actual MSR added counters
    allows regular users to see the sysfs counters.
    
    [lenb: commit message]
    Signed-off-by: default avatarPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
    Signed-off-by: default avatarLen Brown <len.brown@intel.com>
    0e39702f
turbostat.c 213 KB