perf probe: Add --no-inlines option to avoid searching inline functions
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Fri, 8 May 2015 01:03:33 +0000 (10:03 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 8 May 2015 19:26:44 +0000 (16:26 -0300)
Add --no-inlines(--inlines) option to avoid searching inline functions.

Searching all functions which matches glob pattern can take a long time
and find a lot of inline functions.

With this option perf-probe searches target on the non-inlined
functions.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150508010333.24812.86568.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-probe.txt
tools/perf/builtin-probe.c
tools/perf/util/probe-event.h
tools/perf/util/probe-finder.c

index ad3e355adc1f0e2b2c7372b9454165e96c6c2181..3a8a9ba2b0412aba28f1796e283106f84ec63266 100644 (file)
@@ -83,6 +83,10 @@ OPTIONS
        (Only for --vars) Show external defined variables in addition to local
        variables.
 
+--no-inlines::
+       (Only for --add) Search only for non-inlined functions. The functions
+       which do not have instances are ignored.
+
 -F::
 --funcs[=FILTER]::
        Show available functions in given module or kernel. With -x/--exec,
index dbc998f21281a3070e3ac31b4c99d7ca4ac7ae63..7fa2c7a1086a6f8b34a385cfa642566754b9499b 100644 (file)
@@ -379,6 +379,8 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
        OPT_CALLBACK('m', "module", NULL, "modname|path",
                "target module name (for online) or path (for offline)",
                opt_set_target),
+       OPT_BOOLEAN('\0', "no-inlines", &probe_conf.no_inlines,
+               "Don't search inlined functions"),
 #endif
        OPT__DRY_RUN(&probe_event_dry_run),
        OPT_INTEGER('\0', "max-probes", &probe_conf.max_probes,
index db9a9cb2d2af70387f96ec386a4c204d8049ce65..633aba77e0cb6666de06eb289891b4a4209035ba 100644 (file)
@@ -10,6 +10,7 @@
 struct probe_conf {
        bool    show_ext_vars;
        bool    force_add;
+       bool    no_inlines;
        int     max_probes;
 };
 extern struct probe_conf probe_conf;
index f4f5eed00c7d1c60c7a66402b38b4afe86324198..1713421112f873a4dd8e1e6875aa04696d9e77bc 100644 (file)
@@ -943,7 +943,7 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
                        /* TODO: Check the address in this function */
                        param->retval = call_probe_finder(sp_die, pf);
                }
-       } else
+       } else if (!probe_conf.no_inlines)
                /* Inlined function: search instances */
                param->retval = die_walk_instances(sp_die,
                                        probe_point_inline_cb, (void *)pf);