[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YqzIh1qx976G96NB@kernel.org>
Date: Fri, 17 Jun 2022 15:31:35 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: kajoljain <kjain@...ux.ibm.com>,
Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH] perf expr: Allow exponents on floating point values
Em Wed, Jun 15, 2022 at 10:16:32PM -0700, Ian Rogers escreveu:
> On Wed, Jun 8, 2022 at 10:47 PM kajoljain <kjain@...ux.ibm.com> wrote:
>
> > Patch looks fine to me
> >
> > Reviewed-By: Kajol Jain<kjain@...ux.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@...ux.intel.com>
> > > Signed-off-by: Ian Rogers <irogers@...gle.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
Powered by blists - more mailing lists