linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Fenghua Yu <fenghua.yu@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	H Peter Anvin <hpa@zytor.com>, Babu Moger <Babu.Moger@amd.com>,
	James Morse <james.morse@arm.com>,
	shameerali.kolothum.thodi@huawei.com,
	D Scott Phillips OS <scott@os.amperecomputing.com>,
	carl@os.amperecomputing.com, lcherian@marvell.com,
	bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com,
	baolin.wang@linux.alibaba.com,
	Jamie Iles <quic_jiles@quicinc.com>,
	Xin Hao <xhao@linux.alibaba.com>,
	peternewman@google.com, dfustini@baylibre.com,
	amitsinght@marvell.com, David Hildenbrand <david@redhat.com>,
	Rex Nie <rex.nie@jaguarmicro.com>,
	Dave Martin <dave.martin@arm.com>,
	Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Subject: [PATCH v5 37/40] x86/resctrl: Split trace.h
Date: Fri,  4 Oct 2024 18:03:44 +0000	[thread overview]
Message-ID: <20241004180347.19985-38-james.morse@arm.com> (raw)
In-Reply-To: <20241004180347.19985-1-james.morse@arm.com>

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>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
---
 arch/x86/kernel/cpu/resctrl/Makefile          |  3 ++
 arch/x86/kernel/cpu/resctrl/monitor.c         |  4 ++-
 arch/x86/kernel/cpu/resctrl/monitor_trace.h   | 31 +++++++++++++++++++
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c     |  2 +-
 .../resctrl/{trace.h => pseudo_lock_trace.h}  | 24 +++-----------
 5 files changed, 42 insertions(+), 22 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/resctrl/monitor_trace.h
 rename arch/x86/kernel/cpu/resctrl/{trace.h => pseudo_lock_trace.h} (56%)

diff --git a/arch/x86/kernel/cpu/resctrl/Makefile b/arch/x86/kernel/cpu/resctrl/Makefile
index 0c13b0befd8a..909be78ec6da 100644
--- a/arch/x86/kernel/cpu/resctrl/Makefile
+++ b/arch/x86/kernel/cpu/resctrl/Makefile
@@ -2,4 +2,7 @@
 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
+
+# To allow define_trace.h's recursive include:
 CFLAGS_pseudo_lock.o = -I$(src)
+CFLAGS_monitor.o = -I$(src)
diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
index 1fd47f8a0e18..b7662782ea59 100644
--- a/arch/x86/kernel/cpu/resctrl/monitor.c
+++ b/arch/x86/kernel/cpu/resctrl/monitor.c
@@ -26,7 +26,9 @@
 #include <asm/resctrl.h>
 
 #include "internal.h"
-#include "trace.h"
+
+#define CREATE_TRACE_POINTS
+#include "monitor_trace.h"
 
 /**
  * struct rmid_entry - dirty tracking for all RMID.
diff --git a/arch/x86/kernel/cpu/resctrl/monitor_trace.h b/arch/x86/kernel/cpu/resctrl/monitor_trace.h
new file mode 100644
index 000000000000..ade67daf42c2
--- /dev/null
+++ b/arch/x86/kernel/cpu/resctrl/monitor_trace.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM resctrl
+
+#if !defined(_FS_RESCTRL_MONITOR_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _FS_RESCTRL_MONITOR_TRACE_H
+
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(mon_llc_occupancy_limbo,
+	    TP_PROTO(u32 ctrl_hw_id, u32 mon_hw_id, int domain_id, u64 llc_occupancy_bytes),
+	    TP_ARGS(ctrl_hw_id, mon_hw_id, domain_id, llc_occupancy_bytes),
+	    TP_STRUCT__entry(__field(u32, ctrl_hw_id)
+			     __field(u32, mon_hw_id)
+			     __field(int, domain_id)
+			     __field(u64, llc_occupancy_bytes)),
+	    TP_fast_assign(__entry->ctrl_hw_id = ctrl_hw_id;
+			   __entry->mon_hw_id = mon_hw_id;
+			   __entry->domain_id = domain_id;
+			   __entry->llc_occupancy_bytes = llc_occupancy_bytes;),
+	    TP_printk("ctrl_hw_id=%u mon_hw_id=%u domain_id=%d llc_occupancy_bytes=%llu",
+		      __entry->ctrl_hw_id, __entry->mon_hw_id, __entry->domain_id,
+		      __entry->llc_occupancy_bytes)
+	   );
+
+#endif /* _FS_RESCTRL_MONITOR_TRACE_H */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_FILE monitor_trace
+#include <trace/define_trace.h>
diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
index 9bcd1d06b4e8..60ed5be212e1 100644
--- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
+++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
@@ -30,7 +30,7 @@
 #include "internal.h"
 
 #define CREATE_TRACE_POINTS
