+2016-10-28 Markus Metzger <markus.t.metzger@intel.com>
+
+ * btrace.c (ftrace_update_function): Update tail call heuristic.
+
2016-10-28 Markus Metzger <markus.t.metzger@intel.com>
* btrace.c (btrace_compute_ftrace_bts, ftrace_add_pt): Allow
start = get_pc_function_start (pc);
+ /* A jump to the start of a function is (typically) a tail call. */
+ if (start == pc)
+ return ftrace_new_tailcall (bfun, mfun, fun);
+
/* If we can't determine the function for PC, we treat a jump at
- the end of the block as tail call. */
- if (start == 0 || start == pc)
+ the end of the block as tail call if we're switching functions
+ and as an intra-function branch if we don't. */
+ if (start == 0 && ftrace_function_switched (bfun, mfun, fun))
return ftrace_new_tailcall (bfun, mfun, fun);
+
+ break;
}
}
}