Skip to contentSkip to conversation

selftests/ftrace: multiple_kprobes: Also check for support

PATCH In review Thomas Meyer 5 participants 10 messages Sep 8, 2017 – Sep 19, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 selftests/ftrace: multiple_kprobes: Also check for support

The multiple_kprobes test case fails to check for KPROBE_EVENT support. Add the check to prevent a false test result.

---
 tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +2 -0
index 2a1cb9908746..a4fd4c851a5b 100644
@@ -1,6 +1,8 @@
 #!/bin/sh
 # description: Register/unregister many kprobe events
 
+[ -f kprobe_events ] || exit_unsupported # this is configurable
+
 # ftrace fentry skip size depends on the machine architecture.
 # Currently HAVE_KPROBES_ON_FTRACE defined on x86 and powerpc64le
 case `uname -m` in
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/3 selftests/intel_pstate: No need to compile test progs in the run script

Both test programs are being compiled by make, so no need to compile both programs in the runner script.
This resolves an error when installing all selftests via make install and run them in a different environemnt.

Running tests in intel_pstate
========================================
./run.sh: line 35: gcc: command not found
Problem compiling aperf.c.

---
 tools/testing/selftests/intel_pstate/run.sh | 6 ------
 1 file changed, 6 deletions(-)
tools/testing/selftests/intel_pstate/run.sh +0 -6
index 7868c106b8b1..96878e44f465 100755
@@ -31,12 +31,6 @@ EVALUATE_ONLY=0
 
 max_cpus=$(($(nproc)-1))
 
-# compile programs
-gcc aperf.c -Wall -D_GNU_SOURCE -o aperf  -lm
-[ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
-gcc -o msr msr.c -lm
-[ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
-
 function run_test () {
 
 	file_ext=$1
Signature · 1 line
2.11.0
maintainer
#2 lore raw

Re: [PATCH 2/3] selftests/intel_pstate: No need to compile test progs in the run script

Quoted 23 lines · Thomas Meyer

Both test programs are being compiled by make, so no need to compile both programs in the runner script.
This resolves an error when installing all selftests via make install and run them in a different environemnt.

Running tests in intel_pstate
========================================
./run.sh: line 35: gcc: command not found
Problem compiling aperf.c.

---
 tools/testing/selftests/intel_pstate/run.sh | 6 ------
 1 file changed, 6 deletions(-)
tools/testing/selftests/intel_pstate/run.sh +0 -0
index 7868c106b8b1..96878e44f465 100755
@@ -31,12 +31,6 @@ EVALUATE_ONLY=0
 
 max_cpus=$(($(nproc)-1))

tools/testing/selftests/intel_pstate/run.sh EVALUATE_ONLY=0 · line 36

Quoted 10 lines
tools/testing/selftests/intel_pstate/run.sh +0 -6
 
-# compile programs
-gcc aperf.c -Wall -D_GNU_SOURCE -o aperf  -lm
-[ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
-gcc -o msr msr.c -lm
-[ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
-
 function run_test () {
 
 	file_ext=$1

Thanks for the patch. I will get this into 4.14-rc2 or rc3

thanks,
-- Shuah

#3 lore raw

PATCH 3/3 selftests/net: msg_zerocopy enable build with older kernel headers

In reply to Thomas Meyer

Explicitly define SO_EE_ORIGIN_ZEROCOPY.
This makes the test program build with older kernel headers, e.g. from Debian 9.

---
 tools/testing/selftests/net/msg_zerocopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/msg_zerocopy.c +1 -1
index 40232af5b023..3ab6ec403905 100644
@@ -55,7 +55,7 @@
 #include <unistd.h>
 
 #ifndef SO_EE_ORIGIN_ZEROCOPY
-#define SO_EE_ORIGIN_ZEROCOPY		SO_EE_ORIGIN_UPAGE
+#define SO_EE_ORIGIN_ZEROCOPY		5
 #endif
 
 #ifndef SO_ZEROCOPY
Signature · 1 line
2.11.0
maintainer
#4 lore raw
In reply to Thomas Meyer
Quoted 14 lines · Thomas Meyer

The multiple_kprobes test case fails to check for KPROBE_EVENT support. Add the check to prevent a false test result.

---
 tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +0 -0
index 2a1cb9908746..a4fd4c851a5b 100644

tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc line 8

Quoted 8 lines
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +2 -0
@@ -1,6 +1,8 @@
 #!/bin/sh
 # description: Register/unregister many kprobe events
 
+[ -f kprobe_events ] || exit_unsupported # this is configurable
+
 # ftrace fentry skip size depends on the machine architecture.
 # Currently HAVE_KPROBES_ON_FTRACE defined on x86 and powerpc64le
 case `uname -m` in

Hi Steve/Masami,

This patch looks good to me. Adds a check similar to the one one in tools/testing/selftests/ftrace/test.d/kprobe/functions

If you don't have objections, I will get this into 4.14-rc2 or rc3

thanks,
-- Shuah

maintainer Acked-by
#5 lore raw
Quoted 26 lines · On Thu, 14 Sep 2017 08:58:20 -0600 Shuah Khan <[email protected]> wrote:
Quoted 14 lines · Thomas Meyer

The multiple_kprobes test case fails to check for KPROBE_EVENT support. Add the check to prevent a false test result.

---
 tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +0 -0
index 2a1cb9908746..a4fd4c851a5b 100644

tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc line 8

Quoted 8 lines
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +2 -0
@@ -1,6 +1,8 @@
 #!/bin/sh
 # description: Register/unregister many kprobe events
 
+[ -f kprobe_events ] || exit_unsupported # this is configurable
+
 # ftrace fentry skip size depends on the machine architecture.
 # Currently HAVE_KPROBES_ON_FTRACE defined on x86 and powerpc64le
 case `uname -m` in

Hi Steve/Masami,

Quoted 2 lines

This patch looks good to me. Adds a check similar to the one one in tools/testing/selftests/ftrace/test.d/kprobe/functions

Yes, this looks good to me too :)

Thanks!

Quoted 9 lines

If you don't have objections, I will get this into 4.14-rc2 or rc3

thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Masami Hiramatsu <[email protected]>
#8 lore raw
Quoted 9 lines · Steven Rostedt
Quoted 5 lines · On Thu, 14 Sep 2017 08:15:19 -0700 Masami Hiramatsu <[email protected]> wrote:
Quoted 4 lines

Hi Steve/Masami,

This patch looks good to me. Adds a check similar to the one one in tools/testing/selftests/ftrace/test.d/kprobe/functions

Quoted 9 lines
Quoted 4 lines

Yes, this looks good to me too :)

-- Steve

Thanks Steve and Masami,

I will get this into rc2

thanks,
-- Shuah

maintainer
#9 lore raw
Quoted 15 lines · Shuah Khan
Quoted 14 lines · Steven Rostedt
Quoted 9 lines · On Thu, 14 Sep 2017 08:15:19 -0700 Masami Hiramatsu <[email protected]> wrote:
Quoted 4 lines

Hi Steve/Masami,

This patch looks good to me. Adds a check similar to the one one in tools/testing/selftests/ftrace/test.d/kprobe/functions

Yes, this looks good to me too :)

Quoted 9 lines
Quoted 4 lines

-- Steve

Thanks Steve and Masami,

I will get this into rc2

Applied to linux-kselftest fixes 4.14-rc2

thanks,
-- Shuah