kvm instrumentation: Cleanup: Eliminate code duplication
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2024 15:15:24 +0000 (11:15 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2024 15:19:45 +0000 (11:19 -0400)
Commit 0badc02f82b38 ("Fix: adjust SLE version ranges to build with SP2
and SP3") introduced code duplication. Modify the version match logic to
remove duplicated code.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I918c87d2e6d68e6c71df18fbf66d88445ce68d23

include/instrumentation/events/kvm.h

index 4bfe567c6c228cf4a066318579edbb2581075013..a0d33889ba6e62dc14d265429ff730397f52ce31 100644 (file)
@@ -72,27 +72,13 @@ LTTNG_TRACEPOINT_EVENT(kvm_ack_irq,
        { KVM_TRACE_MMIO_READ, "read" }, \
        { KVM_TRACE_MMIO_WRITE, "write" }
 
-
-#if (LTTNG_SLE_KERNEL_RANGE(4,4,121,92,92,0, 4,4,122,0,0,0) \
-       || LTTNG_SLE_KERNEL_RANGE(4,4,131,94,0,0, 4,5,0,0,0,0))
-
-LTTNG_TRACEPOINT_EVENT(kvm_mmio,
-       TP_PROTO(int type, int len, u64 gpa, u64 val),
-       TP_ARGS(type, len, gpa, val),
-
-       TP_FIELDS(
-               ctf_integer(u32, type, type)
-               ctf_integer(u32, len, len)
-               ctf_integer(u64, gpa, gpa)
-               ctf_integer(u64, val, val)
-       )
-)
-
-#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0) \
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0) \
        || LTTNG_KERNEL_RANGE(4,14,14, 4,15,0) \
        || LTTNG_DEBIAN_KERNEL_RANGE(4,14,13,1,0, 4,15,0,0,0) \
        || LTTNG_KERNEL_RANGE(4,9,77, 4,10,0) \
-       || LTTNG_KERNEL_RANGE(4,4,112, 4,5,0) \
+       || (LTTNG_KERNEL_RANGE(4,4,112, 4,5,0) \
+               && !(LTTNG_SLE_KERNEL_RANGE(4,4,121,92,92,0, 4,4,122,0,0,0) \
+                       || LTTNG_SLE_KERNEL_RANGE(4,4,131,94,0,0, 4,5,0,0,0,0))) \
        || LTTNG_UBUNTU_KERNEL_RANGE(4,13,16,38, 4,14,0,0) \
        || LTTNG_DEBIAN_KERNEL_RANGE(4,9,65,3,0, 4,10,0,0,0) \
        || LTTNG_FEDORA_KERNEL_RANGE(4,14,13,300, 4,15,0,0))
This page took 0.027158 seconds and 4 git commands to generate.