@samitouri / QOSamiQemu / commits / 48221e3716

contrib/plugins/uftrace.c: fix depth for exit events

Uftrace plugin was recording wrong depth for exit events, resulting in incoherent traces, especially for partial ones. Thanks to Honggyu Kim, one of the original author of uftrace, who spotted the issue. https://github.com/namhyung/uftrace/pull/2031#issuecomment-4051762627 Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Link: https://lore.kernel.org/qemu-devel/20260313063441.2048882-1-pierrick.bouvier@linaro.org Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Pierrick Bouvier committed Mar 12, 2026 at 23:34 UTC 48221e371686f7704f150aafe46b76bb9306c7b6
1 file changed +2 -1
contrib/plugins/uftrace.c
+2 -1
@@ -817,7 +817,8 @@ static void track_callstack(unsigned int cpu_index, void *udata)
817 if (fp == caller.frame_pointer) {
818 /* return */
819 CallstackEntry e = callstack_pop(cs);
820 - trace_exit_function(t, timestamp, e.pc, callstack_depth(cs));
820 + /* uftrace convention is to use same depth as entry */
821 + trace_exit_function(t, timestamp, e.pc, callstack_depth(cs) + 1);
822 return;
823 }
824