aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Semenzato <[email protected]>2012-08-21 14:52:20 -0700
committerArnaldo Carvalho de Melo <[email protected]>2012-10-22 13:55:53 -0200
commit9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd (patch)
tree648a963e13cce8db4047a447af4fdc5f5a77b6a2
parent670ab5d21c7e168c89a36fdd2c69fb7af63d35a1 (diff)
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 <[email protected]> Tested-by: Stephane Eranian <[email protected]> Acked-by: Stephane Eranian <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Andrew Morton <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Olof Johansson <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Robert Richter <[email protected]> Cc: Sonny Rao <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Stephen Wilson <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Vasiliy Kulikov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-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;
}