Skip to content

Commit a5285ad

Browse files
fweisbecacmel
authored andcommitted
perf tools: Tag thread comm as overriden
The problem is that when a thread overrides its default ":%pid" comm, we forget to tag the thread comm as overriden. Hence, this overriden comm is not inherited on future forks. Fix it. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Tested-by: David Ahern <dsahern@gmail.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20131116010207.GA18855@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 801a760 commit a5285ad

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎tools/perf/util/thread.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ int thread__set_comm(struct thread *thread, const char *str, u64 timestamp)
7070
/* Override latest entry if it had no specific time coverage */
7171
if (!curr->start) {
7272
comm__override(curr, str, timestamp);
73-
return 0;
73+
} else {
74+
new = comm__new(str, timestamp);
75+
if (!new)
76+
return -ENOMEM;
77+
list_add(&new->list, &thread->comm_list);
7478
}
7579

76-
new = comm__new(str, timestamp);
77-
if (!new)
78-
return -ENOMEM;
79-
80-
list_add(&new->list, &thread->comm_list);
8180
thread->comm_set = true;
8281

8382
return 0;

0 commit comments

Comments
 (0)