From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
bpf@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Sven Schnelle <svens@linux.ibm.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>, Guo Ren <guoren@kernel.org>,
Donglin Peng <dolinux.peng@gmail.com>,
Zheng Yejian <zhengyejian@huaweicloud.com>,
Aishwarya.TCV@arm.com
Subject: Re: [PATCH v4 2/4] ftrace: Add support for function argument to graph tracer
Date: Mon, 14 Apr 2025 12:00:13 +0900 [thread overview]
Message-ID: <20250414120013.895b0cc99e52c41eb8ec3774@kernel.org> (raw)
In-Reply-To: <20250411152610.64d555bf@gandalf.local.home>
On Fri, 11 Apr 2025 15:26:10 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
>
> Replying to my email as it appears gmail blocked it. Probably due to all
> the escape characters my output had. Resending with that cut out.
>
> Masami, I was sent a message from gmail that it blocked this from you.
Hi, I could find it. Let me reply!
>
> If you want to see the original email:
>
> https://lore.kernel.org/all/20250411151358.1d4fd8c7@gandalf.local.home/
>
> -- Steve
>
> On Fri, 11 Apr 2025 15:13:58 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Fri, 11 Apr 2025 14:31:32 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > Hmm, I just tested this, and it fails on my box too (I test on a debian VM).
> > >
> > > It fails with and without setting it to bash. I'll take a look too.
> >
> > Hmm, maybe it is a bashism.
> >
> > The test has this:
> >
> > # Max arguments limitation
> > MAX_ARGS=128
> > EXCEED_ARGS=$((MAX_ARGS + 1))
> >
> > check_max_args() { # event_header
> > TEST_STRING=$1
> > # Acceptable
> > for i in `seq 1 $MAX_ARGS`; do
> > TEST_STRING="$TEST_STRING \\$i"
> > done
> > echo "$TEST_STRING" >> dynamic_events
> > echo > dynamic_events
> > # Error
> > TEST_STRING="$TEST_STRING \\$EXCEED_ARGS"
> > ! echo "$TEST_STRING" >> dynamic_events
> > return 0
> > }
> >
> > # Kprobe max args limitation
> > if grep -q "kprobe_events" README; then
> > check_max_args "p vfs_read"
> > fi
> >
> > So I tried manually executing this in bash:
> >
> > --------------------------8<--------------------------
> > # TEST_STRING='p vfs_read'
> > # for i in `seq 1 128`; do TEST_STRING="$TEST_STRING \\$i" ; done
> > # echo $TEST_STRING
> > p vfs_read \1 \2
>
> [ This is cut out to see if it doesn't trigger gmail blocking it again! ]
>
> > # echo "$TEST_STRING" >> /sys/kernel/tracing/dynamic_events
> > # echo $?
> > 0
> > # cat /sys/kernel/tracing/dynamic_events
> > p:kprobes/p_vfs_read_0 vfs_read arg1=\1
>
> [ This is cut out to see if it doesn't trigger gmail blocking it again! ]
>
> > -------------------------->8--------------------------
> >
> > Doing the same in dash:
> >
> > --------------------------8<--------------------------
> > # dash
> > # TEST_STRING='p vfs_read'
> > # for i in `seq 1 128`; do TEST_STRING="$TEST_STRING \\$i" ; done
> > # echo $TEST_STRING
> > p vfs_read \8 \9
>
> [ This is cut out to see if it doesn't trigger gmail blocking it again! ]
>
> > # echo "$TEST_STRING" >> /sys/kernel/tracing/dynamic_events
> > dash: 8: echo: echo: I/O error
> > -------------------------->8--------------------------
> >
> > Looks like dash will translate those "\#" into the ASCII equivalent,
> > whereas bash does not.
> >
> > This patch seems to fix it:
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/dynevent_limitations.tc b/tools/testing/selftests/ftrace/test.d/dynevent/dynevent_limitations.tc
> > index 6b94b678741a..ebe2a34cbf92 100644
> > --- a/tools/testing/selftests/ftrace/test.d/dynevent/dynevent_limitations.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/dynevent/dynevent_limitations.tc
> > @@ -11,7 +11,7 @@ check_max_args() { # event_header
> > TEST_STRING=$1
> > # Acceptable
> > for i in `seq 1 $MAX_ARGS`; do
> > - TEST_STRING="$TEST_STRING \\$i"
> > + TEST_STRING="$TEST_STRING \\\\$i"
> > done
> > echo "$TEST_STRING" >> dynamic_events
> > echo > dynamic_events
> >
> >
> > Masami, you just recently added this test (it's dated March 27th 2025), did
> > you mean to write in the ASCII characters? Why the backslash?
> >
> > -- Steve
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2025-04-14 3:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 18:58 [PATCH v4 0/4] ftrace: Add function arguments to function tracers Steven Rostedt
2025-02-27 18:58 ` [PATCH v4 1/4] ftrace: Add print_function_args() Steven Rostedt
2025-02-27 18:58 ` [PATCH v4 2/4] ftrace: Add support for function argument to graph tracer Steven Rostedt
2025-04-09 22:34 ` Mark Brown
2025-04-10 17:17 ` Steven Rostedt
2025-04-11 13:00 ` Mark Brown
2025-04-11 16:45 ` Steven Rostedt
2025-04-11 16:48 ` Steven Rostedt
2025-04-11 17:02 ` Steven Rostedt
2025-04-11 17:33 ` Steven Rostedt
2025-04-11 16:58 ` Mark Brown
2025-04-11 17:12 ` Steven Rostedt
2025-04-11 17:39 ` Mark Brown
2025-04-11 18:16 ` Mark Brown
2025-04-11 18:24 ` Steven Rostedt
2025-04-11 18:29 ` Mark Brown
2025-04-11 18:31 ` Steven Rostedt
2025-04-11 19:13 ` Steven Rostedt
2025-04-11 19:26 ` Steven Rostedt
2025-04-11 19:27 ` Steven Rostedt
2025-04-14 3:00 ` Masami Hiramatsu [this message]
2025-04-14 3:08 ` Masami Hiramatsu
2025-04-14 13:31 ` Steven Rostedt
2025-04-15 17:40 ` Steven Rostedt
2025-08-09 2:24 ` Sasha Levin
2025-08-13 23:53 ` Steven Rostedt
2025-08-14 17:05 ` Sasha Levin
2025-08-19 22:21 ` Steven Rostedt
2025-02-27 18:58 ` [PATCH v4 3/4] ftrace: Have funcgraph-args take affect during tracing Steven Rostedt
2025-02-27 18:58 ` [PATCH v4 4/4] ftrace: Add arguments to function tracer Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250414120013.895b0cc99e52c41eb8ec3774@kernel.org \
--to=mhiramat@kernel.org \
--cc=Aishwarya.TCV@arm.com \
--cc=akpm@linux-foundation.org \
--cc=aou@eecs.berkeley.edu \
--cc=bpf@vger.kernel.org \
--cc=broonie@kernel.org \
--cc=dolinux.peng@gmail.com \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=rostedt@goodmis.org \
--cc=svens@linux.ibm.com \
--cc=zhengyejian@huaweicloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).