|
@@ -1300,17 +1300,25 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
|
|
|
|
|
|
new_shortname = 0;
|
|
|
if (!sched_in->shortname[0]) {
|
|
|
- sched_in->shortname[0] = sched->next_shortname1;
|
|
|
- sched_in->shortname[1] = sched->next_shortname2;
|
|
|
-
|
|
|
- if (sched->next_shortname1 < 'Z') {
|
|
|
- sched->next_shortname1++;
|
|
|
+ if (!strcmp(thread__comm_str(sched_in), "swapper")) {
|
|
|
+ /*
|
|
|
+ * Don't allocate a letter-number for swapper:0
|
|
|
+ * as a shortname. Instead, we use '.' for it.
|
|
|
+ */
|
|
|
+ sched_in->shortname[0] = '.';
|
|
|
+ sched_in->shortname[1] = ' ';
|
|
|
} else {
|
|
|
- sched->next_shortname1='A';
|
|
|
- if (sched->next_shortname2 < '9') {
|
|
|
- sched->next_shortname2++;
|
|
|
+ sched_in->shortname[0] = sched->next_shortname1;
|
|
|
+ sched_in->shortname[1] = sched->next_shortname2;
|
|
|
+
|
|
|
+ if (sched->next_shortname1 < 'Z') {
|
|
|
+ sched->next_shortname1++;
|
|
|
} else {
|
|
|
- sched->next_shortname2='0';
|
|
|
+ sched->next_shortname1 = 'A';
|
|
|
+ if (sched->next_shortname2 < '9')
|
|
|
+ sched->next_shortname2++;
|
|
|
+ else
|
|
|
+ sched->next_shortname2 = '0';
|
|
|
}
|
|
|
}
|
|
|
new_shortname = 1;
|
|
@@ -1322,12 +1330,9 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
|
|
|
else
|
|
|
printf("*");
|
|
|
|
|
|
- if (sched->curr_thread[cpu]) {
|
|
|
- if (sched->curr_thread[cpu]->tid)
|
|
|
- printf("%2s ", sched->curr_thread[cpu]->shortname);
|
|
|
- else
|
|
|
- printf(". ");
|
|
|
- } else
|
|
|
+ if (sched->curr_thread[cpu])
|
|
|
+ printf("%2s ", sched->curr_thread[cpu]->shortname);
|
|
|
+ else
|
|
|
printf(" ");
|
|
|
}
|
|
|
|