[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201119205920.GM1475102@krava>
Date: Thu, 19 Nov 2020 21:59:20 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
Jin Yao <yao.jin@...ux.intel.com>,
John Garry <john.garry@...wei.com>,
Paul Clarke <pc@...ibm.com>, kajoljain <kjain@...ux.ibm.com>,
Stephane Eranian <eranian@...gle.com>,
Sandeep Dasgupta <sdasgup@...gle.com>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v2 5/5] perf metric: Don't compute unused events.
On Tue, Nov 17, 2020 at 09:03:35PM -0800, Ian Rogers wrote:
SNIP
> + ids__free($1.ids);
> + ids__free($3.ids);
> + }
> + } else {
> + $$.val = NAN;
> + $$.ids = ids__union($1.ids, $3.ids);
> + }
> +}
> +| expr '*' expr
> +{
> + if (!compute_ids || (isfinite($1.val) && isfinite($3.val))) {
> + $$.val = $1.val * $3.val;
> + $$.ids = NULL;
> + if (compute_ids) {
> + ids__free($1.ids);
> + ids__free($3.ids);
> + }
> + } else {
> + $$.val = NAN;
> + $$.ids = ids__union($1.ids, $3.ids);
> + }
> +}
> +| expr '/' expr
> +{
> + if (fpclassify($3.val) == FP_ZERO) {
> + pr_debug("division by zero\n");
> + YYABORT;
> + } else if (!compute_ids || (isfinite($1.val) && isfinite($3.val))) {
> + $$.val = $1.val / $3.val;
> + $$.ids = NULL;
hum, I'm confused with this.. compute_ids with finite values?
why do we erase ids then? also val should be NAN then, no?
could you please put in some comment with reasoning?
thanks,
jirka
Powered by blists - more mailing lists