2017-09-08 12:01:26

by Thomas Meyer

[permalink] [raw]
Subject: [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.

Signed-off-by: Thomas Meyer <[email protected]>
---
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index 2a1cb9908746..a4fd4c851a5b 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -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
--
2.11.0


2017-09-08 12:01:34

by Thomas Meyer

[permalink] [raw]
Subject: [PATCH 3/3] selftests/net: msg_zerocopy enable build with older kernel headers

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

Signed-off-by: Thomas Meyer <[email protected]>
---
tools/testing/selftests/net/msg_zerocopy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/msg_zerocopy.c b/tools/testing/selftests/net/msg_zerocopy.c
index 40232af5b023..3ab6ec403905 100644
--- a/tools/testing/selftests/net/msg_zerocopy.c
+++ b/tools/testing/selftests/net/msg_zerocopy.c
@@ -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
--
2.11.0

2017-09-08 12:01:31

by Thomas Meyer

[permalink] [raw]
Subject: [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.

Signed-off-by: Thomas Meyer <[email protected]>
---
tools/testing/selftests/intel_pstate/run.sh | 6 ------
1 file changed, 6 deletions(-)

diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index 7868c106b8b1..96878e44f465 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -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
--
2.11.0

2017-09-14 14:58:32

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 1/3] selftests/ftrace: multiple_kprobes: Also check for support

On 09/08/2017 06:01 AM, Thomas Meyer wrote:
> The multiple_kprobes test case fails to check for KPROBE_EVENT support.
> Add the check to prevent a false test result.
>
> Signed-off-by: Thomas Meyer <[email protected]>
> ---
> tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
> index 2a1cb9908746..a4fd4c851a5b 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
> @@ -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

2017-09-14 14:59:31

by Shuah Khan

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

On 09/08/2017 06:01 AM, Thomas Meyer wrote:
> 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.
>
> Signed-off-by: Thomas Meyer <[email protected]>
> ---
> tools/testing/selftests/intel_pstate/run.sh | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
> index 7868c106b8b1..96878e44f465 100755
> --- a/tools/testing/selftests/intel_pstate/run.sh
> +++ b/tools/testing/selftests/intel_pstate/run.sh
> @@ -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
>
Thanks for the patch. I will get this into 4.14-rc2 or rc3

thanks,
-- Shuah

2017-09-14 15:15:22

by Masami Hiramatsu

[permalink] [raw]
Subject: Re: [PATCH 1/3] selftests/ftrace: multiple_kprobes: Also check for support

On Thu, 14 Sep 2017 08:58:20 -0600
Shuah Khan <[email protected]> wrote:

> On 09/08/2017 06:01 AM, Thomas Meyer wrote:
> > The multiple_kprobes test case fails to check for KPROBE_EVENT support.
> > Add the check to prevent a false test result.
> >
> > Signed-off-by: Thomas Meyer <[email protected]>
> > ---
> > tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
> > index 2a1cb9908746..a4fd4c851a5b 100644
> > --- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
> > @@ -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

Yes, this looks good to me too :)

Acked-by: Masami Hiramatsu <[email protected]>

Thanks!

>
> 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


--
Masami Hiramatsu <[email protected]>

2017-09-15 19:10:20

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 1/3] selftests/ftrace: multiple_kprobes: Also check for support

On Thu, 14 Sep 2017 08:15:19 -0700
Masami Hiramatsu <[email protected]> wrote:

> Yes, this looks good to me too :)

Agreed.

>
> Acked-by: Masami Hiramatsu <[email protected]>

Acked-by: Steven Rostedt (VMware) <[email protected]>

-- Steve

2017-09-18 15:18:49

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 1/3] selftests/ftrace: multiple_kprobes: Also check for support

On Thu, 14 Sep 2017 08:15:19 -0700
Masami Hiramatsu <[email protected]> wrote:


> > 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 :)
>
> Acked-by: Masami Hiramatsu <[email protected]>
>

Acked-by: Steven Rostedt (VMware) <[email protected]>

-- Steve

2017-09-18 15:20:02

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 1/3] selftests/ftrace: multiple_kprobes: Also check for support

On 09/18/2017 09:18 AM, Steven Rostedt wrote:
> On Thu, 14 Sep 2017 08:15:19 -0700
> Masami Hiramatsu <[email protected]> wrote:
>
>
>>> 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 :)
>>
>> Acked-by: Masami Hiramatsu <[email protected]>
>>
>
> Acked-by: Steven Rostedt (VMware) <[email protected]>
>
> -- Steve
>

Thanks Steve and Masami,

I will get this into rc2

thanks,
-- Shuah

2017-09-19 14:47:43

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 1/3] selftests/ftrace: multiple_kprobes: Also check for support

On 09/18/2017 09:19 AM, Shuah Khan wrote:
> On 09/18/2017 09:18 AM, Steven Rostedt wrote:
>> On Thu, 14 Sep 2017 08:15:19 -0700
>> Masami Hiramatsu <[email protected]> wrote:
>>
>>
>>>> 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 :)
>>>
>>> Acked-by: Masami Hiramatsu <[email protected]>
>>>
>>
>> Acked-by: Steven Rostedt (VMware) <[email protected]>
>>
>> -- Steve
>>
>
> Thanks Steve and Masami,
>
> I will get this into rc2
>

Applied to linux-kselftest fixes 4.14-rc2

thanks,
-- Shuah