Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2301225ybt; Sun, 28 Jun 2020 15:00:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnwZENofT4Jnj0yEcdTbjsCOXxbRHcUGIZFvW6+h80JfrXFhh11dFkTvPSAtRLS0tOeMWC X-Received: by 2002:a05:6402:3048:: with SMTP id bu8mr14931004edb.367.1593381643032; Sun, 28 Jun 2020 15:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593381643; cv=none; d=google.com; s=arc-20160816; b=jCjvV+OwAU5AEQ7P50PDoxYybU5UpLEB5eCUZeT9jPlcHFxD4cwVcz5wfxv4rS3B3D SLkODXvEItlb6ccGFUjAjx5oSz746b+o707lP5aE0FY1+S3T+lpSRtptVL5y5p8wH1Mj wQ0bF5t62BTfhvzxx4122BDBDusrKt7Q3GI6YNWNtbYVnKEaUV53RJxIE6CrGDN8aZWY P+p+4qHzaawmzNi3dSb98sCeO+3pw3RDnxvKdmXYENJ0fYQrhrAqGbpsKs9z1cM/ZoXm e+DKE/Yx2WyNYq4GFlFNrCzXTJP1xoAlJbAro9Ep0evCKi6sa64PBFt62Lt6CrcVqpS0 Apug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3+kqHrF5IVEZWKjxO7T2nqUedq6/nP/FcOlUEuYV78M=; b=e4p4dKK6JtlXI+gBVivVDh4tsWOVUZNfBIyqtIIvGyCnK4H5vB1ySBd5iMRFEaG1U8 y+bV61gi8JoJnYsrutQt3OvTvQKWw/3s2azRak+FDyebNb5W04S+TXF7RmQsGFoWWsCP 6MlDs7igqWLMKa9OF8/2LcrieN0kpJ222/e67pt13vcgOzq9WiD2GygVno0n1341/rSE yuxlmSGbouY4q7O+0Y+rr8KxXlpsXIaOE4tuN3Cje9HVHKkSWaC5VrVFyIHPWCyS7UIT UDZ3o9fSCi1asdHwq6fDwOylYGTp82Upz20qnH2uqu6SLY1kiReAvWHi0Jf7pQMXyH2z wGWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WDaF/wXb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw22si6937844ejb.61.2020.06.28.15.00.20; Sun, 28 Jun 2020 15:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WDaF/wXb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbgF1WAH (ORCPT + 99 others); Sun, 28 Jun 2020 18:00:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20080 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726080AbgF1WAH (ORCPT ); Sun, 28 Jun 2020 18:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593381605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3+kqHrF5IVEZWKjxO7T2nqUedq6/nP/FcOlUEuYV78M=; b=WDaF/wXbbtsbA+a/mglWPCH4gamrmq3+GeDF4Nxlu7zKZ00YsLdi34e51PDuobo8+e9y5Q ePFJpWGowyODAUpHAi9x4/enHdXCQcZLttyIwr180+QyfMY0hK/GGWx9TzeDf46+Iu5MI9 WVUeenEh4zIJhsAd1XMF+96zwoZKpx8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-325-PI5KVIZdNJOybjvvC1XHWA-1; Sun, 28 Jun 2020 18:00:03 -0400 X-MC-Unique: PI5KVIZdNJOybjvvC1XHWA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3144B1005512; Sun, 28 Jun 2020 22:00:01 +0000 (UTC) Received: from krava (unknown [10.40.192.56]) by smtp.corp.redhat.com (Postfix) with SMTP id 5C1C6121B73; Sun, 28 Jun 2020 21:59:58 +0000 (UTC) Date: Sun, 28 Jun 2020 23:59:57 +0200 From: Jiri Olsa To: Ian Rogers Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Andi Kleen , Kajol Jain , John Garry , "Paul A. Clarke" , Stephane Eranian Subject: Re: [PATCH 09/10] perf tools: Compute other metrics Message-ID: <20200628215957.GO2988321@krava> References: <20200626194720.2915044-1-jolsa@kernel.org> <20200626194720.2915044-10-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 02:24:38PM -0700, Ian Rogers wrote: SNIP > > + > > + if (expr__get_id(ctx, lookup, &data) || !data) { > > pr_debug("%s not found\n", $1); > > free($1); > > YYABORT; > > } > > + > > + pr_debug2("lookup: is_other %d, counted %d: %s\n", > > + data->is_other, data->other.counted, lookup); > > + > > + if (data->is_other && !data->other.counted) { > > + data->other.counted = true; > > + if (expr__parse(&data->val, ctx, data->other.metric_expr, 1)) { > > Ah, so this handles the problem the referenced metric isn't calculated > and calculates it - with the sharing of events this doesn't impose > extra pmu cost. Do we need to worry about detecting recursion? For > example: > > "MetricName": "Foo", > "MetricExpr": "1/metric:Foo", right, we should add some recursion check, I'll lcheck on it > > It seems unfortunate to have the MetricExpr calculated twice, but it hum, not sure what you mean by twice.. we do that just once for each involved metric and store the value.. the metric is also processed before for 'other' metrics jirka > is understandable. Is it also a property that referenced/other metrics > won't be reported individually? Perhaps these are sub-metrics? > > Thanks, > Ian > > > + pr_debug("%s failed to count\n", $1); > > + free($1); > > + YYABORT; > > + } > > + } > > + > > $$ = data->val; > > free($1); > > } > > -- > > 2.25.4 > > >