From: Martin Hicks Date: Fri, 26 Jan 2024 17:18:33 +0000 (-0500) Subject: Compile fixes for RHEL 9.3 kernels X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a9d49ac600f171e2289c8c409587bbcf2eec9f99;p=lttng-modules.git Compile fixes for RHEL 9.3 kernels The ranges were build tested on RHEL9.2 (5.14.0-284.11.1), RHEL9.3 (5.14.0-362.8.1) and RHEL8.9 (4.18.0-513.11.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. Change-Id: I999c593d6850e2327f6e9df8432a4ea2325a7cea Signed-off-by: Martin Hicks Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/instrumentation/events/compaction.h b/include/instrumentation/events/compaction.h index 31d0a422..7d0c2623 100644 --- a/include/instrumentation/events/compaction.h +++ b/include/instrumentation/events/compaction.h @@ -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, diff --git a/include/instrumentation/events/jbd2.h b/include/instrumentation/events/jbd2.h index b00777fa..eccac06d 100644 --- a/include/instrumentation/events/jbd2.h +++ b/include/instrumentation/events/jbd2.h @@ -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, diff --git a/include/instrumentation/events/kmem.h b/include/instrumentation/events/kmem.h index dd22192f..f2e2d11d 100644 --- a/include/instrumentation/events/kmem.h +++ b/include/instrumentation/events/kmem.h @@ -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, diff --git a/include/instrumentation/events/skb.h b/include/instrumentation/events/skb.h index 08704b98..9f1047c6 100644 --- a/include/instrumentation/events/skb.h +++ b/include/instrumentation/events/skb.h @@ -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,362,0,0, 5,15,0,0,0,0)) LTTNG_TRACEPOINT_EVENT_MAP(consume_skb, skb_consume, diff --git a/include/wrapper/kprobes.h b/include/wrapper/kprobes.h index 51d32b7c..d906bcba 100644 --- a/include/wrapper/kprobes.h +++ b/include/wrapper/kprobes.h @@ -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) { diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c index 22e3628b..0b09027a 100644 --- a/src/lttng-statedump-impl.c +++ b/src/lttng-statedump-impl.c @@ -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 diff --git a/src/probes/Kbuild b/src/probes/Kbuild index 73a15844..bac90c3a 100644 --- a/src/probes/Kbuild +++ b/src/probes/Kbuild @@ -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 \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 14 -a $(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 \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 14 -a $(RHEL_API_VERSION) -gt 1622301 \) \) -a \ -z "$(compaction_dep_wildcard)" ] ; then \ echo "warn" ; \ else \