summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@chromium.org>2012-08-21 14:52:20 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-22 13:55:53 -0200
commit9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd (patch)
tree648a963e13cce8db4047a447af4fdc5f5a77b6a2 /tools
parent670ab5d21c7e168c89a36fdd2c69fb7af63d35a1 (diff)
downloadlinux-9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd.tar.bz2
perf tools: do not flush maps on COMM for perf report
This fixes a long-standing bug caused by the lack of separate COMM and EXEC record types, which makes "perf report" lose track of symbols when a process renames itself. With this fix (suggested by Stephane Eranian), a COMM (rename) no longer flushes the maps, which is the correct behavior. An EXEC also no longer flushes the maps, but this doesn't matter because as new mappings are created (for the executable and the libraries) the old mappings are automatically removed. This is not by accident: the functionality is necessary because DLLs can be explicitly loaded at any time with dlopen(), possibly on top of existing text, so "perf report" handles correctly the clobbering of new mappings on top of old ones. An alternative patch (which I proposed earlier) would be to introduce a separate PERF_RECORD_EXEC type, but it is a much larger change (about 300 lines) and is not necessary. Signed-off-by: Luigi Semenzato <semenzato@chromium.org> Tested-by: Stephane Eranian <eranian@google.com> Acked-by: Stephane Eranian <eranian@google.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Olof Johansson <olofj@chromium.org> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Robert Richter <robert.richter@amd.com> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Stephane Eranian <eranian@google.com> Cc: Stephen Wilson <wilsons@start.ca> Cc: Tejun Heo <tj@kernel.org> Cc: Vasiliy Kulikov <segoon@openwall.com> Link: http://lkml.kernel.org/r/1345585940-6497-1-git-send-email-semenzato@chromium.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/thread.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index fb4b7ea6752f..8b3e5939afb6 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -39,7 +39,6 @@ int thread__set_comm(struct thread *self, const char *comm)
err = self->comm == NULL ? -ENOMEM : 0;
if (!err) {
self->comm_set = true;
- map_groups__flush(&self->mg);
}
return err;
}