mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Tom Zanussi <zanussi@kernel.org>
Cc: rostedt@goodmis.org, axelrasmussen@google.com,
	mhiramat@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] tracing: Add support for dynamic strings to synthetic events
Date: Fri, 2 Oct 2020 16:17:03 +0900	[thread overview]
Message-ID: <20201002161703.3961a96e84314fe31157f308@kernel.org> (raw)
In-Reply-To: <86c164d6476fd1fa9595ec79634b15c25f59e5b0.1601490263.git.zanussi@kernel.org>

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?

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


Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2020-10-02  7:17 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 [this message]
2020-10-02 22:06     ` Tom Zanussi

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=20201002161703.3961a96e84314fe31157f308@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=axelrasmussen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=zanussi@kernel.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