Re: [PATCH 07/19] perf top: Use new idle_sym check

Arnaldo Carvalho de Melo
2013-08-09T13:53:19Z

Em Thu, Aug 08, 2013 at 10:49:24PM -0400, David Ahern escreveu:
> On 8/8/13 11:06 AM, Arnaldo Carvalho de Melo wrote:
> >Em Wed, Aug 07, 2013 at 10:50:49PM -0400, David Ahern escreveu:
> >>Avoids strcmp processing each sample.
> >
> >How so? This is done just when loading a DSO, when then each symbol is
> >checked against this list.
>
> hmmm.... see that now, yes. The timehist command wants to know idle
> times, not just filter them out like perf-top does.

'perf top' shouldn't just discard idle symbols, but group them in a
special hist_entry, that should be displayed at the top, etc, but this
is another issue, what matters here is that it doesn't "filters" in the
sense of symbol_filter_t, it returns 0 if the symbol name matches one of
the entries in that skip_list, which marks symbol->ignore, but it is
still in the rb_tree. Being "discarded" only later, when processing the
sample.

The only thing it really filters out are these symtab entries:

if (!strcmp(name, "_text") ||
!strcmp(name, "_etext") ||
!strcmp(name, "_sinittext") ||
!strncmp("init_module", name, 11) ||
!strncmp("cleanup_module", name, 14) ||
strstr(name, "_text_start") ||
strstr(name, "_text_end"))
return 1;

Those I think could be pruned somehow in dso__load_{kallsyms|kernel}*(),
like some other symbols are already (SyS_).

With this in mind, would using the same scheme Ok for you?

- Arnaldo