perf_callchain_store() return 0 on success, -1 otherwise, fix
callchain_trace() to return correct bool value. So walk_stackframe() can
have a chance to stop walking the stack ahead.
Fixes: 70ccc7c0667b ("ARM: 9258/1: stacktrace: Make stack walk callback consistent with generic code")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm/kernel/perf_callchain.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm/kernel/perf_callchain.c b/arch/arm/kernel/perf_callchain.c
index 7147edbe56c6..1d230ac9d0eb 100644
--- a/arch/arm/kernel/perf_callchain.c
+++ b/arch/arm/kernel/perf_callchain.c
@@ -85,8 +85,7 @@ static bool
callchain_trace(void *data, unsigned long pc)
{
struct perf_callchain_entry_ctx *entry = data;
- perf_callchain_store(entry, pc);
- return true;
+ return perf_callchain_store(entry, pc) == 0;
}
void
--
2.34.1
On Tue, Jun 18, 2024 at 5:23 AM Jinjie Ruan <ruanjinjie@huawei.com> wrote:
> perf_callchain_store() return 0 on success, -1 otherwise, fix
> callchain_trace() to return correct bool value. So walk_stackframe() can
> have a chance to stop walking the stack ahead.
>
> Fixes: 70ccc7c0667b ("ARM: 9258/1: stacktrace: Make stack walk callback consistent with generic code")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Please put this into Russell's patch tracker.
Yours,
Linus Walleij
On 2024/6/26 17:50, Linus Walleij wrote:
> On Tue, Jun 18, 2024 at 5:23 AM Jinjie Ruan <ruanjinjie@huawei.com> wrote:
>
>> perf_callchain_store() return 0 on success, -1 otherwise, fix
>> callchain_trace() to return correct bool value. So walk_stackframe() can
>> have a chance to stop walking the stack ahead.
>>
>> Fixes: 70ccc7c0667b ("ARM: 9258/1: stacktrace: Make stack walk callback consistent with generic code")
>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Please put this into Russell's patch tracker.
Thank you, I'll put it, and could you please help to review another patch?
>
> Yours,
> Linus Walleij
© 2016 - 2025 Red Hat, Inc.