Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate thefailure of resolving symbols

From: David Ahern
Date: Thu Jul 21 2011 - 10:39:57 EST


On 07/21/2011 03:36 AM, Akihiro Nagai wrote
>> Evidently I had the shift key down -- s/{}/[]/. :-) And I see now, for
>> dsoname you have [unknown] and for symname (unknown). Use the same for
>> both. Since () is already used for separating dsoname, use [unknown] for
>> both
> At print_sample_start() in builtin-script.c, there is the code that
> print "(unknown)"
> when perf cannnot resolve the event name.
>
> printf("%s: ", evname ? evname : "(unknown)");
>
> On the other hand, at hist_entry__dso_snprintf() in util/sort.c, there
> is the code
> prints "[unknown]" for unresolvable DSO name.
>
> return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");
>
> In addition, perf uses "[]" for DSO name for example "[kernel.kallsyms]".
> So, I chose it. However, this specification is not easy for user-scripts.
> Should I unify this expression?

That was my thought -- to use the same for both dso and sym if it is
unknown. And since DSO names are wrapped in () use "[unknown]" for both
-- ie., right now the format is "symname (dsoname)" (though kernel syms
from kallsyms come out as "symname ([kernel.kallsyms])"). With an
unknown it will be "[unknown] (dsoname)" or "[unknown] ([unknown])"
which retains the number of fields in a uniquely parse-able way.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/