[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7707b6b6f8d9188b612f9fc88c65411264b1ed57@git.kernel.org>
Date: Tue, 24 Nov 2009 16:54:52 GMT
From: tip-bot for Li Zefan <lizf@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
penberg@...helsinki.fi, lizf@...fujitsu.com, peterz@...radead.org,
eduard.munteanu@...ux360.ro, fweisbec@...il.com,
tglx@...utronix.de, linux-mm@...ck.org, mingo@...e.hu
Subject: [tip:perf/core] perf kmem: Add new option to show raw ip
Commit-ID: 7707b6b6f8d9188b612f9fc88c65411264b1ed57
Gitweb: http://git.kernel.org/tip/7707b6b6f8d9188b612f9fc88c65411264b1ed57
Author: Li Zefan <lizf@...fujitsu.com>
AuthorDate: Tue, 24 Nov 2009 13:25:48 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 24 Nov 2009 08:49:49 +0100
perf kmem: Add new option to show raw ip
Add option "--raw-ip" to show raw ip instead of symbols:
# ./perf kmem --stat caller --raw-ip
------------------------------------------------------------------------------
Callsite |Total_alloc/Per | Total_req/Per | Hit | Frag
------------------------------------------------------------------------------
0xc05301aa | 733184/4096 | 733184/4096 | 179| 0.000%
0xc0542ba0 | 483328/4096 | 483328/4096 | 118| 0.000%
...
Also show symbols with format sym+offset instead of sym/offset.
Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Acked-by: Pekka Enberg <penberg@...helsinki.fi>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: linux-mm@...ck.org <linux-mm@...ck.org>
LKML-Reference: <4B0B6E5C.4080900@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
tools/perf/builtin-kmem.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 256d18f..1ef43c2 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -32,15 +32,14 @@ sort_fn_t caller_sort_fn;
static int alloc_lines = -1;
static int caller_lines = -1;
+static bool raw_ip;
+
static char *cwd;
static int cwdlen;
struct alloc_stat {
union {
- struct {
- char *name;
- u64 call_site;
- };
+ u64 call_site;
u64 ptr;
};
u64 bytes_req;
@@ -323,12 +322,14 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
if (is_caller) {
addr = data->call_site;
- sym = kernel_maps__find_symbol(addr, NULL, NULL);
+ if (!raw_ip)
+ sym = kernel_maps__find_symbol(addr,
+ NULL, NULL);
} else
addr = data->ptr;
if (sym != NULL)
- snprintf(bf, sizeof(bf), "%s/%Lx", sym->name,
+ snprintf(bf, sizeof(bf), "%s+%Lx", sym->name,
addr - sym->start);
else
snprintf(bf, sizeof(bf), "%#Lx", addr);
@@ -345,9 +346,9 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
}
if (n_lines == -1)
- printf(" ... | ... | ... | ... | ... \n");
+ printf(" ... | ... | ... | ... | ... \n");
- printf(" ------------------------------------------------------------------------------\n");
+ printf("%.78s\n", graph_dotted_line);
}
static void print_summary(void)
@@ -558,6 +559,7 @@ static const struct option kmem_options[] = {
OPT_CALLBACK('l', "line", NULL, "num",
"show n lins",
parse_line_opt),
+ OPT_BOOLEAN(0, "raw-ip", &raw_ip, "show raw ip instead of symbol"),
OPT_END()
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists