Skip to contentSkip to conversation

selftests/ftrace: check for do_sys_openat2 in user-memory test

PATCH In review Colin King 4 participants 4 messages Oct 2, 2020 – Oct 27, 2020

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH v2 1/1 selftests/ftrace: check for do_sys_openat2 in user-memory test

From: Colin Ian King <[email protected]>

More recent libc implementations are now using openat/openat2 system calls so also add do_sys_openat2 to the tracing so that the test passes on these systems because do_sys_open may not be called.

Thanks to Masami Hiramatsu for the help on getting this fix to work correctly.

---

V2: write myevent2 using >> rather than >, also enable and disable
myevent2

---
 .../selftests/ftrace/test.d/kprobe/kprobe_args_user.tc        | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_user.tc +4 -0
index a30a9c07290d..d25d01a19778 100644
@@ -9,12 +9,16 @@ grep -A10 "fetcharg:" README | grep -q '\[u\]<offset>' || exit_unsupported
 :;: "user-memory access syntax and ustring working on user memory";:
 echo 'p:myevent do_sys_open path=+0($arg2):ustring path2=+u0($arg2):string' \
 	> kprobe_events
+echo 'p:myevent2 do_sys_openat2 path=+0($arg2):ustring path2=+u0($arg2):string' \
+	>> kprobe_events
 
 grep myevent kprobe_events | \
 	grep -q 'path=+0($arg2):ustring path2=+u0($arg2):string'
 echo 1 > events/kprobes/myevent/enable
+echo 1 > events/kprobes/myevent2/enable
 echo > /dev/null
 echo 0 > events/kprobes/myevent/enable
+echo 0 > events/kprobes/myevent2/enable
 
 grep myevent trace | grep -q 'path="/dev/null" path2="/dev/null"'
 
Signature · 1 line
2.27.0
maintainer Acked-by on v2 1/1
#1 lore raw

Hi,

Quoted 10 lines · On Fri, 2 Oct 2020 14:25:01 +0100 Colin King <[email protected]> wrote:

From: Colin Ian King <[email protected]>

More recent libc implementations are now using openat/openat2 system calls so also add do_sys_openat2 to the tracing so that the test passes on these systems because do_sys_open may not be called.

Thanks to Masami Hiramatsu for the help on getting this fix to work correctly.

OK, this looks good to me.

Thank you!

Quoted 32 lines

---

V2: write myevent2 using >> rather than >, also enable and disable
myevent2

---
 .../selftests/ftrace/test.d/kprobe/kprobe_args_user.tc        | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_user.tc +4 -0
index a30a9c07290d..d25d01a19778 100644
@@ -9,12 +9,16 @@ grep -A10 "fetcharg:" README | grep -q '\[u\]<offset>' || exit_unsupported
 :;: "user-memory access syntax and ustring working on user memory";:
 echo 'p:myevent do_sys_open path=+0($arg2):ustring path2=+u0($arg2):string' \
 	> kprobe_events
+echo 'p:myevent2 do_sys_openat2 path=+0($arg2):ustring path2=+u0($arg2):string' \
+	>> kprobe_events
 
 grep myevent kprobe_events | \
 	grep -q 'path=+0($arg2):ustring path2=+u0($arg2):string'
 echo 1 > events/kprobes/myevent/enable
+echo 1 > events/kprobes/myevent2/enable
 echo > /dev/null
 echo 0 > events/kprobes/myevent/enable
+echo 0 > events/kprobes/myevent2/enable
 
 grep myevent trace | grep -q 'path="/dev/null" path2="/dev/null"'
 
Signature · 1 line
2.27.0
Signature · 1 line
Masami Hiramatsu <[email protected]>
maintainer Acked-by on v2 1/1
#2 lore raw
In reply to Colin King
Quoted 6 lines · On Fri, 2 Oct 2020 14:25:01 +0100 Colin King <[email protected]> wrote:

From: Colin Ian King <[email protected]>

More recent libc implementations are now using openat/openat2 system calls so also add do_sys_openat2 to the tracing so that the test passes on these systems because do_sys_open may not be called.

Quoted 6 lines

Thanks to Masami Hiramatsu for the help on getting this fix to work correctly.

---

Shuah,

Care to take this through your tree?

-- Steve

maintainer
#3 lore raw
Quoted 16 lines · Steven Rostedt
Quoted 6 lines · On Fri, 2 Oct 2020 14:25:01 +0100 Colin King <[email protected]> wrote:

From: Colin Ian King <[email protected]>

More recent libc implementations are now using openat/openat2 system calls so also add do_sys_openat2 to the tracing so that the test passes on these systems because do_sys_open may not be called.

Quoted 6 lines

Thanks to Masami Hiramatsu for the help on getting this fix to work correctly.

---

Quoted 6 lines

Shuah,

Care to take this through your tree?

Yes - Will include in my next fixes pull request.

thanks,
-- Shuah