Skip to content

Commit 011b3a1

Browse files
kudureranganathPeter Zijlstra
authored andcommitted
sched/stats: Print domain name in /proc/schedstat
Currently, there does not exist a straightforward way to extract the names of the sched domains and match them to the per-cpu domain entry in /proc/schedstat other than looking at the debugfs files which are only visible after enabling "verbose" debug after commit 3432074 ("sched/debug: Put sched/domains files under the verbose flag") Since tools like `perf sched stats`[1] require displaying per-domain information in user friendly manner, display the names of sched domain, alongside their level in /proc/schedstat. Domain names also makes the /proc/schedstat data unambiguous when some of the cpus are offline. For example, on a 128 cpus AMD Zen3 machine where CPU0 and CPU64 are SMT siblings and CPU64 is offline: Before: cpu0 ... domain0 ... domain1 ... cpu1 ... domain0 ... domain1 ... domain2 ... After: cpu0 ... domain0 MC ... domain1 PKG ... cpu1 ... domain0 SMT ... domain1 MC ... domain2 PKG ... [1] https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: K Prateek Nayak <[email protected]> Signed-off-by: Ravi Bangoria <[email protected]> Signed-off-by: Swapnil Sapkal <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: James Clark <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1c055a0 commit 011b3a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
138138
for_each_domain(cpu, sd) {
139139
enum cpu_idle_type itype;
140140

141-
seq_printf(seq, "domain%d %*pb", dcount++,
141+
seq_printf(seq, "domain%d %s %*pb", dcount++, sd->name,
142142
cpumask_pr_args(sched_domain_span(sd)));
143143
for (itype = 0; itype < CPU_MAX_IDLE_TYPES; itype++) {
144144
seq_printf(seq, " %u %u %u %u %u %u %u %u %u %u %u",

0 commit comments

Comments
 (0)