tools/power turbostat: Allow -e for all names.
authorZephaniah E. Loss-Cutler-Hull <zephaniah@gmail.com>
Tue, 5 Oct 2021 04:54:38 +0000 (21:54 -0700)
committerLen Brown <len.brown@intel.com>
Sun, 17 Apr 2022 01:58:15 +0000 (21:58 -0400)
commit0fc521bc3339b029b2ac172a5b00bd7c9867e83d
treed7a7756d012cfc6e9c05231994c236289488b0df
parent6b398625ae6da31783e28b74458c14d2b921ec0f
tools/power turbostat: Allow -e for all names.

Currently, there are a number of variables which are displayed by
default, enabled with -e all, and listed by --list, but which you can
not give to --enable/-e.

So you can enable CPU0c1 (in the bic array), but you can't enable C1 or
C1% (not in the bic array, but exists in sysfs).

This runs counter to both the documentation and user expectations, and
it's just not very user friendly.

As such, the mechanism used by --hide has been duplicated, and is now
also used by --enable, so we can handle unknown names gracefully.

Note: One impact of this is that truly unknown fields given to --enable
will no longer generate errors, they will be silently ignored, as --hide
does.

Signed-off-by: Zephaniah E. Loss-Cutler-Hull <zephaniah@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c