Commit 1500b93b authored by Feng Tang's avatar Feng Tang Committed by Arnaldo Carvalho de Melo

perf symbols: Filter samples with unresolved symbol when "--symbols" option is used

Report/top commands support to only handle specific symbols with
"--symbols" option, but current code will keep those samples whose
symbol can't be resolved, which should actually be filtered.

If we run following commands:
$perf record -a tree
$perf report --symbols intel_idle -n
the output will be:

Without the patch:
==================
    46.27%        156     sshd  [unknown]
    26.05%         48  swapper  [kernel.kallsyms]
    17.26%         38     tree  libc-2.12.1.so
     7.69%         17     tree  tree
     2.73%          6     tree  ld-2.12.1.so

With the patch:
===============
   100.00%         48  swapper  [kernel.kallsyms]
Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1347007349-3102-2-git-send-email-feng.tang@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 87ff50a3
...@@ -904,8 +904,9 @@ int perf_event__preprocess_sample(const union perf_event *event, ...@@ -904,8 +904,9 @@ int perf_event__preprocess_sample(const union perf_event *event,
al->sym = map__find_symbol(al->map, al->addr, filter); al->sym = map__find_symbol(al->map, al->addr, filter);
} }
if (symbol_conf.sym_list && al->sym && if (symbol_conf.sym_list &&
!strlist__has_entry(symbol_conf.sym_list, al->sym->name)) (!al->sym || !strlist__has_entry(symbol_conf.sym_list,
al->sym->name)))
goto out_filtered; goto out_filtered;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment