aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorAkihiro Nagai <akihiro.nagai.hw@hitachi.com>2012-01-29 23:42:57 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-01-30 14:57:57 -0500
commit547a92e0aedb88129e7fbd804697a11949de2e5a (patch)
treedbe71c0161ef32186de12032f4f0238383517dc4 /tools/perf/builtin-script.c
parentf9d36996564f91c517b75b02942015f7e09a6574 (diff)
perf script: Unify the expressions indicating "unknown"
The perf script command uses various expressions to indicate "unknown". It is unfriendly for user scripts to parse it. So, this patch unifies the expressions to "[unknown]". Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: yrl.pp-manager.tt@hitachi.com Link: http://lkml.kernel.org/r/20120130044257.2384.62905.stgit@linux3 Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index bb68ddf257b7..add13ec15977 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -300,7 +300,7 @@ static void print_sample_start(struct perf_sample *sample,
300 } else 300 } else
301 evname = __event_name(attr->type, attr->config); 301 evname = __event_name(attr->type, attr->config);
302 302
303 printf("%s: ", evname ? evname : "(unknown)"); 303 printf("%s: ", evname ? evname : "[unknown]");
304 } 304 }
305} 305}
306 306
@@ -323,7 +323,6 @@ static void print_sample_addr(union perf_event *event,
323{ 323{
324 struct addr_location al; 324 struct addr_location al;
325 u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 325 u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
326 const char *symname, *dsoname;
327 326
328 printf("%16" PRIx64, sample->addr); 327 printf("%16" PRIx64, sample->addr);
329 328
@@ -343,21 +342,14 @@ static void print_sample_addr(union perf_event *event,
343 al.sym = map__find_symbol(al.map, al.addr, NULL); 342 al.sym = map__find_symbol(al.map, al.addr, NULL);
344 343
345 if (PRINT_FIELD(SYM)) { 344 if (PRINT_FIELD(SYM)) {
346 if (al.sym && al.sym->name) 345 printf(" ");
347 symname = al.sym->name; 346 symbol__fprintf_symname(al.sym, stdout);
348 else
349 symname = "";
350
351 printf(" %16s", symname);
352 } 347 }
353 348
354 if (PRINT_FIELD(DSO)) { 349 if (PRINT_FIELD(DSO)) {
355 if (al.map && al.map->dso && al.map->dso->name) 350 printf(" (");
356 dsoname = al.map->dso->name; 351 map__fprintf_dsoname(al.map, stdout);
357 else 352 printf(")");
358 dsoname = "";
359
360 printf(" (%s)", dsoname);
361 } 353 }
362} 354}
363 355