From: Tom Zanussi <tzanussi@gmail.com>
To: 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 06/12] tracing: Change trace_boot to use synth_event interface
Date: Fri, 31 Jan 2020 11:49:01 -0600 [thread overview]
Message-ID: <1580492941.24839.5.camel@gmail.com> (raw)
In-Reply-To: <94f1fa0e31846d0bddca916b8663404b20559e34.1580323897.git.zanussi@kernel.org>
Hi Steve,
It looks like you missed this patch when you pulled the other ones into
for-next.
Tom
On Wed, 2020-01-29 at 12:59 -0600, Tom Zanussi wrote:
> Have trace_boot_add_synth_event() use the synth_event interface.
>
> Also, rename synth_event_run_cmd() to synth_event_run_command() now
> that trace_boot's version is gone.
>
> Signed-off-by: Tom Zanussi <zanussi@kernel.org>
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> kernel/trace/trace_boot.c | 31 ++++++++++++----------------
> ---
> kernel/trace/trace_events_hist.c | 9 ++-------
> 2 files changed, 14 insertions(+), 26 deletions(-)
>
> diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
> index 2f616cd926b0..8f40de349db1 100644
> --- a/kernel/trace/trace_boot.c
> +++ b/kernel/trace/trace_boot.c
> @@ -133,38 +133,31 @@ trace_boot_add_kprobe_event(struct xbc_node
> *node, const char *event)
> #endif
>
> #ifdef CONFIG_HIST_TRIGGERS
> -extern int synth_event_run_command(const char *command);
> -
> static int __init
> trace_boot_add_synth_event(struct xbc_node *node, const char *event)
> {
> + struct dynevent_cmd cmd;
> struct xbc_node *anode;
> - char buf[MAX_BUF_LEN], *q;
> + char buf[MAX_BUF_LEN];
> const char *p;
> - int len, delta, ret;
> + int ret;
>
> - len = ARRAY_SIZE(buf);
> - delta = snprintf(buf, len, "%s", event);
> - if (delta >= len) {
> - pr_err("Event name is too long: %s\n", event);
> - return -E2BIG;
> - }
> - len -= delta; q = buf + delta;
> + synth_event_cmd_init(&cmd, buf, MAX_BUF_LEN);
> +
> + ret = synth_event_gen_cmd_start(&cmd, event, NULL);
> + if (ret)
> + return ret;
>
> xbc_node_for_each_array_value(node, "fields", anode, p) {
> - delta = snprintf(q, len, " %s;", p);
> - if (delta >= len) {
> - pr_err("fields string is too long: %s\n",
> p);
> - return -E2BIG;
> - }
> - len -= delta; q += delta;
> + ret = synth_event_add_field_str(&cmd, p);
> + if (ret)
> + return ret;
> }
>
> - ret = synth_event_run_command(buf);
> + ret = synth_event_gen_cmd_end(&cmd);
> if (ret < 0)
> pr_err("Failed to add synthetic event: %s\n", buf);
>
> -
> return ret;
> }
> #else
> diff --git a/kernel/trace/trace_events_hist.c
> b/kernel/trace/trace_events_hist.c
> index 5a910bb193e9..22cd7ecdfb92 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -1752,12 +1752,7 @@ static int create_or_delete_synth_event(int
> argc, char **argv)
> return ret == -ECANCELED ? -EINVAL : ret;
> }
>
> -int synth_event_run_command(const char *command)
> -{
> - return trace_run_command(command,
> create_or_delete_synth_event);
> -}
> -
> -static int synth_event_run_cmd(struct dynevent_cmd *cmd)
> +static int synth_event_run_command(struct dynevent_cmd *cmd)
> {
> struct synth_event *se;
> int ret;
> @@ -1787,7 +1782,7 @@ static int synth_event_run_cmd(struct
> dynevent_cmd *cmd)
> void synth_event_cmd_init(struct dynevent_cmd *cmd, char *buf, int
> maxlen)
> {
> dynevent_cmd_init(cmd, buf, maxlen, DYNEVENT_TYPE_SYNTH,
> - synth_event_run_cmd);
> + synth_event_run_command);
> }
> EXPORT_SYMBOL_GPL(synth_event_cmd_init);
>
next prev parent reply other threads:[~2020-01-31 17:49 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 [this message]
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
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=1580492941.24839.5.camel@gmail.com \
--to=tzanussi@gmail.com \
--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 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).