All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: kajoljain <kjain@linux.ibm.com>,
	Zhengjun Xing <zhengjun.xing@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf expr: Allow exponents on floating point values
Date: Fri, 17 Jun 2022 15:31:35 -0300	[thread overview]
Message-ID: <YqzIh1qx976G96NB@kernel.org> (raw)
In-Reply-To: <CAP-5=fVY-tdEzXi8fcPGQdQf+F93OTzA7z6UksQy=c6Vh7uPpA@mail.gmail.com>

Em Wed, Jun 15, 2022 at 10:16:32PM -0700, Ian Rogers escreveu:
> On Wed, Jun 8, 2022 at 10:47 PM kajoljain <kjain@linux.ibm.com> wrote:
> 
> > Patch looks fine to me
> >
> > Reviewed-By: Kajol Jain<kjain@linux.ibm.com>
> >
> 
> Thanks! Arnaldo, can this one go in?

Sure, applied.

- Arnaldo
 
> Ian
> 
> 
> >
> > On 5/27/22 07:36, Ian Rogers wrote:
> > > Pass the optional exponent component through to strtod that already
> > > supports it. We already have exponents in ScaleUnit and so this adds
> > > uniformity.
> > >
> > > Reported-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
> > > Signed-off-by: Ian Rogers <irogers@google.com>
> > > ---
> > >  tools/perf/tests/expr.c | 2 ++
> > >  tools/perf/util/expr.l  | 2 +-
> > >  2 files changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
> > > index d54c5371c6a6..5c0032fe93ae 100644
> > > --- a/tools/perf/tests/expr.c
> > > +++ b/tools/perf/tests/expr.c
> > > @@ -97,6 +97,8 @@ static int test__expr(struct test_suite *t
> > __maybe_unused, int subtest __maybe_u
> > >       ret |= test(ctx, "2.2 > 2.2", 0);
> > >       ret |= test(ctx, "2.2 < 1.1", 0);
> > >       ret |= test(ctx, "1.1 > 2.2", 0);
> > > +     ret |= test(ctx, "1.1e10 < 1.1e100", 1);
> > > +     ret |= test(ctx, "1.1e2 > 1.1e-2", 1);
> > >
> > >       if (ret) {
> > >               expr__ctx_free(ctx);
> > > diff --git a/tools/perf/util/expr.l b/tools/perf/util/expr.l
> > > index 0a13eb20c814..4dc8edbfd9ce 100644
> > > --- a/tools/perf/util/expr.l
> > > +++ b/tools/perf/util/expr.l
> > > @@ -91,7 +91,7 @@ static int literal(yyscan_t scanner)
> > >  }
> > >  %}
> > >
> > > -number               ([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)
> > > +number               ([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)(e-?[0-9]+)?
> > >
> > >  sch          [-,=]
> > >  spec         \\{sch}
> >

-- 

- Arnaldo

      parent reply	other threads:[~2022-06-17 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  2:06 [PATCH] perf expr: Allow exponents on floating point values Ian Rogers
2022-06-09  5:30 ` Ian Rogers
2022-06-09  5:46 ` kajoljain
     [not found]   ` <CAP-5=fVY-tdEzXi8fcPGQdQf+F93OTzA7z6UksQy=c6Vh7uPpA@mail.gmail.com>
2022-06-17 18:31     ` Arnaldo Carvalho de Melo [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=YqzIh1qx976G96NB@kernel.org \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tmricht@linux.ibm.com \
    --cc=zhengjun.xing@linux.intel.com \
    /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.