Skip to contentSkip to conversation

Fix: SCSI instrumentation for SLES12 SP2

PATCH New Michael Jeanson 2 participants 3 messages Dec 6, 2016 – Dec 7, 2016 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/2 Fix: SCSI instrumentation for SLES12 SP2

---
 instrumentation/events/lttng-module/scsi.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/scsi.h +2 -1
index 02e3353..7c6ecf1 100644
@@ -15,7 +15,8 @@
 
 #define scsi_opcode_name(opcode)	{ opcode, #opcode }
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
+	|| LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0 ,4,5,0,0,0,0))
 
 #define show_opcode_name(val)					\
 	__print_symbolic(val,					\
Signature · 6 lines
2.7.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#2 lore raw

Re: [PATCH lttng-modules 1/2] Add SUSE Linux Enterprise kernel version tests

In reply to a message not in the archive
Quoted 48 lines · ----- On Dec 6, 2016, at 6:05 PM, Michael Jeanson [email protected] wrote:

---

Makefile.ABI.workarounds |  6 ++++++
abi-sle-version.sh       | 43 +++++++++++++++++++++++++++++++++++++++++++
lttng-kernel-version.h   | 19 +++++++++++++++++++
3 files changed, 68 insertions(+)

create mode 100755 abi-sle-version.sh

Makefile.ABI.workarounds +0 -0
index 470bdef..c3717f8 100644
@@ -16,6 +16,12 @@ ifneq ($(RHEL_API_VERSION), 0)
  ccflags-y += -DRHEL_API_VERSION=$(RHEL_API_VERSION)

endif

Makefile.ABI.workarounds +6 -0
+SLE_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/abi-sle-version.sh $(CURDIR))
+
+ifneq ($(SLE_API_VERSION), 0)
+  ccflags-y += -DSLE_API_VERSION=$(SLE_API_VERSION)
+endif
+

RT_PATCH_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/rt-patch-version.sh $(CURDIR))

ifneq ($(RT_PATCH_VERSION), 0)

abi-sle-version.sh new file +12 -0
new file mode 100755
index 0000000..41fd635
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# First argument is the path to the kernel headers.
+KPATH=$1
+
+if [ ! -f ${KPATH}/include/generated/autoconf.h ]; then
+	echo 0
+	exit 0
+fi
+
+# Check if we are building against a Suse kernel
+SUSE_KERNEL=$(sed -rn 's/^#define CONFIG_SUSE_KERNEL (.*)/\1/p'

${KPATH}/include/generated/autoconf.h)

abi-sle-version.sh new file +3 -0
+
+if [ "$SUSE_KERNEL" != "1" ]; then
+	echo 0

abi-sle-version.sh

Quoted 10 lines
abi-sle-version.sh new file +10 -0
+	exit 0
+fi
+
+
+if [ ! -f ${KPATH}/include/generated/utsrelease.h ]; then
+	echo 0
+	exit 0
+fi
+
+#define UTS_RELEASE "4.4.21-81-default"

Not sure why we need to define this specific version here ?

Thanks,

Mathieu

Quoted 55 lines

+SLE_RELEASE=$(sed -rn 's/^#define UTS_RELEASE "(.*)-([0-9\.]+)-(.*)"/\2/p' ${KPATH}/include/generated/utsrelease.h)

abi-sle-version.sh new file +3 -0
+
+SLE_RELEASE_MAJOR=$(echo ${SLE_RELEASE} | sed -rn 's/^([0-9]+)(.*)$/\1/p')
+SLE_RELEASE_MINOR=$(echo ${SLE_RELEASE} | sed -rn

's/^([0-9]+)\.([0-9]+)(.*)$/\2/p') +SLE_RELEASE_PATCH=$(echo ${SLE_RELEASE} | sed -rn 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\3/p')

abi-sle-version.sh new file +11 -0
+
+# Minor and patch versions can be omitted
+if [ "x$SLE_RELEASE_MINOR" = "x" ]; then
+	SLE_RELEASE_MINOR=0
+fi
+if [ "x$SLE_RELEASE_PATCH" = "x" ]; then
+	SLE_RELEASE_PATCH=0
+fi
+
+# Combine all update numbers into one
+SLE_API_VERSION=$((SLE_RELEASE_MAJOR * 10000 + SLE_RELEASE_MINOR * 100 +

SLE_RELEASE_PATCH))

abi-sle-version.sh new file +2 -0
+
+echo ${SLE_API_VERSION}
lttng-kernel-version.h +19 -0
index d9a5f13..387aa0a 100644
@@ -96,6 +96,25 @@
 		LTTNG_RHEL_VERSION_CODE < \
 		LTTNG_RHEL_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high, f_high))
 
+/* SUSE Linux enterprise */
+
+#define LTTNG_SLE_KERNEL_VERSION(a, b, c, d, e, f) \
+	(((((a) << 16) + ((b) << 8) + (c)) * 10000000ULL) + ((d) * 10000) + ((e) *
 100) + (f))
+
+#ifdef SLE_API_VERSION
+#define LTTNG_SLE_VERSION_CODE \
+	((LINUX_VERSION_CODE * 10000000ULL) + SLE_API_VERSION)
+#else
+#define LTTNG_SLE_VERSION_CODE 	0
+#endif
+
+#define LTTNG_SLE_KERNEL_RANGE(a_low, b_low, c_low, d_low, e_low, f_low, \
+		a_high, b_high, c_high, d_high, e_high, f_high) \
+	(LTTNG_SLE_VERSION_CODE >= \
+		LTTNG_SLE_KERNEL_VERSION(a_low, b_low, c_low, d_low, e_low, f_low) && \
+		LTTNG_SLE_VERSION_CODE < \
+		LTTNG_SLE_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high, f_high))
+
 /* RT patch */
 

#define LTTNG_RT_KERNEL_VERSION(a, b, c, d) \
--
2.7.4

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 11 lines · ----- On Dec 6, 2016, at 6:05 PM, Michael Jeanson [email protected] wrote:

---
instrumentation/events/lttng-module/scsi.h | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/scsi.h +0 -0
index 02e3353..7c6ecf1 100644

instrumentation/events/lttng-module/scsi.h line 19

Quoted 6 lines
instrumentation/events/lttng-module/scsi.h +2 -1
@@ -15,7 +15,8 @@
 
 #define scsi_opcode_name(opcode)	{ opcode, #opcode }
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
+	|| LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0 ,4,5,0,0,0,0))

I typically do:

LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0)

(spacing and comma layout)

Thanks,

Mathieu

Quoted 5 lines
instrumentation/events/lttng-module/scsi.h +0 -1
 #define show_opcode_name(val)					\
 	__print_symbolic(val,					\
--

2.7.4

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev