I'm observing the following issue:
$ sudo /usr/share/bcc/tools/opensnoop
In file included from /virtual/main.c:2:
In file included from include/uapi/linux/ptrace.h:142:
In file included from ./arch/x86/include/asm/ptrace.h:5:
./arch/x86/include/asm/segment.h:254:2: error: expected '(' after 'asm'
alternative_io ("lsl %[seg],%[p]",
^
./arch/x86/include/asm/alternative.h:240:2: note: expanded from macro 'alternative_io'
asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
^
include/linux/compiler_types.h:210:24: note: expanded from macro 'asm_inline'
#define asm_inline asm __inline
^
The cause appears to be this commit landed in 5.4.0-rc1:
If I replace asm_inline with asm in the kernel headers, it works just fine.
I do have CONFIG_CC_HAS_ASM_INLINE=y:
The kernel is compiled with GCC 9.2.0, BCC is using LLVM9.
Adding the following at the very top of opensnoop C code also works:
#ifdef asm_inline
#undef asm_inline
#define asm_inline asm
#endif
Should I make a PR to insert this in BFrontendAction::DoMiscWorkAround() or is there a better way?
Could you add the workaround to helpers.h? There is already asm_volatile_goto workaround there?
Yes, please do help submit a pull request. Thanks!
Most helpful comment
Adding the following at the very top of opensnoop C code also works:
Should I make a PR to insert this in
BFrontendAction::DoMiscWorkAround()or is there a better way?