Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp140310iob; Tue, 17 May 2022 21:36:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUXY3Mg2a75z3EjyO/YVdZ1AoZTRnLCNIMkyFJFWnBD5QIJjipWso9EwEFZgFQiUm2Jrsq X-Received: by 2002:a63:4b4a:0:b0:3f2:7ade:d178 with SMTP id k10-20020a634b4a000000b003f27aded178mr9372973pgl.255.1652848579021; Tue, 17 May 2022 21:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652848579; cv=none; d=google.com; s=arc-20160816; b=1DSx6tFU35fXZmw7naEq45AjuPSgLoF5AgZjVscPtLq4zZLTYbmmuuFRzN9yYyiC7q npcpYzi8I4tf3fobN4/xYOSkSHiSyrercfy8aR3+sAm9A79z4n/VYa82O+meb7fYa4G2 b/ha/K9g2YUCkecK38Nzlh/aNkn2TBLsLLypFY5MeUbkxhqXrZ3ky5b4ldGqMgQPPDej Y0gQVcAzNEJJBHfOsO9R+fDxZ2H26XdGS3F9Up8ArcyzIRZf3eLM+SYNtYfP1ir386cG TMBQpqYpcEAkaWUJ5it8NqD8aJ8l1ZDtgrhH29u+dCUxPDTQ4eBlP4Rsw2LnkfaqnrhM m2zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/nHmrvIDGXYnLEMnPaH0QdvQN09IiblHJ6WGMWZ01O4=; b=e78dNuUQ/SeC1w1J9dXKT6zyCcD2BmDgi3+Hqgnl8STqtGCXmSpQAP+vf9Pko2uCT8 KYLvjWxwpv+hpvQiGhEUJTHZyls0Yg6b69wApemBa6CzAPAw5KDiYV1z/YU+AOhZDuLU ePu4Eff35vheuE3s/3Uz5pvRzaoV1cAsXnoRBhETnbqYGfiFANu5oE6IoxcHfDrr3i6A vXUsY4ZYCU8jiDabsWk+8IiqgtB7J5mR27ibNVuZguFHk7edtdSpQ9pmc67bpZkiIVLA f+VdCLUVwx9xCGw1A5eUQsN4l6US7yYYrfqTmvl4dXwuvHOvg91RVM5GFiDgnUAkVSDp vbBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fUuqloN3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q17-20020a170902eb9100b00158d6f07b2esi1267887plg.85.2022.05.17.21.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:36:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fUuqloN3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 55CDAC03A0; Tue, 17 May 2022 20:54:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234345AbiERCp0 (ORCPT + 99 others); Tue, 17 May 2022 22:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234315AbiERCpU (ORCPT ); Tue, 17 May 2022 22:45:20 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDA7254688; Tue, 17 May 2022 19:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652841918; x=1684377918; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HkJveV1SObdCl0X5UzbD536bvT+Ssfn5TL+iMP961Dw=; b=fUuqloN3j8tRp/6ynaOqdVJbKjB8u8cI/WNW4IOTmJMObp0lB+Rdsd30 A0WDNFhqAKniRfKrMczHTnYS8+O4o8kLtvm7KAfQIAJ+gZgwdLiel/5jm ma9Qv2PM4YQNruQViLycqarRIOKGxYSGJYSkMpCwd3YOTR/J9EYExNgXo FaKpyQzlpTkbN9fb4BM4Ef4vrFFpGDx8xXERMvBu3AKTdmMfn8dRWn1DE vQdX/+w2J9c3EFDJJc3yLZRpZakRC2dJQTqKp1xLDTlw2rW+YwvFtjFgs 6vEDwQfVfqPCGH66U/l0P62/QV9R8OcCn2lbYKMThlaYLGLXtD6MzkN0N Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="296729043" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="296729043" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 19:45:18 -0700 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="597479183" Received: from xingzhen-mobl.ccr.corp.intel.com (HELO [10.255.31.182]) ([10.255.31.182]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 19:45:13 -0700 Message-ID: <8f846bfe-af5d-d895-0ee4-a5bbbae1fd06@linux.intel.com> Date: Wed, 18 May 2022 10:45:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 1/5] Revert "perf stat: Support metrics with hybrid events" Content-Language: en-US To: Namhyung Kim Cc: "Liang, Kan" , Arnaldo Carvalho de Melo , Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Riccardo Mancini , Kim Phillips , Madhavan Srinivasan , Shunsuke Nakamura , Florian Fischer , Andi Kleen , John Garry , Adrian Hunter , James Clark , linux-perf-users , linux-kernel , Stephane Eranian References: <20220507053410.3798748-1-irogers@google.com> <20220507053410.3798748-2-irogers@google.com> <708fab8f-b5c5-8f34-4322-3e337c56b869@linux.intel.com> From: Xing Zhengjun In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/18/2022 6:58 AM, Namhyung Kim wrote: > Hello, > > On Tue, May 10, 2022 at 2:31 AM Xing Zhengjun > wrote: >> >> >> >> On 5/10/2022 5:55 AM, Liang, Kan wrote: >>> >>> >>> On 5/9/2022 9:12 AM, Arnaldo Carvalho de Melo wrote: >>>> Em Fri, May 06, 2022 at 10:34:06PM -0700, Ian Rogers escreveu: >>>>> This reverts commit 60344f1a9a597f2e0efcd57df5dad0b42da15e21. >>>> >>>> I picked this from the cover letter and added to this revert, to justify >>>> it: >>>> >>>> "Hybrid metrics place a PMU at the end of the parse string. This is >>>> also where tool events are placed. The behavior of the parse string >>>> isn't clear and so revert the change for now." >>>> >>> >>> I think the original patch used a "#" to indicate the PMU name, which >>> can be used to distinguish between the tool events and the PMU name. >>> To be honest, I'm not sure what's unclear here. Could you please clarify? >>> >>> With this revert, the issue mentioned in the original patch must be >>> broken on ADL. I don't see a replacement fix in this patch series. >>> Could you please propose a solution for the issue to replace the #PMU >>> name solution? >>> >>> Thanks, >>> Kan >> >> I am surprised the origin patch is reverted during discussion and though >> the discussion still has no conclusion. >> Let me introduce the purpose of the origin patch. >> For a hybrid system such as ADL, if both the metrics and the formula are >> different for the different PMUs, without this patch, the metric and >> event parser should work ok, nothing should be special for the hybrid. >> In fact, both "cpu_core" and "cpu_atom" may have the same metrics--the >> same metric name, even the same formula for the metrics. For example, >> both "cpu_core" and "cpu_atom" have metrics "IpBranch" and "IPC", For >> "IpBranch", both "cpu_core" and "cpu_atom" has the same metric name and >> their formula also is the same, the event name is the same though they >> belong to different PMUs. The old metric and event parser can not handle >> this kind of metric, that's why we need this patch. >> >> "MetricExpr": "INST_RETIRED.ANY / BR_INST_RETIRED.ALL_BRANCHES", >> "MetricName": "IpBranch", >> "Unit": "cpu_core" >> >> "MetricExpr": "INST_RETIRED.ANY / BR_INST_RETIRED.ALL_BRANCHES", >> "MetricName": "IpBranch", >> "Unit": "cpu_atom" >> >> >> "MetricExpr": "INST_RETIRED.ANY / CPU_CLK_UNHALTED.THREAD", >> "MetricName": "IPC", >> "Unit": "cpu_core" >> >> "MetricExpr": "INST_RETIRED.ANY / CPU_CLK_UNHALTED.CORE", >> "MetricName": "IPC", >> "Unit": "cpu_atom" >> >> Except for the above two metrics, there are still a lot of similar >> metrics, "CPU_Utilization"... >> >> The original patch expanded the metric group string by adding >> "#PMU_name" to indicate the PMU name, which can be used to distinguish >> between the tool events and the PMU name, then the metric and event >> parser can parse the right PMU for the events. >> >> With the patch all the ADL metrics can pass, without the patch, a lot of >> metrics will fail. I don't think it's a good idea to revert it before >> the new solution is proposed. > > Just an idea. Can we add a pmu prefix when it resolves the event > for a metric if it has the "Unit"? It seems we can support something > like "cpu_core@INST_RETIRED.ANY@" already.. > > Or could it be done when creating JSON files? > > Thanks, > Namhyung Yes, we have ever tested it, and it can work. we are changing the converter tools to implement it, but it still has some issues that need to fix. -- Zhengjun Xing