Re: [PATCH v3 23/38] x86/resctrl: Allow an architecture to disable pseudo lock

From: James Morse
Date: Fri Aug 02 2024 - 13:22:43 EST


Hi Carl,

On 11/07/2024 22:33, Carl Worth wrote:
> James Morse <james.morse@xxxxxxx> writes:
>> diff --git a/arch/x86/kernel/cpu/resctrl/Makefile b/arch/x86/kernel/cpu/resctrl/Makefile
>> index 4a06c37b9cf1..0c13b0befd8a 100644
>> --- a/arch/x86/kernel/cpu/resctrl/Makefile
>> +++ b/arch/x86/kernel/cpu/resctrl/Makefile
>> @@ -1,4 +1,5 @@
>> # SPDX-License-Identifier: GPL-2.0
>> -obj-$(CONFIG_X86_CPU_RESCTRL) += core.o rdtgroup.o monitor.o
>> -obj-$(CONFIG_X86_CPU_RESCTRL) += ctrlmondata.o pseudo_lock.o
>> +obj-$(CONFIG_X86_CPU_RESCTRL) += core.o rdtgroup.o monitor.o
>> +obj-$(CONFIG_X86_CPU_RESCTRL) += ctrlmondata.o
>> +obj-$(CONFIG_RESCTRL_FS_PSEUDO_LOCK) += pseudo_lock.o
>> CFLAGS_pseudo_lock.o = -I$(src)
>
> Now that pseudo_lock.c is only conditionally compiled, the work it's
> doing to define tracepoints, (that is, #define CREATE_TRACE_POINTS),
> should be moved to monitor.c which is unconditionally compiled.
>
> And then, the CFLAGS line above should be adjusted to apply to
> the compilation of monitor.c, that is:
>
> CFLAGS_monitor.o = -I$(src)

> Without these changes, compiling without CONFIG_RESCTRL_FS_PSEUDO_LOCK
> will fail due to undefined tracepoint functions.

Thanks for catching this - I bashed my head against it for a while.

I've split trace.h in two: monitor_trace.h and pseudo_lock_trace.h. When the code gets
moved to /fs/ only one of those files moves.


Thanks,

James