[lttng-dev] [PATCH 1/3] statedump: adjust to v6.7 cpu topology struct

bruce.ashfield at gmail.com bruce.ashfield at gmail.com
Thu Nov 23 14:32:47 EST 2023


From: Bruce Ashfield <bruce.ashfield at gmail.com>

Adjusting the statedump to the following upstream commits:

  commit b9655e702dc5 [x86/cpu: Encapsulate topology information in cpuinfo_x86]
  commit e95256335d45 [x86/cpu: Move cpu_core_id into topology info]
  commit 02fb601d27a7 [x86/cpu: Move phys_proc_id into topology info]

We now have the topo struct, as well as some minor member name
changes.

Signed-off-by: Bruce Ashfield <bruce.ashfield at gmail.com>
---

Someone else may or may not already have this in flight,
but I didn't see anything on the list or in the git
repo.

I ran into this failure when working on the v6.7-rc
kernel as part of yocto project kernel updates.

Tweak as necessary, as I'm no expert in the right way
to version these sort of changes.

Bruce

 include/instrumentation/events/lttng-statedump.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/instrumentation/events/lttng-statedump.h b/include/instrumentation/events/lttng-statedump.h
index 642aa356..5f52a29c 100644
--- a/include/instrumentation/events/lttng-statedump.h
+++ b/include/instrumentation/events/lttng-statedump.h
@@ -263,8 +263,13 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_cpu_topology,
 		ctf_integer(uint8_t, family, c->x86)
 		ctf_integer(uint8_t, model, c->x86_model)
 		ctf_string(model_name, c->x86_model_id[0] ? c->x86_model_id : "unknown")
+#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(6,7,0))
 		ctf_integer(uint16_t, physical_id, c->phys_proc_id)
 		ctf_integer(uint16_t, core_id, c->cpu_core_id)
+#else
+		ctf_integer(uint16_t, physical_id, c->topo.pkg_id)
+		ctf_integer(uint16_t, core_id, c->topo.core_id)
+#endif
 		ctf_integer(uint16_t, cores, c->booted_cores)
 	)
 )
-- 
2.34.1



More information about the lttng-dev mailing list