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>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
f9d3699656
commit
547a92e0ae
@@ -300,7 +300,7 @@ static void print_sample_start(struct perf_sample *sample,
|
||||
} else
|
||||
evname = __event_name(attr->type, attr->config);
|
||||
|
||||
printf("%s: ", evname ? evname : "(unknown)");
|
||||
printf("%s: ", evname ? evname : "[unknown]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,6 @@ static void print_sample_addr(union perf_event *event,
|
||||
{
|
||||
struct addr_location al;
|
||||
u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
|
||||
const char *symname, *dsoname;
|
||||
|
||||
printf("%16" PRIx64, sample->addr);
|
||||
|
||||
@@ -343,21 +342,14 @@ static void print_sample_addr(union perf_event *event,
|
||||
al.sym = map__find_symbol(al.map, al.addr, NULL);
|
||||
|
||||
if (PRINT_FIELD(SYM)) {
|
||||
if (al.sym && al.sym->name)
|
||||
symname = al.sym->name;
|
||||
else
|
||||
symname = "";
|
||||
|
||||
printf(" %16s", symname);
|
||||
printf(" ");
|
||||
symbol__fprintf_symname(al.sym, stdout);
|
||||
}
|
||||
|
||||
if (PRINT_FIELD(DSO)) {
|
||||
if (al.map && al.map->dso && al.map->dso->name)
|
||||
dsoname = al.map->dso->name;
|
||||
else
|
||||
dsoname = "";
|
||||
|
||||
printf(" (%s)", dsoname);
|
||||
printf(" (");
|
||||
map__fprintf_dsoname(al.map, stdout);
|
||||
printf(")");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user