Skip to content

Commit 270f00b

Browse files
James Morsebp3tk0v
authored andcommitted
x86/resctrl: Split trace.h
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@arm.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Fenghua Yu <fenghuay@nvidia.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64 Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64 Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/20250515165855.31452-14-james.morse@arm.com
1 parent 2a65660 commit 270f00b

File tree

5 files changed

+42
-22
lines changed

5 files changed

+42
-22
lines changed

arch/x86/kernel/cpu/resctrl/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
obj-$(CONFIG_X86_CPU_RESCTRL) += core.o rdtgroup.o monitor.o
33
obj-$(CONFIG_X86_CPU_RESCTRL) += ctrlmondata.o
44
obj-$(CONFIG_RESCTRL_FS_PSEUDO_LOCK) += pseudo_lock.o
5+
6+
# To allow define_trace.h's recursive include:
57
CFLAGS_pseudo_lock.o = -I$(src)
8+
CFLAGS_monitor.o = -I$(src)

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#include <asm/resctrl.h>
2727

2828
#include "internal.h"
29-
#include "trace.h"
29+
30+
#define CREATE_TRACE_POINTS
31+
#include "monitor_trace.h"
3032

3133
/**
3234
* struct rmid_entry - dirty tracking for all RMID.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#undef TRACE_SYSTEM
3+
#define TRACE_SYSTEM resctrl
4+
5+
#if !defined(_FS_RESCTRL_MONITOR_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
6+
#define _FS_RESCTRL_MONITOR_TRACE_H
7+
8+
#include <linux/tracepoint.h>
9+
10+
TRACE_EVENT(mon_llc_occupancy_limbo,
11+
TP_PROTO(u32 ctrl_hw_id, u32 mon_hw_id, int domain_id, u64 llc_occupancy_bytes),
12+
TP_ARGS(ctrl_hw_id, mon_hw_id, domain_id, llc_occupancy_bytes),
13+
TP_STRUCT__entry(__field(u32, ctrl_hw_id)
14+
__field(u32, mon_hw_id)
15+
__field(int, domain_id)
16+
__field(u64, llc_occupancy_bytes)),
17+
TP_fast_assign(__entry->ctrl_hw_id = ctrl_hw_id;
18+
__entry->mon_hw_id = mon_hw_id;
19+
__entry->domain_id = domain_id;
20+
__entry->llc_occupancy_bytes = llc_occupancy_bytes;),
21+
TP_printk("ctrl_hw_id=%u mon_hw_id=%u domain_id=%d llc_occupancy_bytes=%llu",
22+
__entry->ctrl_hw_id, __entry->mon_hw_id, __entry->domain_id,
23+
__entry->llc_occupancy_bytes)
24+
);
25+
26+
#endif /* _FS_RESCTRL_MONITOR_TRACE_H */
27+
28+
#undef TRACE_INCLUDE_PATH
29+
#define TRACE_INCLUDE_PATH .
30+
#define TRACE_INCLUDE_FILE monitor_trace
31+
#include <trace/define_trace.h>

arch/x86/kernel/cpu/resctrl/pseudo_lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "internal.h"
3131

3232
#define CREATE_TRACE_POINTS
33-
#include "trace.h"
33+
#include "pseudo_lock_trace.h"
3434

3535
/*
3636
* The bits needed to disable hardware prefetching varies based on the

arch/x86/kernel/cpu/resctrl/trace.h renamed to arch/x86/kernel/cpu/resctrl/pseudo_lock_trace.h

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#undef TRACE_SYSTEM
33
#define TRACE_SYSTEM resctrl
44

5-
#if !defined(_TRACE_RESCTRL_H) || defined(TRACE_HEADER_MULTI_READ)
6-
#define _TRACE_RESCTRL_H
5+
#if !defined(_X86_RESCTRL_PSEUDO_LOCK_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
6+
#define _X86_RESCTRL_PSEUDO_LOCK_TRACE_H
77

88
#include <linux/tracepoint.h>
99

@@ -35,25 +35,9 @@ TRACE_EVENT(pseudo_lock_l3,
3535
TP_printk("hits=%llu miss=%llu",
3636
__entry->l3_hits, __entry->l3_miss));
3737

38-
TRACE_EVENT(mon_llc_occupancy_limbo,
39-
TP_PROTO(u32 ctrl_hw_id, u32 mon_hw_id, int domain_id, u64 llc_occupancy_bytes),
40-
TP_ARGS(ctrl_hw_id, mon_hw_id, domain_id, llc_occupancy_bytes),
41-
TP_STRUCT__entry(__field(u32, ctrl_hw_id)
42-
__field(u32, mon_hw_id)
43-
__field(int, domain_id)
44-
__field(u64, llc_occupancy_bytes)),
45-
TP_fast_assign(__entry->ctrl_hw_id = ctrl_hw_id;
46-
__entry->mon_hw_id = mon_hw_id;
47-
__entry->domain_id = domain_id;
48-
__entry->llc_occupancy_bytes = llc_occupancy_bytes;),
49-
TP_printk("ctrl_hw_id=%u mon_hw_id=%u domain_id=%d llc_occupancy_bytes=%llu",
50-
__entry->ctrl_hw_id, __entry->mon_hw_id, __entry->domain_id,
51-
__entry->llc_occupancy_bytes)
52-
);
53-
54-
#endif /* _TRACE_RESCTRL_H */
38+
#endif /* _X86_RESCTRL_PSEUDO_LOCK_TRACE_H */
5539

5640
#undef TRACE_INCLUDE_PATH
5741
#define TRACE_INCLUDE_PATH .
58-
#define TRACE_INCLUDE_FILE trace
42+
#define TRACE_INCLUDE_FILE pseudo_lock_trace
5943
#include <trace/define_trace.h>

0 commit comments

Comments
 (0)