Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2995219ybt; Mon, 29 Jun 2020 12:23:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsz82v9u7JhFkVhCzQbGxhWt9iFiJNXMc8lGk2kS5oPsBt8L9i84w/6QjMTO7a4o2/pM/E X-Received: by 2002:a50:d8c2:: with SMTP id y2mr11381770edj.114.1593458633845; Mon, 29 Jun 2020 12:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593458633; cv=none; d=google.com; s=arc-20160816; b=RSIn9DWT9YRMRDshyP/isFh1iUmHOH3LbVRLLXbAbhqQB+K5S9+sw+w3gHjJvgVou+ /DuKJwNvQAKrdYeCf+D4bIi8lj2UzwyqZWCO/J/+8TrLJzVz7bp1fJIoX8Hx6G2lAFuL kktbOZZlBoie5ZNDjZSP4e/Nf6ysRvfV0BF/j8Wtted+Nn9SZPk3Y4qBY70/YIf2Znf6 jQNwM/jaPsMM8iPRh9LuG+cGGr8uhVJroXLuWd0q3rp5bAtD+Eu4JF9hEOZSj6oZPWu8 Ee9Uv3cG1QmbmHKn+kFcEJK1saiPYE6vLt18Sucjcdn61sCcowCKdhiAlpDQGE9vVC1t YJIw== 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=8sjxgsbXUH5TliF6aeepZ4Uon8SNTJXYIGtvY8oeRGE=; b=A5vnVVq0lsGI/Uco+h9ftq7/iJJPDMt/no94Rtx+uNJWS1AitYIhs6UkttToFxzoha CjHzF54UD5SQTOdl80FhXcZL5/9oIjzA8ydjCEI+uVP3iCd094w2kjrwqprBvzUo78Sz V0UKgxhE99oWs6l+8svmgWq99Rcj9noSQQyrge1NsnorayiiON4OnZ5Kg5I4AgZPcOwj qVeKI/ON1qJJJEVslpjB4OXngxXRpq14z4WKy/VYda9xRXc5mG4sqJzUyhSdKJDpmAKO /el+543Ynb++X9uIDddZidb3Fht42ZcytOcp2E3uQ/Yb+JXOqFFHebeEOgHxFKoeh8PV AuQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FJ258LRJ; 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 me25si356946ejb.164.2020.06.29.12.23.30; Mon, 29 Jun 2020 12:23:53 -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=FJ258LRJ; 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 S1732292AbgF2TXW (ORCPT + 99 others); Mon, 29 Jun 2020 15:23:22 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:51556 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730502AbgF2TXT (ORCPT ); Mon, 29 Jun 2020 15:23:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593458597; 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=8sjxgsbXUH5TliF6aeepZ4Uon8SNTJXYIGtvY8oeRGE=; b=FJ258LRJLStdpR8GHdntc7vs9z1PYe+nbraMw7FsFYmxoKTot+yqSfCAmnUD7L2ig1F8pa U5nc/RtfErZjG4hVF/zdmVGQMXj2YNG7p0TfjS+m490xDnr5Up/gQ8ZvjCC0fzBb2BHnms w5b0QR3tkT0z3RhwbW31u5lnZ/5z6v8= 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-467-j_ra0JiINkOtileaBTFjaA-1; Mon, 29 Jun 2020 15:23:15 -0400 X-MC-Unique: j_ra0JiINkOtileaBTFjaA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 165E9A0C0D; Mon, 29 Jun 2020 19:23:13 +0000 (UTC) Received: from krava (unknown [10.40.195.81]) by smtp.corp.redhat.com (Postfix) with SMTP id 0D59D9CFF2; Mon, 29 Jun 2020 19:23:09 +0000 (UTC) Date: Mon, 29 Jun 2020 21:23:09 +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: <20200629192309.GD3031756@krava> References: <20200626194720.2915044-1-jolsa@kernel.org> <20200626194720.2915044-10-jolsa@kernel.org> <20200628215957.GO2988321@krava> 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.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 09:35:12AM -0700, Ian Rogers wrote: SNIP > > { > "BriefDescription": "All L2 hit counts", > "MetricExpr": "L2_RQSTS.DEMAND_DATA_RD_HIT + L2_RQSTS.PF_HIT + > L2_RQSTS.RFO_HIT", > "MetricName": "DCache_L2_All_Hits", > } > { > "BriefDescription": "All L2 miss counts", > "MetricExpr": "MAX(L2_RQSTS.ALL_DEMAND_DATA_RD - > L2_RQSTS.DEMAND_DATA_RD_HIT, 0) + L2_RQSTS.PF_MISS + > L2_RQSTS.RFO_MISS", > "MetricName": "DCache_L2_All_Miss", > } > { > "BriefDescription": "All L2 counts", > "MetricExpr": "metric:DCache_L2_All_Hits + metric:DCache_L2_All_Miss", > "MetricName": "DCache_L2_All", > } > { > "BriefDescription": "DCache L2 hit rate", > "MetricExpr": "d_ratio(metric:DCache_L2_All_Hits, metric:DCache_L2_All)", > "MetricName": "DCache_L2_Hits", > "MetricGroup": "DCache_L2", > "ScaleUnit": "100%", > }, > { > "BriefDescription": "DCache L2 miss rate", > "MetricExpr": "d_ratio(metric:DCache_L2_All_Miss, metric:DCache_L2_All)", > "MetricName": "DCache_L2_Misses", > "MetricGroup": "DCache_L2", > "ScaleUnit": "100%", > }, > > Firstly, it should be clear that having this change makes the json far > more readable! The current approach is to copy and paste resulting in > 100s of characters wide expressions. This is a great improvement! > > With these metrics the hope would be that 'perf stat -M DCache_L2 ...' > is going to report just DCache_L2_Hits and DCache_L2_Misses. To > compute these two metrics, as an example, DCache_L2_All_Hits is needed > three times. My comment was meant to mean that it seems a little > unfortunate to keep repeatedly evaluating the expression rather than > to compute it once and reuse the result. nice example, the code should evaluate the expression just once as long as it's under same name.. I'll prepare new version and verify that's the case with the example above thanks, jirka