-#include "trace.h"
+#include "pseudo_lock_trace.h"
 
 /*
  * The bits needed to disable hardware prefetching varies based on the
diff --git a/arch/x86/kernel/cpu/resctrl/trace.h b/arch/x86/kernel/cpu/resctrl/pseudo_lock_trace.h
similarity index 56%
rename from arch/x86/kernel/cpu/resctrl/trace.h
rename to arch/x86/kernel/cpu/resctrl/pseudo_lock_trace.h
index 2a506316b303..5a0fae61d3ee 100644
--- a/arch/x86/kernel/cpu/resctrl/trace.h
+++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock_trace.h
@@ -2,8 +2,8 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM resctrl
 
-#if !defined(_TRACE_RESCTRL_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_RESCTRL_H
+#if !defined(_X86_RESCTRL_PSEUDO_LOCK_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _X86_RESCTRL_PSEUDO_LOCK_TRACE_H
 
 #include <linux/tracepoint.h>
 
@@ -35,25 +35,9 @@ TRACE_EVENT(pseudo_lock_l3,
 	    TP_printk("hits=%llu miss=%llu",
 		      __entry->l3_hits, __entry->l3_miss));
 
-TRACE_EVENT(mon_llc_occupancy_limbo,
-	    TP_PROTO(u32 ctrl_hw_id, u32 mon_hw_id, int domain_id, u64 llc_occupancy_bytes),
-	    TP_ARGS(ctrl_hw_id, mon_hw_id, domain_id, llc_occupancy_bytes),
-	    TP_STRUCT__entry(__field(u32, ctrl_hw_id)
-			     __field(u32, mon_hw_id)
-			     __field(int, domain_id)
-			     __field(u64, llc_occupancy_bytes)),
-	    TP_fast_assign(__entry->ctrl_hw_id = ctrl_hw_id;
-			   __entry->mon_hw_id = mon_hw_id;
-			   __entry->domain_id = domain_id;
-			   __entry->llc_occupancy_bytes = llc_occupancy_bytes;),
-	    TP_printk("ctrl_hw_id=%u mon_hw_id=%u domain_id=%d llc_occupancy_bytes=%llu",
-		      __entry->ctrl_hw_id, __entry->mon_hw_id, __entry->domain_id,
-		      __entry->llc_occupancy_bytes)
-	   );
-
-#endif /* _TRACE_RESCTRL_H */
+#endif /* _X86_RESCTRL_PSEUDO_LOCK_TRACE_H */
 
 #undef TRACE_INCLUDE_PATH
 #define TRACE_INCLUDE_PATH .
-#define TRACE_INCLUDE_FILE trace
+#define TRACE_INCLUDE_FILE pseudo_lock_trace
 #include <trace/define_trace.h>
