[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240807163638.528b72a1@gandalf.local.home>
Date: Wed, 7 Aug 2024 16:36:38 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: Shuah Khan <shuah@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
oleg@...hat.com, jolsa@...nel.org, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH] selftests/uprobes: Add a basic uprobe testcase
On Fri, 24 May 2024 09:49:55 +0900
"Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
>
> Add a basic uprobe testcase which checks whether add/remove/trace
> operations works on /bin/sh.
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@...dmis.org>
Shuah, can you take this too.
-- Steve
> ---
> .../ftrace/test.d/dynevent/add_remove_uprobe.tc | 26 ++++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
>
> diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
> new file mode 100644
> index 000000000000..a275decdc880
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
> @@ -0,0 +1,26 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +# description: Generic dynamic event - add/remove/test uprobe events
> +# requires: uprobe_events
> +
> +echo 0 > events/enable
> +echo > dynamic_events
> +
> +echo 'cat /proc/$$/maps' | /bin/sh | \
> + grep "r-xp .*/bin/.*sh$" | \
> + awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events
> +
> +grep -q myevent uprobe_events
> +test -d events/uprobes/myevent
> +
> +echo 1 > events/uprobes/myevent/enable
> +echo 'ls' | /bin/sh > /dev/null
> +echo 0 > events/uprobes/myevent/enable
> +grep -q myevent trace
> +
> +echo "-:myevent" >> uprobe_events
> +! grep -q myevent uprobe_events
> +
> +echo > uprobe_events
> +
> +clear_trace
Powered by blists - more mailing lists