Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2861051pxb; Tue, 19 Jan 2021 07:51:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcDU3eX5Mny5WDR2ndLaPiK3LHsQGn4V+NXgXIr4Yj4WlaOMdwWVERbfjwJt3rDW1tpvZk X-Received: by 2002:aa7:d288:: with SMTP id w8mr3907655edq.241.1611071482490; Tue, 19 Jan 2021 07:51:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611071482; cv=none; d=google.com; s=arc-20160816; b=S/+DCOrxoDjFnn3qJD93js8mlxF1QrwpWkp92UwT9Ihq2SjISVV5yYAkNNpLQUHhI5 jQ40csBP74hoValIWdwQbZR5HFwWQL/riYod5oX6KdQ5fIFCiB9feoYf+QSL+SnzafEm UQCXJISdzkPklCA2O785tH3UY9scX2LULT9Uq2TvW1JNJvt5ZBKs3yH+NVqlEQbalJk4 69URxxeX66PW/R59naQzCcI/UitQMGdlVeN4dNfjGQuGXZubjEV8AGG+5xEgu0rdq98P 96fy0cPjlfehrReqUoCmPdYgvHUf9jmxOFxyDPm1wzaLNp0oJ+v1qpcqvvgfLxWtVM3u 5isw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=LAipQMpulmjzRAyn8AkMRZ0sZJgdSVPblKItQrUHwoY=; b=vfyRtVA+cK0DyEkkqu8J1aLrN0/Mpc6Y0sXKP8f/+p6gYaKQ3FXEw53rtmJFluibn+ wbV9uovuKCbMv7KoTSG4tAzI2opbe1uhfW8LeWyOtDL9AMNBZtuZsdeNoFXixv1pH4Pt aaZWBB1xT0L+a0V619b3HfcqW2DeK/bdyCsmfRcrcZitt6hVhRsO10TZnO0l8Lsp07y1 WMhB4DfO+6AVF7zTSb7DIr9BnIhoHCyoQKPgN2EvIgoG3rmgyumy24H16OlhjWKCQ73j jjIqUnO2+u/UcQIe9qdjTrhVkdWX7/ktrkxpyU9vbww7dT/xgBjYHiO2/94bw7s5ezOt pzuQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si8526982edd.589.2021.01.19.07.50.59; Tue, 19 Jan 2021 07:51:22 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390025AbhASPtg (ORCPT + 99 others); Tue, 19 Jan 2021 10:49:36 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2380 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728534AbhASPtJ (ORCPT ); Tue, 19 Jan 2021 10:49:09 -0500 Received: from fraeml735-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DKtHX22Xtz67bGm; Tue, 19 Jan 2021 23:44:08 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml735-chm.china.huawei.com (10.206.15.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 19 Jan 2021 16:48:15 +0100 Received: from [10.210.167.214] (10.210.167.214) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 19 Jan 2021 15:48:14 +0000 Subject: Re: [PATCH] perf metricgroup: Fix system PMU metrics To: Joakim Zhang , "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "mark.rutland@arm.com" , "alexander.shishkin@linux.intel.com" , "jolsa@redhat.com" , "namhyung@kernel.org" , "irogers@google.com" , "kjain@linux.ibm.com" CC: "linux-kernel@vger.kernel.org" , "linuxarm@openeuler.org" References: <1611050655-44020-1-git-send-email-john.garry@huawei.com> From: John Garry Message-ID: Date: Tue, 19 Jan 2021 15:47:00 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.167.214] X-ClientProxiedBy: lhreml753-chm.china.huawei.com (10.201.108.203) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/01/2021 10:56, Joakim Zhang wrote: > It seems have other issue compared to 5.10 kernel after switching to this framework, below metric can't work. > "MetricExpr": "(( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) * 4 * 4 / duration_time) / (750 * 1000000 * 4 * 4)" > After change to: > "MetricExpr": "(( imx8mm_ddr.read_cycles + imx8mm_ddr.write_cycles ) * 4 * 4 / duration_time) / (750 * 1000000 * 4 * 4)", It seems that any metric which includes "duration_time" is broken, even on x86: john@localhost:~/acme/tools/perf> sudo ./perf stat -v -M L1D_Cache_Fill_BW sleep 1 Using CPUID GenuineIntel-6-3D-4 metric expr 64 * l1d.replacement / 1000000000 / duration_time for L1D_Cache_Fill_BW found event duration_time found event l1d.replacement adding {l1d.replacement}:W,duration_time l1d.replacement -> cpu/umask=0x1,(null)=0x1e8483,event=0x51/ Segmentation fault Seems to be from my commit c2337d67199 ("perf metricgroup: Fix metrics using aliases covering multiple PMUs") I'll look to fix it now. Thanks, John