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

From: Carl Worth
Date: Thu Jul 11 2024 - 17:34:15 EST


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.

-Carl