]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/tracing: Fix to check awk supports non POSIX strtonum()
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 10 Feb 2026 09:54:22 +0000 (18:54 +0900)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 31 Mar 2026 19:06:24 +0000 (13:06 -0600)
Check the awk command supports non POSIX strtonum() function in
the trace_marker_raw test case.

Fixes: 37f46601383a ("selftests/tracing: Add basic test for trace_marker_raw file")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/177071726229.2369897.11506524546451139051.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/00basic/trace_marker_raw.tc
tools/testing/selftests/ftrace/test.d/functions

index a2c42e13f614b4cbb4252df8923a770f48acd598..8e905d4fe6dd22e901e57b7631738f42887121e6 100644 (file)
@@ -4,6 +4,8 @@
 # requires: trace_marker_raw
 # flags: instance
 
+check_awk_strtonum || exit_unresolved
+
 is_little_endian() {
        if lscpu | grep -q 'Little Endian'; then
                echo 1;
index e8e718139294d9d3ee53dc422e5d7d430fd0050b..41325f387ee7a92600c0f7e59a9e1f269adf700d 100644 (file)
@@ -173,6 +173,10 @@ check_requires() { # Check required files and tracers
     done
 }
 
+check_awk_strtonum() { # strtonum is GNU awk extension
+    awk 'BEGIN{strtonum("0x1")}'
+}
+
 LOCALHOST=127.0.0.1
 
 yield() {