Re: [PATCH v7 7/8] perf tests: add noinline to __test_function
From: Jesse Taube
Date: Tue Oct 27 2026 - 15:52:48 EST
On Wed, Sep 30, 2026 at 2:40 AM Himanshu Chauhan
<himanshu.chauhan@xxxxxxxxxxxxxxxx> wrote:
>
> In the breakpoint signal handler test, a breakpoint is set on
> __test_function. Compiler may optimize and inline __test_function.
> This causes failure in the test.
>
> Add noinline to __test_function so that it is not inlined.
>
> Signed-off-by: Himanshu Chauhan <himanshu.chauhan@xxxxxxxxxxxxxxxx>
Reviewed-by: Jesse Taube <jtaubepe@xxxxxxxxxx>
I would resend this to the perf list and not in a patch set as it is a
separate fix.
There is also another fix to data_breakpoint.c that i have been
meaning to send here:
https://github.com/Mr-Bossman/linux/commit/db4faa52a66f6b7265cd397a2d44d7d38c3fdfb7
Thanks,
Jesse Taube
> ---
> tools/perf/tests/bp_signal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
> index f580ba7486b1..cc4a27224884 100644
> --- a/tools/perf/tests/bp_signal.c
> +++ b/tools/perf/tests/bp_signal.c
> @@ -54,7 +54,7 @@ asm (
> "ret\n"
> ".popsection\n");
> #else
> -static void __test_function(volatile long *ptr)
> +static noinline void __test_function(volatile long *ptr)
> {
> *ptr = 0x1234;
> }
> --
> 2.43.0
>