lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 5/5] perf metric: Don't compute unused events.
> +| expr '-' expr
> +{
> + if (!compute_ids || (is_const($1.val) && is_const($3.val))) {
> + assert($1.ids == NULL);
> + assert($3.ids == NULL);
> + $$.val = $1.val - $3.val;
> + $$.ids = NULL;
> + } else {
> + /* LHS and/or RHS need computing from event IDs so union. */
> + $$ = union_expr($1, $3);
> + }

Can't this be all in a macro? It's still a lot of duplication.

I'm still not a fan, but I think with a macro it wouldn't be too bad.


-Andi

\
 
 \ /
  Last update: 2020-12-02 07:40    [W:0.054 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site