From: Mathieu Desnoyers Date: Thu, 4 Jul 2024 15:15:24 +0000 (-0400) Subject: kvm instrumentation: Cleanup: Eliminate code duplication X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ab1ab8c93ad0532cb76664bc0e443e77f7b55959;p=lttng-modules.git kvm instrumentation: Cleanup: Eliminate code duplication 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 Change-Id: I918c87d2e6d68e6c71df18fbf66d88445ce68d23 --- diff --git a/include/instrumentation/events/kvm.h b/include/instrumentation/events/kvm.h index 4bfe567c..a0d33889 100644 --- a/include/instrumentation/events/kvm.h +++ b/include/instrumentation/events/kvm.h @@ -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))