diff options
author | Len Brown <len.brown@intel.com> | 2021-07-16 11:55:03 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2022-04-16 21:17:18 -0400 |
commit | 5dc241f2b299898f4faadb44ea3cb0a9bb00eda1 (patch) | |
tree | a0f0136ac40953ecb4905bcb25d4847f3eb779e0 /tools/power | |
parent | f443e374ae131c168a065ea1748feac6b2e76613 (diff) | |
download | linux-stable-5dc241f2b299898f4faadb44ea3cb0a9bb00eda1.tar.gz linux-stable-5dc241f2b299898f4faadb44ea3cb0a9bb00eda1.tar.bz2 linux-stable-5dc241f2b299898f4faadb44ea3cb0a9bb00eda1.zip |
tools/power turbostat: tweak --show and --hide capability
allow invocations such as # turbostat --show power,Busy%
previously the "Busy%" was ignored
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 47d3ba895d6d..c05099431378 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -752,26 +752,31 @@ unsigned long long bic_lookup(char *name_list, enum show_hide_mode mode) if (comma) *comma = '\0'; - if (!strcmp(name_list, "all")) - return ~0; - if (!strcmp(name_list, "topology")) - return BIC_TOPOLOGY; - if (!strcmp(name_list, "power")) - return BIC_THERMAL_PWR; - if (!strcmp(name_list, "idle")) - return BIC_IDLE; - if (!strcmp(name_list, "frequency")) - return BIC_FREQUENCY; - if (!strcmp(name_list, "other")) - return BIC_OTHER; - if (!strcmp(name_list, "all")) - return 0; - for (i = 0; i < MAX_BIC; ++i) { if (!strcmp(name_list, bic[i].name)) { retval |= (1ULL << i); break; } + if (!strcmp(name_list, "all")) { + retval |= ~0; + break; + } else if (!strcmp(name_list, "topology")) { + retval |= BIC_TOPOLOGY; + break; + } else if (!strcmp(name_list, "power")) { + retval |= BIC_THERMAL_PWR; + break; + } else if (!strcmp(name_list, "idle")) { + retval |= BIC_IDLE; + break; + } else if (!strcmp(name_list, "frequency")) { + retval |= BIC_FREQUENCY; + break; + } else if (!strcmp(name_list, "other")) { + retval |= BIC_OTHER; + break; + } + } if (i == MAX_BIC) { if (mode == SHOW_LIST) { |