perf probe: Ignore tail calls to probed functions
[firefly-linux-kernel-4.4.55.git] / tools / perf / util / probe-finder.c
index 590a24a7f5559d4c2a9caa500b7e0460eea1c21d..c50da392e2562a377e3efa9464e257f27075bcea 100644 (file)
@@ -674,9 +674,15 @@ static int call_probe_finder(Dwarf_Die *sc_die, struct probe_finder *pf)
        /* If not a real subprogram, find a real one */
        if (!die_is_func_def(sc_die)) {
                if (!die_find_realfunc(&pf->cu_die, pf->addr, &pf->sp_die)) {
-                       pr_warning("Failed to find probe point in any "
-                                  "functions.\n");
-                       return -ENOENT;
+                       if (die_find_tailfunc(&pf->cu_die, pf->addr, &pf->sp_die)) {
+                               pr_warning("Ignoring tail call from %s\n",
+                                               dwarf_diename(&pf->sp_die));
+                               return 0;
+                       } else {
+                               pr_warning("Failed to find probe point in any "
+                                          "functions.\n");
+                               return -ENOENT;
+                       }
                }
        } else
                memcpy(&pf->sp_die, sc_die, sizeof(Dwarf_Die));