Compile fixes for RHEL 9.3 kernels
PATCH 1/1 Compile fixes for RHEL 9.3 kernels
I'm not sure when some of these changes were backported, but the unmodified lttng-modules compiles vs. 5.14.0-162.23.1
This disables the kmem and compaction modules. I don't believe getting these to compile will be easy, as the required struct declarations are in vmlinux.h, and haven't been moved into mm/internal.h and mm/slab.h in the RHEL sources.
--- include/instrumentation/events/compaction.h | 3 ++- include/instrumentation/events/jbd2.h | 3 ++- include/instrumentation/events/kmem.h | 12 +++++++++--- include/instrumentation/events/skb.h | 3 ++- include/wrapper/kprobes.h | 3 ++- src/lttng-statedump-impl.c | 3 ++- src/probes/Kbuild | 6 ++++-- 7 files changed, 23 insertions(+), 10 deletions(-)
include/instrumentation/events/compaction.h +2 -1
@@ -54,7 +54,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) ) -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (5 ,18 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (5 ,18 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 )) LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, compaction_migratepages,
include/instrumentation/events/jbd2.h +2 -1
@@ -237,7 +237,8 @@ LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail, ) ) -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 ))#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM LTTNG_TRACEPOINT_ENUM(req_op,
include/instrumentation/events/kmem.h +9 -3
@@ -61,7 +61,9 @@ LTTNG_TRACEPOINT_EVENT(kmem_cache_alloc, (s->flags & SLAB_ACCOUNT)) : false) ) ) -#elif (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 )) +#elif (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 )) + LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc, TP_PROTO(unsigned long call_site,
@@ -141,7 +143,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc, kmem_cache_alloc, )#endif -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 )) + LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc_node, TP_PROTO(unsigned long call_site,
@@ -359,7 +363,9 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc, kmem_mm_page_alloc, ) ) -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (5 ,19 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (5 ,19 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 )) + LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, TP_PROTO(struct page *page, unsigned int order, int migratetype,
include/instrumentation/events/skb.h +2 -1
@@ -77,7 +77,8 @@ LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb, )#endif -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,3 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,3 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 )) LTTNG_TRACEPOINT_EVENT_MAP(consume_skb, skb_consume,
include/wrapper/kprobes.h +2 -1
@@ -30,7 +30,8 @@ struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri)#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (5 ,18 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (5 ,18 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 ))static inline unsigned long lttng_get_kretprobe_retaddr (struct kretprobe_instance *ri) {
src/lttng-statedump-impl.c +2 -1
@@ -191,7 +191,8 @@ enum lttng_process_status { }; -#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 )) +#if (LTTNG_LINUX_VERSION_CODE >=LTTNG_KERNEL_VERSION (6 ,0 ,0 ) || \ +LTTNG_RHEL_KERNEL_RANGE (5 ,14 ,0 ,163 ,0 ,0 ,5 ,15 ,0 ,0 ,0 ,0 ))#define LTTNG_PART_STRUCT_TYPE struct block_device
src/probes/Kbuild +4 -2
@@ -15,7 +15,8 @@ kmem_dep = $(srctree)/mm/slab.h kmem_dep_wildcard = $(wildcard $(kmem_dep)) kmem_dep_check = $(shell \ if [ \( $(VERSION) -ge 7 \ - -o \( $(VERSION) -eq 6 -a $(PATCHLEVEL) -ge 0 \) \) -a \ + -o \( $(VERSION) -eq 6 -a $(PATCHLEVEL) -ge 0 \) \ + -o \( $(RHEL_API_VERSION) -gt 1622301 \) \) -a \ -z "$(kmem_dep_wildcard)" ] ; then \ echo "warn" ; \ else \
@@ -166,7 +167,8 @@ ifneq ($(CONFIG_COMPACTION),) compaction_dep_wildcard = $(wildcard $(compaction_dep)) compaction_dep_check = $(shell \ if [ \( $(VERSION) -ge 6 \ - -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \ + -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \ + -o \( $(RHEL_API_VERSION) -gt 1622301 \) \) -a \ -z "$(compaction_dep_wildcard)" ] ; then \ echo "warn" ; \ else \
Signature · 6 lines
2.39.3 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Quoted 10 lines · Martin Hicks via lttng-dev
I'm not sure when some of these changes were backported, but the unmodified lttng-modules compiles vs. 5.14.0-162.23.1
This disables the kmem and compaction modules. I don't believe getting these to compile will be easy, as the required struct declarations are in
vmlinux.h, and haven't been moved intomm/internal.handmm/slab.hin the RHEL sources.Signed-off-by Martin Hicks <[email protected]>
Hi Martin,
I tested your patch and did some minor fixes, I added the base kernel version to the RHEL ABI version check in the Kbuild file because the ABI is tied to a specific kernel version and it would conflict with other RHEL versions. I also adjusted the range for 'kfree_skb' to build on RHEL9.2 kernels.
I uploaded the updated patch [1] to our gerrit instance for easier tracking on our side. Can you please test this version on your system?
You can get the patch using these commands:
git fetch https://review.lttng.org/lttng-modules refs/changes/50/11750/3 git cherry-pick FETCH_HEAD
Thanks,
Michael
[1] https://review.lttng.org/c/lttng-modules/+/11750
_______________________________________________
lttng-dev mailing list [email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Hi Michael,
Quoted 9 lines · Michael Jeanson
On 2024-01-26 12:18, Martin Hicks via lttng-dev wrote:
Hi Martin,I tested your patch and did some minor fixes, I added the base kernel version to the RHEL ABI version check in the
Kbuildfile because the ABI is tied to a specific kernel version and it would conflict with other RHEL versions. I also adjusted the range for 'kfree_skb' to build on RHEL9.2 kernels.
Quoted 7 lines
I uploaded the updated patch [1] to our gerrit instance for easier tracking on our side. Can you please test this version on your system?
You can get the patch using these commands:
git fetch https://review.lttng.org/lttng-modules refs/changes/50/11750/3 git cherry-pick
FETCH_HEAD
I cherry-picked, reviewed and compile tested. Everything still looks good.
Thanks,
mh
--
Martin Hicks
SR Research Ltd.
Fast, Accurate, Reliable Eye Tracking
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev