On Tue, Jan 21, 2025 at 10:06 PM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote: > > On Tue, Jan 21, 2025 at 01:54:31PM -0800, Gwendal Grignou wrote: > > On Mon, Jan 20, 2025 at 12:50 AM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote: > > > > > > On Sat, Jan 18, 2025 at 04:33:52PM +0000, Jonathan Cameron wrote: > > > > I briefly applied this, but... > > > > > > > > [jic23@jic23-huawei iio]$ make LOCALVERSION= W=1 -j12 C=1 > > > > mkdir -p /home/jic23/src/kernel/iio/tools/objtool && make O=/home/jic23/src/kernel/iio subdir=tools/objtool --no-print-directory -C objtool > > > > CALL scripts/checksyscalls.sh > > > > INSTALL libsubcmd_headers > > > > CC [M] drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.o > > > > CC [M] drivers/iio/common/cros_ec_sensors/cros_ec_sensors_trace.o > > > > In file included from drivers/iio/common/cros_ec_sensors/cros_ec_sensors_trace.h:56, > > > > from drivers/iio/common/cros_ec_sensors/cros_ec_sensors_trace.c:32: > > > > ./include/trace/define_trace.h:106:42: fatal error: ./cros_ec_sensors_trace.h: No such file or directory > > > > 106 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > > > | ^ > > > > > > > > Despite dealing with trace points a lot in the day job > > > > I still find them hard to actually add to a subsystem because > > > > of fun things like this one. > > I reproduced this error on a fresh kernel source tree. I suspect an > > issue with sparse, as other trace.c files use __CHECKER__ macros. For > > instance `drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c`: > > > > 10 /* sparse doesn't like tracepoint macros */ > > 11 #ifndef __CHECKER__ > > ... > > I still can't reproduce the error by using a just-cloned kernel source tree > with C=1. Could you provide some more details about your steps? I'm > wondering about which steps I may miss. first, I checked sparse is new enough: sparse --version 0.6.4 (Debian: 0.6.4-4) Then mkdir linux-iio cd linux-iio git init git remote add iio git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git git fetch iio git checkout -b togreg iio/togreg git am ...-sensors-command.patch make menuconfig # accept the default make LOCALVERSION= W=1 -j12 C=1 But there is still a mystery: looking around, there is no consensus for TRACE_INCLUDE_PATH. Out of 157 definitions, 107 uses `.`, 39 uses `../../drivers/....`, and 10 something else: find drivers/ -name \*trace\*h -exec grep -re "^#define TRACE_INCLUDE_PATH " {} \+ | wc -l 156 find drivers/ -name \*trace\*h -exec grep -re "^#define TRACE_INCLUDE_PATH .$" {} \+ | wc -l 107 find drivers/ -name \*trace\*h -exec grep -re "^#define TRACE_INCLUDE_PATH ../../drivers" {} \+ | wc -l 39 I am guessing it depends on the included paths added to the command line used to invoke the compiler.