From: Tom Zanussi <zanussi@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: [PATCH] tracing/histograms: Fix parsing of "sym-offset" modifier
Date: Wed, 07 Jul 2021 11:30:46 -0500 [thread overview]
Message-ID: <9769cf1a02fae0be892d6b69cc624eb2b41c1d4d.camel@kernel.org> (raw)
In-Reply-To: <20210707110821.188ae255@oasis.local.home>
Hi Steve,
On Wed, 2021-07-07 at 11:08 -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> With the addition of simple mathematical operations (plus and minus),
> the
> parsing of the "sym-offset" modifier broke, as it took the '-' part
> of the
> "sym-offset" as a minus, and tried to break it up into a mathematical
> operation of "field.sym - offset", in which case it failed to parse
> (unless the event had a field called "offset").
>
> Both .sym and .sym-offset modifiers should not be entered into
> mathematical calculations anyway. If ".sym-offset" is found in the
> modifier, then simply make it not an operation that can be calculated
> on.
>
> Cc: stable@vger.kernel.org
> Fixes: 100719dcef447 ("tracing: Add simple expression support to hist
> triggers")
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> kernel/trace/trace_events_hist.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/kernel/trace/trace_events_hist.c
> b/kernel/trace/trace_events_hist.c
> index ba03b7d84fc2..0207aeed31e6 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -1555,6 +1555,13 @@ static int contains_operator(char *str)
>
> switch (*op) {
> case '-':
> + /*
> + * Unfortunately, the modifier ".sym-offset"
> + * can confuse things.
> + */
Good catch.
> + if (op - str >= 4 && !strncmp(op - 4, ".sym-offset",
> 11))
> + return FIELD_OP_NONE;
> +
> if (*str == '-')
> field_op = FIELD_OP_UNARY_MINUS;
> else
Reviewed-by: Tom Zanussi <zanussi@kernel.org>
prev parent reply other threads:[~2021-07-07 16:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 15:08 Steven Rostedt
2021-07-07 16:30 ` 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=9769cf1a02fae0be892d6b69cc624eb2b41c1d4d.camel@kernel.org \
--to=zanussi@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bristot@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@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
all inboxes | Powered by JetHome®