From: Tom Zanussi <zanussi@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: artem.bityutskiy@linux.intel.com, mhiramat@kernel.org,
linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v4 07/12] tracing: Add synth_event_trace() and related functions
Date: Wed, 29 Jan 2020 16:58:44 -0600 [thread overview]
Message-ID: <1580338724.6220.17.camel@kernel.org> (raw)
In-Reply-To: <20200129160915.4ebe0f08@gandalf.local.home>
Hi Steve,
On Wed, 2020-01-29 at 16:09 -0500, Steven Rostedt wrote:
> On Wed, 29 Jan 2020 12:59:27 -0600
> Tom Zanussi <zanussi@kernel.org> wrote:
>
> > +static struct synth_field *find_synth_field(struct synth_event
> > *event,
> > + const char
> > *field_name)
> > +{
> > + struct synth_field *field = NULL;
> > + unsigned int i;
> > +
> > + for (i = 0; i < event->n_fields; i++) {
> > + field = event->fields[i];
> > + if (strcmp(field->name, field_name) == 0)
> > + return field;
> > + }
> > +
> > + return NULL;
> > +}
>
> Why duplicate all theses functions and not use them in the
> synth_event_trace() directly?
>
Yes, find_synth_field() is used only once and is short, so I can just
add that into synth_event_add_val() directly. And looking at
synth_event_add_val() and synth_event_add_next_val(), they're almost
identical and so can be made into a single function with a param for
the different parts (but still need to be exported separately so they
can be used with the piecewise API).
It would also be possible to have synth_event_trace() and
synth_event_trace_array() use synth_event_add_next_val() instead of
writing the fields directly but that would be more overhead for those
functions, which is why I avoided doing that.
Let me know if it's something else you're referring to, or if you want
me to do a v5 or a follow-on patch to do the first part above.
Thanks,
Tom
> -- Steve
next prev parent reply other threads:[~2020-01-29 22:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 18:59 [PATCH v4 00/12] tracing: Add support for in-kernel dynamic event API Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 01/12] tracing: Add trace_array_find/_get() to find instance trace arrays Tom Zanussi
2020-01-29 21:14 ` Steven Rostedt
2020-01-29 18:59 ` [PATCH v4 02/12] tracing: Add trace_get/put_event_file() Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 03/12] tracing: Add synth_event_delete() Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 04/12] tracing: Add dynamic event command creation interface Tom Zanussi
2020-01-30 2:40 ` Masami Hiramatsu
2020-01-30 2:58 ` Steven Rostedt
2020-01-29 18:59 ` [PATCH v4 05/12] tracing: Add synthetic event command generation functions Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 06/12] tracing: Change trace_boot to use synth_event interface Tom Zanussi
2020-01-31 17:49 ` Tom Zanussi
2020-01-31 17:55 ` Steven Rostedt
2020-01-31 18:00 ` Steven Rostedt
2020-01-31 18:01 ` Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 07/12] tracing: Add synth_event_trace() and related functions Tom Zanussi
2020-01-29 21:09 ` Steven Rostedt
2020-01-29 22:58 ` Tom Zanussi [this message]
2020-01-30 3:01 ` Steven Rostedt
2020-01-29 18:59 ` [PATCH v4 08/12] tracing: Add synth event generation test module Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 09/12] tracing: Add kprobe event command generation functions Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 10/12] tracing: Change trace_boot to use kprobe_event interface Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 11/12] tracing: Add kprobe event command generation test module Tom Zanussi
2020-01-29 18:59 ` [PATCH v4 12/12] tracing: Documentation for in-kernel synthetic event API 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=1580338724.6220.17.camel@kernel.org \
--to=zanussi@kernel.org \
--cc=artem.bityutskiy@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.