From: Tom Zanussi <zanussi@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: rostedt@goodmis.org, axelrasmussen@google.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] tracing: Add support for dynamic strings to synthetic events
Date: Fri, 02 Oct 2020 17:06:17 -0500 [thread overview]
Message-ID: <61457f24d225ded7099a71cddeb4f735e18ccc28.camel@kernel.org> (raw)
In-Reply-To: <20201002161703.3961a96e84314fe31157f308@kernel.org>
Hi Masami,
On Fri, 2020-10-02 at 16:17 +0900, Masami Hiramatsu wrote:
> Hi Tom,
>
> On Wed, 30 Sep 2020 13:40:52 -0500
> Tom Zanussi <zanussi@kernel.org> wrote:
>
> > Currently, sythetic events only support static string fields such
> > as:
> >
> > # echo 'test_latency u64 lat; char somename[32]' >
> > /sys/kernel/debug/tracing/synthetic_events
> >
> > Which is fine, but wastes a lot of space in the event.
> >
> > It also prevents the most commonly-defined strings in the existing
> > trace events e.g. those defined using __string(), from being passed
> > to
> > synthetic events via the trace() action.
> >
> > With this change, synthetic events with dynamic fields can be
> > defined:
> >
> > # echo 'test_latency u64 lat; char somename[]' >
> > /sys/kernel/debug/tracing/synthetic_events
>
> Could you add a testcase (and update existing one) of ftracetest
> for this new feature too?
>
Yes, I'll add it in the next version.
> >
> > And the trace() action can be used to generate events using either
> > dynamic or static strings:
> >
> > # echo 'hist:keys=name:lat=common_timestamp.usecs-
> > $ts0:onmatch(sys.event).test_latency($lat,name)' >
> > /sys/kernel/debug/tracing/events
> >
> > The synthetic event dynamic strings are implemented in the same way
> > as
> > the existing __data_loc strings and appear as such in the format
> > file.
> >
> > Signed-off-by: Tom Zanussi <zanussi@kernel.org>
> > ---
> > Documentation/trace/events.rst | 15 +-
> > Documentation/trace/histogram.rst | 18 +++
> > kernel/trace/synth_event_gen_test.c | 18 ++-
> > kernel/trace/trace_events_hist.c | 9 ++
> > kernel/trace/trace_events_synth.c | 239
> > ++++++++++++++++++++++++----
> > kernel/trace/trace_synth.h | 4 +
>
> And you might also need to update tracefs/README so that user
> can check whether the kernel supports dynamic string or not.
>
Yeah, good to add regardless, will do.
Thanks,
Tom
prev parent reply other threads:[~2020-10-02 22:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 18:40 [PATCH v2 0/3] tracing: Add dynamic strings for " Tom Zanussi
2020-09-30 18:40 ` [PATCH v2 1/3] tracing: Change STR_VAR_MAX_LEN Tom Zanussi
2020-09-30 22:45 ` Axel Rasmussen
2020-10-01 21:50 ` Tom Zanussi
2020-09-30 18:40 ` [PATCH v2 2/3] tracing: Fix parse_synth_field() error handling Tom Zanussi
2020-10-01 5:27 ` Masami Hiramatsu
2020-10-01 21:50 ` Tom Zanussi
2020-09-30 18:40 ` [PATCH v2 3/3] tracing: Add support for dynamic strings to synthetic events Tom Zanussi
2020-10-02 7:17 ` Masami Hiramatsu
2020-10-02 22:06 ` Tom Zanussi [this message]
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=61457f24d225ded7099a71cddeb4f735e18ccc28.camel@kernel.org \
--to=zanussi@kernel.org \
--cc=axelrasmussen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/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
Powered by JetHome