Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3372431pxb; Mon, 17 Jan 2022 18:55:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJznHiIGTkLTmAgqkY2hbUPpGCVz6CfeYzhg1aaBOZ9C7quVJqV0I6/nk0AEZr7mhRaGTa1M X-Received: by 2002:a05:6a00:1817:b0:4c4:775c:f3ea with SMTP id y23-20020a056a00181700b004c4775cf3eamr7013547pfa.29.1642474528545; Mon, 17 Jan 2022 18:55:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642474528; cv=none; d=google.com; s=arc-20160816; b=ytS8hwrVfhz8Wohx+PDPpADXwaA3tlI2QigiriA52iPk3HbN1WcJnJIVCwX8SEQCY6 7ScG9al8V6lyV1djgXaIyP0VV9lvQxjy5+FW3tRCuqhZswFrByAkxcUBwvEzfc9C95me qO+rXpyctD+KsncUAU0Qn2jZpQDqjpnJFnfPEqtIDbwwfjzqfXdtK+/7uDS20Xa0el6d c2QkblTs9IH4JP4zrMjI+H7xylbBEe3/QlWQOuuXvst6wVAETey+G1rhnhy1tSjkSPRJ +LIsyIt6cCPcjiiNUOxbdezYRNBmFmkp//NsBawzHxEMxE2T5pRxfM/4pjWQEKFUdpUN bFQg== 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=fg3XRkEj8BYPpL1AcNW+RDLzltg+0vDyFYWjMkd2n8k=; b=IV9sl+sQfVIQkHAkequZUJylmsC4E+kQD9pDSME8uMbt3wk/rGtBu38zecMMziegKV uLGT4e3V20kIxMpWR/yMdwwtTqWWXt3kx9JcByPYlp0p+hW9jJXnNkOo+wep0g9BNSA0 fR7gRLha5KEHq3vhGwxFJdA6+kIgtLpeF0t4xuxZNEiMMQRjZTBJmX3nkEM3D3rcNy6+ wWgodD2q56oeD/f9goRFKQqpWug2lN5/DaF72mObo0ZmvJvlj9NWoxj5ZABF57LeKz3y jrBLXkEY+3tfWZfUU/0NMUGw0itk3tYXm6sCkfzhrSOIKdkB47NUw1of/lDkwpaWx/Kt 72pg== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si17684312plx.594.2022.01.17.18.55.16; Mon, 17 Jan 2022 18:55:28 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242117AbiAQSEk (ORCPT + 99 others); Mon, 17 Jan 2022 13:04:40 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4424 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238147AbiAQSEh (ORCPT ); Mon, 17 Jan 2022 13:04:37 -0500 Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Jd07W2FqNz681RY; Tue, 18 Jan 2022 02:00:39 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Mon, 17 Jan 2022 19:04:30 +0100 Received: from [10.47.92.236] (10.47.92.236) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.21; Mon, 17 Jan 2022 18:04:30 +0000 Subject: Re: [PATCH] perf metric: Fix metric_leader To: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , "Namhyung Kim" , Andi Kleen , , CC: References: <20220115062852.1959424-1-irogers@google.com> From: John Garry Message-ID: <660a0c4f-cecd-df97-3fea-3d75d45fa02b@huawei.com> Date: Mon, 17 Jan 2022 18:04:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20220115062852.1959424-1-irogers@google.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.92.236] X-ClientProxiedBy: lhreml703-chm.china.huawei.com (10.201.108.52) 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 15/01/2022 06:28, Ian Rogers wrote: > Multiple events may have a metric_leader to aggregate into. This happens > for uncore events where, for example, uncore_imc is expanded into > uncore_imc_0, uncore_imc_1, etc. Such events all have the same metric_id > and should aggregate into the first event. The change introducing > metric_ids had a bug where the metric_id was compared to itself, > creating an always true condition. Correct this by comparing the > event in the metric_evlist and the metric_leader. > > Fixes: ec5c5b3d2c21 ("perf metric: Encode and use metric-id as qualifier") > Signed-off-by: Ian Rogers > --- Looks ok and I quickly tested it: Reviewed-by: John Garry