public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Luigi Semenzato <semenzato@chromium.org>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, eranian@google.com, mingo@kernel.org,
	a.p.zijlstra@chello.nl, wilsons@start.ca, semenzato@chromium.org,
	viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org,
	robert.richter@amd.com, fweisbec@gmail.com, olofj@chromium.org,
	akpm@linux-foundation.org, dsahern@gmail.com, ak@linux.intel.com,
	oleg@redhat.com, tglx@linutronix.de, rjw@sisk.pl,
	linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
	segoon@openwall.com, lucas.demarchi@profusion.mobi,
	namhyung@gmail.com, ebiederm@xmission.com, tj@kernel.org,
	sonnyrao@chromium.org, paul.gortmaker@windriver.com,
	mingo@elte.hu
Subject: [tip:perf/urgent] perf tools: do not flush maps on COMM for perf report
Date: Tue, 23 Oct 2012 23:04:29 -0700	[thread overview]
Message-ID: <tip-9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd@git.kernel.org> (raw)
In-Reply-To: <1345585940-6497-1-git-send-email-semenzato@chromium.org>

Commit-ID:  9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd
Gitweb:     http://git.kernel.org/tip/9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd
Author:     Luigi Semenzato <semenzato@chromium.org>
AuthorDate: Tue, 21 Aug 2012 14:52:20 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 22 Oct 2012 13:55:53 -0200

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>
---
 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;
 }

      parent reply	other threads:[~2012-10-24  6:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-bot for Luigi Semenzato [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-9fdbf671ba7e8adb2cbb93d716232ebcab55f6bd@git.kernel.org \
    --to=semenzato@chromium.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dsahern@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=namhyung@gmail.com \
    --cc=oleg@redhat.com \
    --cc=olofj@chromium.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulus@samba.org \
    --cc=rjw@sisk.pl \
    --cc=robert.richter@amd.com \
    --cc=segoon@openwall.com \
    --cc=sonnyrao@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wilsons@start.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox