Skip to content

Commit 0956375

Browse files
committed
tools/power turbostat: Fix unc freq columns not showing with '-q' or '-l'
JIRA: https://issues.redhat.com/browse/RHEL-33321 commit c5120a3 Author: Adam Hawley <adam.james.hawley@intel.com> Date: Wed May 22 16:27:21 2024 +0300 tools/power turbostat: Fix unc freq columns not showing with '-q' or '-l' Commit 78464d7 ("tools/power turbostat: Add columns for clustered uncore frequency") introduced 'probe_intel_uncore_frequency_cluster()' in a way which prevents printing uncore frequency columns if either of the '-q' or '-l' options are used. Systems which do not have multiple uncore frequencies per package are unaffected by this regression. Fix the function so that uncore frequency columns are shown when either the '-l' or '-q' option is used by checking if 'quiet' is true after adding counters for the uncore frequency columns. Fixes: 78464d7 ("tools/power turbostat: Add columns for clustered uncore frequency") Signed-off-by: Adam Hawley <adam.james.hawley@intel.com> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 71ee1bd commit 0956375

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5695,9 +5695,6 @@ static void probe_intel_uncore_frequency_cluster(void)
56955695
if (access("/sys/devices/system/cpu/intel_uncore_frequency/uncore00/current_freq_khz", R_OK))
56965696
return;
56975697

5698-
if (quiet)
5699-
return;
5700-
57015698
for (uncore_max_id = 0;; ++uncore_max_id) {
57025699

57035700
sprintf(path_base, "/sys/devices/system/cpu/intel_uncore_frequency/uncore%02d", uncore_max_id);
@@ -5727,6 +5724,14 @@ static void probe_intel_uncore_frequency_cluster(void)
57275724
sprintf(path, "%s/fabric_cluster_id", path_base);
57285725
cluster_id = read_sysfs_int(path);
57295726

5727+
sprintf(path, "%s/current_freq_khz", path_base);
5728+
sprintf(name_buf, "UMHz%d.%d", domain_id, cluster_id);
5729+
5730+
add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id);
5731+
5732+
if (quiet)
5733+
continue;
5734+
57305735
sprintf(path, "%s/min_freq_khz", path_base);
57315736
k = read_sysfs_int(path);
57325737
sprintf(path, "%s/max_freq_khz", path_base);
@@ -5743,11 +5748,6 @@ static void probe_intel_uncore_frequency_cluster(void)
57435748
sprintf(path, "%s/current_freq_khz", path_base);
57445749
k = read_sysfs_int(path);
57455750
fprintf(outf, " %d MHz\n", k / 1000);
5746-
5747-
sprintf(path, "%s/current_freq_khz", path_base);
5748-
sprintf(name_buf, "UMHz%d.%d", domain_id, cluster_id);
5749-
5750-
add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id);
57515751
}
57525752
}
57535753

0 commit comments

Comments
 (0)