Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp845934rwd; Thu, 1 Jun 2023 07:18:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Lkmu4Hx4o0WGCpDAJepvTgyFJ7bhQ4CcZrSjSHOPQRxiQOqj9/3x3XuGzaEktzREGFUzY X-Received: by 2002:a17:902:a508:b0:1ae:8a22:d0dd with SMTP id s8-20020a170902a50800b001ae8a22d0ddmr5461805plq.58.1685629114338; Thu, 01 Jun 2023 07:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685629114; cv=none; d=google.com; s=arc-20160816; b=btJz3SLZ+MOfUE6JLjKWdgbgxYu8QnXeI0WAlcmK6EWxtA5rijf6A8AL2OiiQvLWu9 KPdUbTxHgWQ6lAVLJ3K0FgJKSuFnIgbKyiF4lpsIbp1MAPwvRILfQuBAPubN/yPOC9V/ jV6wUooo2wxBpWgGNFVEHTYw83ADSZgCmc9yq6kBFmAF7OM8feevWjyqxGGPQZcWtNxz ne7U4qvHJ9ffMWICzlgzGuY58mDw0FW1tsvfBSGrzWGkgomQXIHw5+oxZSc/Ok7Em3f5 YqereaYOqLX19COGJmfpqe6Ph/wdC6RPQrFNQd4NMuy+64BmJV9c8bvQgKVGTevShL19 99nw== 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 :content-language:references:to:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=UeTN2mcSkSslKzQ51yHir5QJowqX3o+Xz2rqvi8Kc3s=; b=Q+hUZKJR1Kud86fDdM1srDyNQ9hEGcZ0kW+Ir+f1Ew1YFAjHL6wGkKPdbhehNz4RID OlNuB51b0hN7htFTKytH2U6SimFha/6FaJ3eeOhrbMi4gnC10O2H2ov2AgMGIPt2/Lk9 4Eo08xOmGMu4NMvYqE1mhFjociYGKrUD3sDY3JVkSgk6FHBdTMZOQF5llDpytvRROp4U NcY9CkXNtERoXvF50yQBBc/sgVZWU+yIN8O9bM+pWr7oVbZsmgZthEJYngHlZZDsk3hS N3cjdfr8k2/nyWSqppcxDghuM3L4vK1Kg+wy2fxULo+OqzeS8q43nl4nygbo2US02U7r mIpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mBXNqss8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a170903231000b001b176dc95dbsi1044350plh.593.2023.06.01.07.18.20; Thu, 01 Jun 2023 07:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mBXNqss8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233470AbjFANwQ (ORCPT + 99 others); Thu, 1 Jun 2023 09:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbjFANwO (ORCPT ); Thu, 1 Jun 2023 09:52:14 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806D319D; Thu, 1 Jun 2023 06:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685627530; x=1717163530; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=CuACTIe8A0TwoGkPomhkNyZGUJBANVSuy0fG6EihahM=; b=mBXNqss80vUQK0zKqv8r06RgAKFVwAVGiG7XzS1bVcOt3S0Mf17t5dkS YS7F6EdSvw/AcmOyWwjB9ArMA2AVMiejmK6KeIar2cbab/khsemgboCCS wO1FSKhDN18Z3AWpcI4sbk6ED3zyPXiwzdEUqHxddS2I/NNdKwUh+//2J IZsOMQvc+DMaEXn+eO8cMKs+6rI9y1lpjP06ma8K4voKpFGE2St1KqPGx XYif3UfuzRU9iSx4Alw+qTlL2nCoNUEs+PMwD7pzX30TWpbFSnedlcbRn Fscb7qpmuXwy7kprZr+JR8z48L6NYXeD+dNO106f0BLZ2EMGRRx4gxWRX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="441922533" X-IronPort-AV: E=Sophos;i="6.00,210,1681196400"; d="scan'208";a="441922533" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 06:52:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="819794663" X-IronPort-AV: E=Sophos;i="6.00,210,1681196400"; d="scan'208";a="819794663" Received: from linux.intel.com ([10.54.29.200]) by fmsmga002.fm.intel.com with ESMTP; 01 Jun 2023 06:52:09 -0700 Received: from [10.212.129.33] (kliang2-mobl1.ccr.corp.intel.com [10.212.129.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id CEB6958088B; Thu, 1 Jun 2023 06:52:07 -0700 (PDT) Message-ID: <7b23aee2-9fec-e07c-4ca1-076a061c558b@linux.intel.com> Date: Thu, 1 Jun 2023 09:52:06 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 1/4] perf pmu: Correct perf_pmu__auto_merge_stats affecting hybrid To: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Rob Herring , Ravi Bangoria , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Richter References: <20230601082954.754318-1-irogers@google.com> <20230601082954.754318-2-irogers@google.com> Content-Language: en-US From: "Liang, Kan" In-Reply-To: <20230601082954.754318-2-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2023-06-01 4:29 a.m., Ian Rogers wrote: > Flip the return value correcting a bug. The bug is that perf fails to create a normal core event on each hybrid PMU even if the event is available on all hybrid PMUs. Without the patch, # ./perf_old stat -e inst_retired.any -a sleep 1 Performance counter stats for 'system wide': 21,760,495 cpu_core/inst_retired.any/ 1.004010591 seconds time elapsed With the patch, # ./perf stat -e inst_retired.any -a sleep 1 Performance counter stats for 'system wide': 19,874,833 cpu_core/inst_retired.any/ 3,102,256 cpu_atom/inst_retired.any/ 1.004081307 seconds time elapsed I think we need to fold the above to the description. Thanks, Kan > > Fixes: 6b9da2607030 ("perf pmu: Remove is_pmu_hybrid") > Reported-by: Kan Liang > Signed-off-by: Ian Rogers > --- > tools/perf/util/pmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index 0520aa9fe991..36e163f38368 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -1424,7 +1424,7 @@ bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu) > > bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu) > { > - return pmu->is_core && perf_pmus__num_core_pmus() > 1; > + return pmu->is_core && perf_pmus__num_core_pmus() == 1; > } > > bool perf_pmu__have_event(const struct perf_pmu *pmu, const char *name)