Re: [PATCH v6 39/42] x86/resctrl: Split trace.h

From: Reinette Chatre
Date: Thu Feb 20 2025 - 00:45:40 EST


Hi James,

On 2/7/25 10:18 AM, James Morse wrote:
> trace.h contains all the tracepoints. After the move to /fs/resctrl, some
> of these will be left behind. All the pseudo_lock tracepoints remain part
> of the architecture. The lone tracepoint in monitor.c moves to /fs/resctrl.
>
> Split trace.h so that each C file includes a different trace header file.
> This means the trace header files are not modified when they are moved.
>
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> Tested-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---

I did not investigate if this originates here or after the code move but
when compiling the series (after running the file move script) with W=1
I see the following:

In file included from /home/reinette/dev/linux/include/trace/trace_events.h:27,
from /home/reinette/dev/linux/include/trace/define_trace.h:113,
from /home/reinette/dev/linux/arch/x86/kernel/cpu/resctrl/monitor_trace.h:17,
from /home/reinette/dev/linux/arch/x86/kernel/cpu/resctrl/monitor.c:32:
/home/reinette/dev/linux/include/trace/stages/init.h:2:23: warning: ‘str__resctrl__trace_system_name’ defined but not used [-Wunused-const-variable=]
2 | #define __app__(x, y) str__##x##y
| ^~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:3:21: note: in expansion of macro ‘__app__’
3 | #define __app(x, y) __app__(x, y)
| ^~~~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:5:29: note: in expansion of macro ‘__app’
5 | #define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
| ^~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:8:27: note: in expansion of macro ‘TRACE_SYSTEM_STRING’
8 | static const char TRACE_SYSTEM_STRING[] = \
| ^~~~~~~~~~~~~~~~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:11:1: note: in expansion of macro ‘TRACE_MAKE_SYSTEM_STR’
11 | TRACE_MAKE_SYSTEM_STR();
| ^~~~~~~~~~~~~~~~~~~~~
[SNIP]
In file included from /home/reinette/dev/linux/include/trace/trace_events.h:27,
from /home/reinette/dev/linux/include/trace/define_trace.h:113,
from /home/reinette/dev/linux/fs/resctrl/pseudo_lock_trace.h:17,
from /home/reinette/dev/linux/fs/resctrl/pseudo_lock.c:34:
/home/reinette/dev/linux/include/trace/stages/init.h:2:23: warning: ‘str__resctrl__trace_system_name’ defined but not used [-Wunused-const-variable=]
2 | #define __app__(x, y) str__##x##y
| ^~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:3:21: note: in expansion of macro ‘__app__’
3 | #define __app(x, y) __app__(x, y)
| ^~~~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:5:29: note: in expansion of macro ‘__app’
5 | #define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
| ^~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:8:27: note: in expansion of macro ‘TRACE_SYSTEM_STRING’
8 | static const char TRACE_SYSTEM_STRING[] = \
| ^~~~~~~~~~~~~~~~~~~
/home/reinette/dev/linux/include/trace/stages/init.h:11:1: note: in expansion of macro ‘TRACE_MAKE_SYSTEM_STR’
11 | TRACE_MAKE_SYSTEM_STR();
| ^~~~~~~~~~~~~~~~~~~~~

[SNIP]

Reinette