linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: do not flush maps on COMM for perf report
@ 2012-08-21 21:52 Luigi Semenzato
  2012-08-22  7:28 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Luigi Semenzato @ 2012-08-21 21:52 UTC (permalink / raw)
  To: Alexander Viro, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Andrew Morton, Vasiliy Kulikov,
	Stephen Wilson, Oleg Nesterov, Tejun Heo, Paul Gortmaker,
	Andi Kleen, Lucas De Marchi, Greg Kroah-Hartman,
	Eric W. Biederman, Rafael J. Wysocki, Frederic Weisbecker,
	David Ahern, Namhyung Kim, Robert Richter, linux-kernel
  Cc: sonnyrao, olofj, eranian, Luigi Semenzato

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>
---
 tools/perf/util/thread.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index fb4b7ea..8b3e593 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;
 }
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-24  6:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 21:52 [PATCH] perf: do not flush maps on COMM for perf report Luigi Semenzato
2012-08-22  7:28 ` Ingo Molnar
2012-08-22 16:09   ` Luigi Semenzato
2012-08-22 16:29     ` Arnaldo Carvalho de Melo
2012-08-22 16:56       ` David Ahern
2012-08-22 18:16         ` Arnaldo Carvalho de Melo
2012-08-22 18:26           ` Luigi Semenzato
2012-08-22 18:42           ` David Ahern
2012-08-22 19:22 ` David Ahern
2012-10-24  6:04 ` [tip:perf/urgent] perf tools: " tip-bot for Luigi Semenzato

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).