aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
authorDongsheng <yangds.fnst@cn.fujitsu.com>2014-05-06 01:39:01 -0400
committerJiri Olsa <jolsa@kernel.org>2014-05-12 05:09:05 -0400
commit6bcab4e1eaa1f669d003051ef3b87a963d8763bb (patch)
treecb0aef3cb6825bbff6db31d76d86a1d36a61d285 /tools/perf/builtin-sched.c
parente936e8e459e14af7432a775f8139a79b71e41afc (diff)
perf tools: Clarify the output of perf sched map.
In output of perf sched map, any shortname of thread will be explained at the first time when it appear. Example: *A0 228836.978985 secs A0 => perf:23032 *. A0 228836.979016 secs B0 => swapper:0 . *C0 228836.979099 secs C0 => migration/3:22 *A0 . C0 228836.979115 secs A0 . *. 228836.979115 secs But B0, which is explained as swapper:0 did not appear in the left part of output. Instead, we use '.' as the shortname of swapper:0. So the comment of "B0 => swapper:0" is not easy to understand. This patch clarify the output of perf sched map with not allocating one letter-number shortname for swapper:0 and print ". => swapper:0" as the explanation for swapper:0. Example: *A0 228836.978985 secs A0 => perf:23032 * . A0 228836.979016 secs . => swapper:0 . *B0 228836.979099 secs B0 => migration/3:22 *A0 . B0 228836.979115 secs A0 . * . 228836.979115 secs A0 *C0 . 228836.979225 secs C0 => ksoftirqd/2:18 A0 *D0 . 228836.979236 secs D0 => rcu_sched:7 Signed-off-by: Dongsheng <yangds.fnst@cn.fujitsu.com> Acked-by: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1399354741-19522-1-git-send-email-yangds.fnst@cn.fujitsu.com [ small style fixes to make checkpatch happy ] Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 4f0dd21b5923..2579215f5743 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1300,17 +1300,25 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
1300 1300
1301 new_shortname = 0; 1301 new_shortname = 0;
1302 if (!sched_in->shortname[0]) { 1302 if (!sched_in->shortname[0]) {
1303 sched_in->shortname[0] = sched->next_shortname1; 1303 if (!strcmp(thread__comm_str(sched_in), "swapper")) {
1304 sched_in->shortname[1] = sched->next_shortname2; 1304 /*
1305 1305 * Don't allocate a letter-number for swapper:0
1306 if (sched->next_shortname1 < 'Z') { 1306 * as a shortname. Instead, we use '.' for it.
1307 sched->next_shortname1++; 1307 */
1308 sched_in->shortname[0] = '.';
1309 sched_in->shortname[1] = ' ';
1308 } else { 1310 } else {
1309 sched->next_shortname1='A'; 1311 sched_in->shortname[0] = sched->next_shortname1;
1310 if (sched->next_shortname2 < '9') { 1312 sched_in->shortname[1] = sched->next_shortname2;
1311 sched->next_shortname2++; 1313
1314 if (sched->next_shortname1 < 'Z') {
1315 sched->next_shortname1++;
1312 } else { 1316 } else {
1313 sched->next_shortname2='0'; 1317 sched->next_shortname1 = 'A';
1318 if (sched->next_shortname2 < '9')
1319 sched->next_shortname2++;
1320 else
1321 sched->next_shortname2 = '0';
1314 } 1322 }
1315 } 1323 }
1316 new_shortname = 1; 1324 new_shortname = 1;
@@ -1322,12 +1330,9 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
1322 else 1330 else
1323 printf("*"); 1331 printf("*");
1324 1332
1325 if (sched->curr_thread[cpu]) { 1333 if (sched->curr_thread[cpu])
1326 if (sched->curr_thread[cpu]->tid) 1334 printf("%2s ", sched->curr_thread[cpu]->shortname);
1327 printf("%2s ", sched->curr_thread[cpu]->shortname); 1335 else
1328 else
1329 printf(". ");
1330 } else
1331 printf(" "); 1336 printf(" ");
1332 } 1337 }
1333 1338