From: Anton Blanchard <anton@samba.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Frederic Weisbecker <fweisbec@gmail.com>,
emunson@mgebm.net, imunsie@au1.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] perf sort: Improve dso sort output by separating unresolved samples by type
Date: Wed, 31 Aug 2011 11:49:44 +1000 [thread overview]
Message-ID: <20110831114944.25df45df@kryten> (raw)
We currently roll up all unresolved kernel, user, hypervisor and guest
samples into the one bucket:
59.64% [unknown]
22.71% [kernel.kallsyms]
9.40% libj9jit26.so
We can get a much better high level view by separating these unresolved
samples by symbol type:
56.64% [unknown:.]
22.71% [kernel.kallsyms]
9.40% libj9jit26.so
2.81% [unknown:H]
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-2.6-tip/tools/perf/util/sort.c
===================================================================
--- linux-2.6-tip.orig/tools/perf/util/sort.c 2011-08-31 11:34:53.070439428 +1000
+++ linux-2.6-tip/tools/perf/util/sort.c 2011-08-31 11:37:57.543628167 +1000
@@ -111,6 +111,9 @@ sort__dso_cmp(struct hist_entry *left, s
struct dso *dso_r = right->ms.map ? right->ms.map->dso : NULL;
const char *dso_name_l, *dso_name_r;
+ if (!dso_l && !dso_r)
+ return right->level - left->level;
+
if (!dso_l || !dso_r)
return cmp_null(dso_l, dso_r);
@@ -128,13 +131,16 @@ sort__dso_cmp(struct hist_entry *left, s
static int hist_entry__dso_snprintf(struct hist_entry *self, char *bf,
size_t size, unsigned int width)
{
+ char unknown[] = "[unknown:.]";
+
if (self->ms.map && self->ms.map->dso) {
const char *dso_name = !verbose ? self->ms.map->dso->short_name :
self->ms.map->dso->long_name;
return repsep_snprintf(bf, size, "%-*s", width, dso_name);
}
- return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");
+ unknown[strlen(unknown) - 2] = self->level;
+ return repsep_snprintf(bf, size, "%-*s", width, unknown);
}
struct sort_entry sort_dso = {
next reply other threads:[~2011-08-31 1:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 1:49 Anton Blanchard [this message]
2011-08-31 12:33 ` [PATCH 1/2] perf sort: Improve dso sort output by separating unresolved samples by type emunson
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=20110831114944.25df45df@kryten \
--to=anton@samba.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=emunson@mgebm.net \
--cc=fweisbec@gmail.com \
--cc=imunsie@au1.ibm.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