Re: [PATCH v2 03/18] perf test: Add a workload that forces context switches

From: Leo Yan

Date: Wed Jun 03 2026 - 07:27:41 EST


On Tue, Jun 02, 2026 at 03:26:45PM +0100, James Clark wrote:

[...]

> +/* Not static to avoid LTO clobbering the function name */
> +void context_switch_loop_proc1(int in_fd, int out_fd);
> +noinline void context_switch_loop_proc1(int in_fd, int out_fd)
> +{
> + for (int i = 0; i < loops; i++) {
> + read_block(in_fd);
> + context_switch_loop_work += i * 3;
> + write_block(out_fd);
> + }
> +}

Rather than struggling with unexpected options, and "noinline" might
not work as it is not a standard compiler option (it is defined in
kernel header as AI reminded me), wouldn't it is reliable to use a
dedicated CFLAG rule same as other programs?

Thanks,
Leo