perf probe: Skip same probe address for a given line
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 19 Sep 2019 03:41:10 +0000 (12:41 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 20 Sep 2019 18:22:00 +0000 (15:22 -0300)
commit1a375ae7659ab740d4c885ea98c1659b8a6e2071
treec5d7ae0684b4aaa2c74e98d56c5011b4958880cb
parent0216234c2eed1367a318daeb9f4a97d8217412a0
perf probe: Skip same probe address for a given line

Fix to skip making a same probe address on given line.

Since a DWARF line info contains several entries for one line with
different column, perf probe will make a different probe on same address
if user specifies a probe point by "function:line" or "file:line".

e.g.
 $ perf probe -D kernel_read:8
 p:probe/kernel_read_L8 kernel_read+39
 p:probe/kernel_read_L8_1 kernel_read+39

This skips such duplicated probe addresses.

Committer testing:

  # uname -a
  Linux quaco 5.3.0+ #2 SMP Thu Sep 19 16:13:22 -03 2019 x86_64 x86_64 x86_64 GNU/Linux
  #

Before:

  # perf probe -D kernel_read:8
  p:probe/kernel_read _text+3115191
  p:probe/kernel_read_1 _text+3115191
  #

After:

  # perf probe -D kernel_read:8
  p:probe/kernel_read _text+3115191
  #

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lore.kernel.org/lkml/156886447061.10772.4261569305869149178.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-finder.c