Skip to content

Commit b991074

Browse files
committed
tools/power turbostat: Allow more use of is_hybrid flag
The "is_hybrid" is set and used only in !quiet mode. Make it valid in both quiet and !quiet mode to allow more uses. Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 041e975 commit b991074

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8157,6 +8157,9 @@ void decode_feature_control_msr(void)
81578157
if (no_msr)
81588158
return;
81598159

8160+
if (quiet)
8161+
return;
8162+
81608163
if (!get_msr(base_cpu, MSR_IA32_FEAT_CTL, &msr))
81618164
fprintf(outf, "cpu%d: MSR_IA32_FEATURE_CONTROL: 0x%08llx (%sLocked %s)\n",
81628165
base_cpu, msr, msr & FEAT_CTL_LOCKED ? "" : "UN-", msr & (1 << 18) ? "SGX" : "");
@@ -8921,7 +8924,7 @@ void process_cpuid()
89218924
if (!quiet)
89228925
decode_misc_enable_msr();
89238926

8924-
if (max_level >= 0x7 && !quiet) {
8927+
if (max_level >= 0x7) {
89258928
int has_sgx;
89268929

89278930
ecx = 0;
@@ -8930,9 +8933,10 @@ void process_cpuid()
89308933

89318934
has_sgx = ebx & (1 << 2);
89328935

8933-
is_hybrid = edx & (1 << 15);
8936+
is_hybrid = !!(edx & (1 << 15));
89348937

8935-
fprintf(outf, "CPUID(7): %sSGX %sHybrid\n", has_sgx ? "" : "No-", is_hybrid ? "" : "No-");
8938+
if (!quiet)
8939+
fprintf(outf, "CPUID(7): %sSGX %sHybrid\n", has_sgx ? "" : "No-", is_hybrid ? "" : "No-");
89368940

89378941
if (has_sgx)
89388942
decode_feature_control_msr();

0 commit comments

Comments
 (0)