On 03/06/2026 12:06 pm, Leo Yan wrote:
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
noinline seems to be used as standard across the tools codebase, so if it doesn't work there are bigger problems. Perf also only really seems to support GCC and Clang and they both work for this test.
And I don't actually think it matters if this is inlined or not as long as the debug info reports those lines as being in this function. That's what what having it as a global symbol is supposed to achieve, but that's about renaming rather than inlining. Maybe inline is over the top, but its a pattern copied from other similar workloads and tests.
Probably makes sense to wait for an actual failure to appear and then we can decide what to do with it then.