mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Mike Galbraith" <efault@gmx.de>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Paul Mackerras" <paulus@samba.org>
Subject: [PATCH 6/6] perf symbols: Change the kernel DSO name if it comes from kallsyms
Date: Fri, 20 Nov 2009 20:51:29 -0200	[thread overview]
Message-ID: <1258757489-5978-6-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1258757489-5978-5-git-send-email-acme@infradead.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

So that the user have a clearer indication about the source of the
symbols, as we only state buildid mismatches in verbose mode, because
'perf top' would overwrite such warning anyway.

Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 9cf6dbc..48f87f0 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -108,6 +108,8 @@ static size_t symbol__fprintf(struct symbol *self, FILE *fp)
 
 static void dso__set_long_name(struct dso *self, char *name)
 {
+	if (name == NULL)
+		return;
 	self->long_name = name;
 	self->long_name_len = strlen(name);
 }
@@ -1377,8 +1379,11 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
 {
 	int err = dso__load_vmlinux(self, map, self->name, filter);
 
-	if (err <= 0)
+	if (err <= 0) {
 		err = kernel_maps__load_kallsyms(filter);
+		if (err > 0)
+                        dso__set_long_name(self, strdup("[kernel.kallsyms]"));
+	}
 
 	if (err > 0) {
 		map__fixup_start(map);
-- 
1.6.2.5


      reply	other threads:[~2009-11-20 22:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 22:51 [PATCH 1/6] perf symbols: Remove unrelated actions from dso__load_kernel_sym Arnaldo Carvalho de Melo
2009-11-20 22:51 ` [PATCH 2/6] perf symbols: filename__read_build_id should look at .notes section too Arnaldo Carvalho de Melo
2009-11-20 22:51   ` [PATCH 3/6] perf symbols: Introduce dso__build_id_equal Arnaldo Carvalho de Melo
2009-11-20 22:51     ` [PATCH 4/6] perf symbols: Do lazy symtab loading for the kernel & modules too Arnaldo Carvalho de Melo
2009-11-20 22:51       ` [PATCH 5/6] perf symbols: Check vmlinux buildid Arnaldo Carvalho de Melo
2009-11-20 22:51         ` Arnaldo Carvalho de Melo [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=1258757489-5978-6-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /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

all inboxes | Powered by JetHome®