-- 
2.39.2


  parent reply	other threads:[~2024-10-04 18:07 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 18:03 [PATCH v5 00/40] x86/resctrl: Move the resctrl filesystem code to /fs/resctrl James Morse
2024-10-04 18:03 ` [PATCH v5 01/40] x86/resctrl: Fix allocation of cleanest CLOSID on platforms with no monitors James Morse
2024-10-04 18:03 ` [PATCH v5 02/40] x86/resctrl: Add a helper to avoid reaching into the arch code resource list James Morse
2024-10-15 22:57   ` Tony Luck
2024-10-18 17:07     ` James Morse
2024-10-18 17:14       ` Luck, Tony
2024-10-23 21:03   ` Reinette Chatre
2024-10-04 18:03 ` [PATCH v5 03/40] x86/resctrl: Remove fflags from struct rdt_resource James Morse
2024-10-23 21:03   ` Reinette Chatre
2024-12-20 18:10     ` James Morse
2024-10-04 18:03 ` [PATCH v5 04/40] x86/resctrl: Use schema type to determine how to parse schema values James Morse
2024-10-15 23:15   ` Tony Luck
2024-10-18 17:07     ` James Morse
2024-10-23 21:14   ` Reinette Chatre
2024-12-20 18:10     ` James Morse
2024-10-04 18:03 ` [PATCH v5 05/40] x86/resctrl: Use schema type to determine the schema format string James Morse
2024-10-21 17:39   ` Reinette Chatre
2024-10-04 18:03 ` [PATCH v5 06/40] x86/resctrl: Remove data_width and the tabular format James Morse
2024-10-15 23:29   ` Tony Luck
2024-10-18 17:07     ` James Morse
2024-10-04 18:03 ` [PATCH v5 07/40] x86/resctrl: Add max_bw to struct resctrl_membw James Morse
2024-10-09 18:02   ` Tony Luck
2024-10-23 21:14   ` Reinette Chatre
2024-12-20 18:10     ` James Morse
2024-10-04 18:03 ` [PATCH v5 08/40] x86/resctrl: Generate default_ctrl instead of sharing it James Morse
2024-10-23 21:15   ` Reinette Chatre
2025-02-07 15:42     ` James Morse
2024-10-04 18:03 ` [PATCH v5 09/40] x86/resctrl: Add helper for setting CPU default properties James Morse
2024-10-04 18:03 ` [PATCH v5 10/40] x86/resctrl: Remove rdtgroup from update_cpu_closid_rmid() James Morse
2024-10-04 18:03 ` [PATCH v5 11/40] x86/resctrl: Export resctrl fs's init function James Morse
2024-10-16 16:20   ` Tony Luck
2024-10-04 18:03 ` [PATCH v5 12/40] x86/resctrl: Wrap resctrl_arch_find_domain() around rdt_find_domain() James Morse
2024-10-23 21:16   ` Reinette Chatre
2025-02-07 15:42     ` James Morse
2024-10-04 18:03 ` [PATCH v5 13/40] x86/resctrl: Move resctrl types to a separate header James Morse
2024-10-04 18:03 ` [PATCH v5 14/40] x86/resctrl: Add a resctrl helper to reset all the resources James Morse
2024-10-23 21:32   ` Reinette Chatre
2025-02-07 15:43     ` James Morse
2025-02-13 23:52       ` Reinette Chatre
2024-10-04 18:03 ` [PATCH v5 15/40] x86/resctrl: Move monitor exit work to a resctrl exit call James Morse
2024-10-04 18:03 ` [PATCH v5 16/40] x86/resctrl: Move monitor init work to a resctrl init call James Morse
2024-10-04 18:03 ` [PATCH v5 17/40] x86/resctrl: Rewrite and move the for_each_*_rdt_resource() walkers James Morse
2024-10-08  0:00   ` Tony Luck
2024-10-08 16:40     ` Reinette Chatre
2024-10-18 17:07       ` James Morse
2024-10-23 21:51   ` Reinette Chatre
2025-02-07 15:44     ` James Morse
2024-10-04 18:03 ` [PATCH v5 18/40] x86/resctrl: Export the is_mbm_*_enabled() helpers to asm/resctrl.h James Morse
2024-10-23 22:00   ` Reinette Chatre
2025-02-07 15:44     ` James Morse
2024-10-04 18:03 ` [PATCH v5 19/40] x86/resctrl: Add resctrl_arch_is_evt_configurable() to abstract BMEC James Morse
2024-10-23 22:04   ` Reinette Chatre
2025-02-07 15:44     ` James Morse
2024-10-04 18:03 ` [PATCH v5 20/40] x86/resctrl: Slightly clean-up mbm_config_show() James Morse
2024-10-16 16:50   ` Tony Luck
2024-10-04 18:03 ` [PATCH v5 21/40] x86/resctrl: Change mon_event_config_{read,write}() to be arch helpers James Morse
2024-10-23 22:19   ` Reinette Chatre
2025-02-07 15:45     ` James Morse
2024-10-04 18:03 ` [PATCH v5 22/40] x86/resctrl: Move mbm_cfg_mask to struct rdt_resource James Morse
2024-10-23 22:42   ` Reinette Chatre
2024-10-04 18:03 ` [PATCH v5 23/40] x86/resctrl: Add resctrl_arch_ prefix to pseudo lock functions James Morse
2024-10-23 22:44   ` Reinette Chatre
2025-02-07 15:45     ` James Morse
2024-10-04 18:03 ` [PATCH v5 24/40] x86/resctrl: Allow an architecture to disable pseudo lock James Morse
2024-10-04 18:03 ` [PATCH v5 25/40] x86/resctrl: Make prefetch_disable_bits belong to the arch code James Morse
2024-10-23 22:53   ` Reinette Chatre
2025-02-07 15:46     ` James Morse
2024-10-04 18:03 ` [PATCH v5 26/40] x86/resctrl: Make resctrl_arch_pseudo_lock_fn() take a plr James Morse
2024-10-04 18:03 ` [PATCH v5 27/40] x86/resctrl: Move thread_throttle_mode_init() to be managed by resctrl James Morse
2024-10-23 22:59   ` Reinette Chatre
2025-02-10 13:22     ` James Morse
2024-10-04 18:03 ` [PATCH v5 28/40] x86/resctrl: Move get_config_index() to a header James Morse
2024-10-04 18:03 ` [PATCH v5 29/40] x86/resctrl: Claim get_{mon,ctrl}_domain_from_cpu() helpers for resctrl James Morse
2024-10-23 23:02   ` Reinette Chatre
2024-10-04 18:03 ` [PATCH v5 30/40] x86/resctrl: Describe resctrl's bitmap size assumptions James Morse
2024-10-08 18:50   ` Tony Luck
2025-02-07 15:46     ` James Morse
2024-10-04 18:03 ` [PATCH v5 31/40] x86/resctrl: Rename resctrl_sched_in() to begin with "resctrl_arch_" James Morse
2024-10-04 18:03 ` [PATCH v5 32/40] x86/resctrl: resctrl_exit() teardown resctrl but leave the mount point James Morse
2024-10-23 23:50   ` Reinette Chatre
2025-02-07 15:54     ` James Morse
2024-10-04 18:03 ` [PATCH v5 33/40] x86/resctrl: Drop __init/__exit on assorted symbols James Morse
2024-10-23 23:56   ` Reinette Chatre
2025-02-07 15:54     ` James Morse
2024-10-04 18:03 ` [PATCH v5 34/40] x86/resctrl: Move is_mba_sc() out of core.c James Morse
2024-10-04 18:03 ` [PATCH v5 35/40] x86/resctrl: Add end-marker to the resctrl_event_id enum James Morse
2024-10-04 18:03 ` [PATCH v5 36/40] x86/resctrl: Remove a newline to avoid confusing the code move script James Morse
2024-10-04 18:03 ` James Morse [this message]
2024-10-04 18:03 ` [PATCH v5 38/40] fs/resctrl: Add boiler plate for external resctrl code James Morse
2024-10-08 23:03   ` Tony Luck
2024-10-24  0:08   ` Reinette Chatre
2025-02-07 15:54     ` James Morse
2024-10-04 18:03 ` [PATCH v5 39/40] x86/resctrl: Move the filesystem bits to headers visible to fs/resctrl James Morse
2024-10-04 18:03 ` [PATCH v5 40/40] x86/resctrl: Add python script to move resctrl code to /fs/resctrl James Morse
2024-10-08 23:08   ` Tony Luck
2024-10-24  0:17     ` Reinette Chatre
2025-02-07 15:55       ` James Morse
2024-10-04 21:18 ` [PATCH v5 00/40] x86/resctrl: Move the resctrl filesystem " Reinette Chatre
2024-10-07 17:29   ` James Morse
2024-10-08 23:24 ` Tony Luck
2024-10-17 17:43 ` Tony Luck
2024-12-06  7:17 ` Shaopeng Tan (Fujitsu)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241004180347.19985-38-james.morse@arm.com \
    --to=james.morse@arm.com \
    --cc=Babu.Moger@amd.com \
    --cc=amitsinght@marvell.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=bp@alien8.de \
    --cc=carl@os.amperecomputing.com \
    --cc=dave.martin@arm.com \
    --cc=david@redhat.com \
    --cc=dfustini@baylibre.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peternewman@google.com \
    --cc=quic_jiles@quicinc.com \
    --cc=reinette.chatre@intel.com \
    --cc=rex.nie@jaguarmicro.com \
    --cc=scott@os.amperecomputing.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=tan.shaopeng@jp.fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xhao@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).