contrib/plugins/uftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
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
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
contrib/plugins/uftrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c
index e3c65a1c930..f974090e23e 100644
--- a/contrib/plugins/uftrace.c
+++ b/contrib/plugins/uftrace.c
@@ -817,7 +817,8 @@ static void track_callstack(unsigned int cpu_index, void *udata)
if (fp == caller.frame_pointer) {
/* return */
CallstackEntry e = callstack_pop(cs);
- trace_exit_function(t, timestamp, e.pc, callstack_depth(cs));
+ /* uftrace convention is to use same depth as entry */
+ trace_exit_function(t, timestamp, e.pc, callstack_depth(cs) + 1);
return;
}
--
2.47.3
On 3/12/26 11:34 PM, Pierrick Bouvier wrote: > 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 > > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > contrib/plugins/uftrace.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > This was merged into master (6667668e0cf369e47aa9dd0bae40989896e9ed9f). Regards, Pierrick
On 3/12/26 11:34 PM, Pierrick Bouvier wrote: > 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 > > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > contrib/plugins/uftrace.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Auto review to send this for hard freeze. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
On 3/12/26 11:34 PM, Pierrick Bouvier wrote:
> 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
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> contrib/plugins/uftrace.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/plugins/uftrace.c b/contrib/plugins/uftrace.c
> index e3c65a1c930..f974090e23e 100644
> --- a/contrib/plugins/uftrace.c
> +++ b/contrib/plugins/uftrace.c
> @@ -817,7 +817,8 @@ static void track_callstack(unsigned int cpu_index, void *udata)
> if (fp == caller.frame_pointer) {
> /* return */
> CallstackEntry e = callstack_pop(cs);
> - trace_exit_function(t, timestamp, e.pc, callstack_depth(cs));
> + /* uftrace convention is to use same depth as entry */
> + trace_exit_function(t, timestamp, e.pc, callstack_depth(cs) + 1);
> return;
> }
>
This is good candidate for stable releases also.
Thanks,
Pierrick
© 2016 - 2026 Red Hat, Inc.