Skip to contentSkip to conversation

cxl/test: skip, don't fail, when kernel tracing is not enabled

PATCH Applied [email protected] 4 participants 5 messages May 23, 2025 – May 28, 2025 libnvdimm: non-volatile memory device

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 cxl/test: skip, don't fail, when kernel tracing is not enabled

From: Alison Schofield <[email protected]>

cxl-events.sh and cxl-poison.sh require a kernel with CONFIG_TRACING enabled and currently report a FAIL when /sys/kernel/tracing is missing. Update these tests to report a SKIP along with a message stating the requirement. This allows the tests to run cleanly on systems without TRACING enabled and gives users the info needed to enable TRACING for testing.

---

Noticed this behavior in Itaru's test results:
https://lore.kernel.org/linux-cxl/[email protected]/

 test/cxl-events.sh | 1 +
 test/cxl-poison.sh | 1 +
 2 files changed, 2 insertions(+)
test/cxl-events.sh +1 -0
index c216d6aa9148..7326eb7447ee 100644
@@ -13,6 +13,7 @@ num_info_expected=3
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
test/cxl-poison.sh +1 -0
index 2caf092db460..6ed890bc666c 100644
@@ -7,6 +7,7 @@
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · alison.schofield@ wrote:

From: Alison Schofield <[email protected]>

cxl-events.sh and cxl-poison.sh require a kernel with CONFIG_TRACING enabled and currently report a FAIL when /sys/kernel/tracing is missing. Update these tests to report a SKIP along with a message stating the requirement. This allows the tests to run cleanly on systems without TRACING enabled and gives users the info needed to enable TRACING for testing.

Quoted 5 lines

---

Noticed this behavior in Itaru's test results:
https://lore.kernel.org/linux-cxl/[email protected]/

You could borrow the kernel process for information like this and move it above the --- line with the following trailers:

...you can also add:

Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 36 lines · On 2025-05-22 20:15, [email protected] wrote:

From: Alison Schofield <[email protected]>

cxl-events.sh and cxl-poison.sh require a kernel with CONFIG_TRACING enabled and currently report a FAIL when /sys/kernel/tracing is missing. Update these tests to report a SKIP along with a message stating the requirement. This allows the tests to run cleanly on systems without TRACING enabled and gives users the info needed to enable TRACING for testing.

---

Noticed this behavior in Itaru's test results:
https://lore.kernel.org/linux-cxl/[email protected]/

 test/cxl-events.sh | 1 +
 test/cxl-poison.sh | 1 +
 2 files changed, 2 insertions(+)
test/cxl-events.sh +1 -0
index c216d6aa9148..7326eb7447ee 100644
@@ -13,6 +13,7 @@ num_info_expected=3
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
test/cxl-poison.sh +0 -0
index 2caf092db460..6ed890bc666c 100644

test/cxl-poison.sh line 13

Quoted 7 lines
test/cxl-poison.sh +1 -0
@@ -7,6 +7,7 @@
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to [email protected]
Quoted 10 lines · On 5/22/25 8:15 PM, [email protected] wrote:

From: Alison Schofield <[email protected]>

cxl-events.sh and cxl-poison.sh require a kernel with CONFIG_TRACING enabled and currently report a FAIL when /sys/kernel/tracing is missing. Update these tests to report a SKIP along with a message stating the requirement. This allows the tests to run cleanly on systems without TRACING enabled and gives users the info needed to enable TRACING for testing.

Quoted 33 lines

---

Noticed this behavior in Itaru's test results:
https://lore.kernel.org/linux-cxl/[email protected]/

 test/cxl-events.sh | 1 +
 test/cxl-poison.sh | 1 +
 2 files changed, 2 insertions(+)
test/cxl-events.sh +1 -0
index c216d6aa9148..7326eb7447ee 100644
@@ -13,6 +13,7 @@ num_info_expected=3
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
test/cxl-poison.sh +1 -0
index 2caf092db460..6ed890bc666c 100644
@@ -7,6 +7,7 @@
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
author maintainer Applied
#4 lore raw
In reply to [email protected]
Quoted 8 lines · On Thu, May 22, 2025 at 08:15:06PM -0700, [email protected] wrote:

From: Alison Schofield <[email protected]>

cxl-events.sh and cxl-poison.sh require a kernel with CONFIG_TRACING enabled and currently report a FAIL when /sys/kernel/tracing is missing. Update these tests to report a SKIP along with a message stating the requirement. This allows the tests to run cleanly on systems without TRACING enabled and gives users the info needed to enable TRACING for testing.

Applied to pending branch:
https://github.com/pmem/ndctl/tree/pending

Quoted 38 lines

---

Noticed this behavior in Itaru's test results:
https://lore.kernel.org/linux-cxl/[email protected]/

 test/cxl-events.sh | 1 +
 test/cxl-poison.sh | 1 +
 2 files changed, 2 insertions(+)
test/cxl-events.sh +1 -0
index c216d6aa9148..7326eb7447ee 100644
@@ -13,6 +13,7 @@ num_info_expected=3
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
test/cxl-poison.sh +1 -0
index 2caf092db460..6ed890bc666c 100644
@@ -7,6 +7,7 @@
 rc=77
 
 set -ex
+[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
 
 trap 'err $LINENO' ERR
 
Signature · 1 line
2.37.3