aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/stdio/hist.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-11-20 02:32:01 -0500
committerIngo Molnar <mingo@kernel.org>2014-11-20 02:32:01 -0500
commit4e6e311e596eadba30d4f56f64eae7d45611a01c (patch)
tree681fb4c9ae7320ab1192f92e1c153ab35c90bf8e /tools/perf/ui/stdio/hist.c
parent2565711fb7d7c28e0cd93c8971b520d1b10b857c (diff)
parenta84808083688d82d7f1e5786ccf5df0ff7d448cb (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible fixes: - Fallback to kallsyms when using the minimal 'ELF' loader (Arnaldo Carvalho de Melo) - Fix annotation with kcore (Adrian Hunter) - Fix up srcline histogram key formatting (Arnaldo Carvalho de Melo) - Add missing handler for PERF_RECORD_MMAP2 events in 'perf diff' (Kan Liang) User visible changes/new features: - Only print base source file for srcline histogram sort key (Andi Kleen) - Support source line numbers in annotate using a hotkey (Andi Kleen) Infrastructure changes and fixes: - Do not poll events that use the system_wide flag (Adrian Hunter) - Add perf-read-vdso32 and perf-read-vdsox32 to .gitignore (Adrian Hunter) - Only override the default :tid comm entry (Adrian Hunter) - Factor out adding new call chain entries (Andi Kleen) - Use al.addr to set up call chain (Andi Kleen) - Use a common function to resolve symbol or name (Andi Kleen) - Fix ftrace:function event recording (Jiri Olsa) - Move disable_buildid_cache() to util/build-id.c (Namhyung Kim) - Clean up libelf feature support code (Namhyung Kim) - Fix typo in python 'perf test' (WANG Chao) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/ui/stdio/hist.c')
-rw-r--r--tools/perf/ui/stdio/hist.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 15b451acbde6..dfcbc90146ef 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -41,6 +41,7 @@ static size_t ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain,
41{ 41{
42 int i; 42 int i;
43 size_t ret = 0; 43 size_t ret = 0;
44 char bf[1024];
44 45
45 ret += callchain__fprintf_left_margin(fp, left_margin); 46 ret += callchain__fprintf_left_margin(fp, left_margin);
46 for (i = 0; i < depth; i++) { 47 for (i = 0; i < depth; i++) {
@@ -56,11 +57,8 @@ static size_t ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain,
56 } else 57 } else
57 ret += fprintf(fp, "%s", " "); 58 ret += fprintf(fp, "%s", " ");
58 } 59 }
59 if (chain->ms.sym) 60 fputs(callchain_list__sym_name(chain, bf, sizeof(bf), false), fp);
60 ret += fprintf(fp, "%s\n", chain->ms.sym->name); 61 fputc('\n', fp);
61 else
62 ret += fprintf(fp, "0x%0" PRIx64 "\n", chain->ip);
63
64 return ret; 62 return ret;
65} 63}
66 64
@@ -168,6 +166,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
168 struct rb_node *node; 166 struct rb_node *node;
169 int i = 0; 167 int i = 0;
170 int ret = 0; 168 int ret = 0;
169 char bf[1024];
171 170
172 /* 171 /*
173 * If have one single callchain root, don't bother printing 172 * If have one single callchain root, don't bother printing
@@ -196,10 +195,8 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
196 } else 195 } else
197 ret += callchain__fprintf_left_margin(fp, left_margin); 196 ret += callchain__fprintf_left_margin(fp, left_margin);
198 197
199 if (chain->ms.sym) 198 ret += fprintf(fp, "%s\n", callchain_list__sym_name(chain, bf, sizeof(bf),
200 ret += fprintf(fp, " %s\n", chain->ms.sym->name); 199 false));
201 else
202 ret += fprintf(fp, " %p\n", (void *)(long)chain->ip);
203 200
204 if (++entries_printed == callchain_param.print_limit) 201 if (++entries_printed == callchain_param.print_limit)
205 break; 202 break;
@@ -219,6 +216,7 @@ static size_t __callchain__fprintf_flat(FILE *fp, struct callchain_node *node,
219{ 216{
220 struct callchain_list *chain; 217 struct callchain_list *chain;
221 size_t ret = 0; 218 size_t ret = 0;
219 char bf[1024];
222 220
223 if (!node) 221 if (!node)
224 return 0; 222 return 0;
@@ -229,11 +227,8 @@ static size_t __callchain__fprintf_flat(FILE *fp, struct callchain_node *node,
229 list_for_each_entry(chain, &node->val, list) { 227 list_for_each_entry(chain, &node->val, list) {
230 if (chain->ip >= PERF_CONTEXT_MAX) 228 if (chain->ip >= PERF_CONTEXT_MAX)
231 continue; 229 continue;
232 if (chain->ms.sym) 230 ret += fprintf(fp, " %s\n", callchain_list__sym_name(chain,
233 ret += fprintf(fp, " %s\n", chain->ms.sym->name); 231 bf, sizeof(bf), false));
234 else
235 ret += fprintf(fp, " %p\n",
236 (void *)(long)chain->ip);
237 } 232 }
238 233
239 return ret; 234 return ret;