Skip to content

Commit e5cc017

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit e5cc017

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

tools/perf/builtin-sched.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,11 +2197,6 @@ static void timehist_print_sample(struct perf_sched *sched,
21972197
printf(" ");
21982198
}
21992199

2200-
if (!thread__comm_set(thread)) {
2201-
const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
2202-
thread__set_comm(thread, prev_comm, sample->time);
2203-
}
2204-
22052200
printf(" %-*s ", comm_width, timehist_get_commstr(thread));
22062201

22072202
if (sched->show_prio)
@@ -2890,6 +2885,15 @@ static int timehist_sched_change_event(const struct perf_tool *tool,
28902885
itr->last_thread = NULL;
28912886
}
28922887

2888+
/*
2889+
* If the process name is not set for the thread, use "prev_comm"
2890+
* to set it. Otherwise the sched summary will have just pid information
2891+
*/
2892+
if (!thread__comm_set(thread)) {
2893+
const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
2894+
thread__set_comm(thread, prev_comm, sample->time);
2895+
}
2896+
28932897
if (!sched->summary_only)
28942898
timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
28952899
}

0 commit comments

Comments
 (0)