From 4dfced359fbc719a35527416f1b4b3999647f68b Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Fri, 13 Sep 2013 16:28:57 +0900 Subject: 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 Acked-by: Frederic Weisbecker Tested-by: Jiri Olsa Cc: Frederic Weisbecker Link: http://lkml.kernel.org/n/tip-n6pykiiymtgmcjs834go2t8x@git.kernel.org [ Fixed up const pointer issues ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/perf/util/hist.c') diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 7e80253074b0..30793f98c8bb 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -416,6 +416,7 @@ struct hist_entry *__hists__add_mem_entry(struct hists *hists, { struct hist_entry entry = { .thread = al->thread, + .comm = thread__comm(al->thread), .ms = { .map = al->map, .sym = al->sym, @@ -446,6 +447,7 @@ struct hist_entry *__hists__add_branch_entry(struct hists *hists, { struct hist_entry entry = { .thread = al->thread, + .comm = thread__comm(al->thread), .ms = { .map = bi->to.map, .sym = bi->to.sym, @@ -475,6 +477,7 @@ struct hist_entry *__hists__add_entry(struct hists *hists, { struct hist_entry entry = { .thread = al->thread, + .comm = thread__comm(al->thread), .ms = { .map = al->map, .sym = al->sym, -- cgit v1.2.3