diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-09-13 09:28:57 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-04 16:16:39 +0100 |
commit | 4dfced359fbc719a35527416f1b4b3999647f68b (patch) | |
tree | bfa501673ebf02c77818e87a374ff9a80bec974e /tools/perf/util/thread.c | |
parent | perf tools: Compare hists comm by addresses (diff) | |
download | linux-4dfced359fbc719a35527416f1b4b3999647f68b.tar.xz linux-4dfced359fbc719a35527416f1b4b3999647f68b.zip |
perf tools: Get current comm instead of last one
At insert time, a hist entry should reference comm at the time otherwise
it'll get the last comm anyway.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/n/tip-n6pykiiymtgmcjs834go2t8x@git.kernel.org
[ Fixed up const pointer issues ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r-- | tools/perf/util/thread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 15c53c2e109e..cd8e2f592719 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -54,7 +54,7 @@ void thread__delete(struct thread *thread) free(thread); } -static struct comm *thread__comm(const struct thread *thread) +struct comm *thread__comm(const struct thread *thread) { if (list_empty(&thread->comm_list)) return NULL; @@ -69,8 +69,8 @@ int thread__set_comm(struct thread *thread, const char *str, u64 timestamp) /* Override latest entry if it had no specific time coverage */ if (!curr->start) { - list_del(&curr->list); - comm__free(curr); + comm__override(curr, str, timestamp); + return 0; } new = comm__new(str, timestamp); |