lkml.org 
[lkml]   [2020]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2020-11-19 22:01    [W:0.414 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site