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

Akihiro Nagai
2011-07-22T04:25:45Z

(2011/07/21 23:39), David Ahern wrote:
> 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.
I agree.
In the next patch set, I'd like to unify the all expressions to "[unknown]".

Thank you.
>
> David