Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp513027iol; Thu, 9 Jun 2022 08:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0W72e+7DHOfkDLhtmxhv502IyM9fecLzKd1EBRPNde5qJ+9G0shrOMXZl2ghj8r+q5LsE X-Received: by 2002:a05:6402:4410:b0:427:ab6f:a39a with SMTP id y16-20020a056402441000b00427ab6fa39amr45872006eda.120.1654787438334; Thu, 09 Jun 2022 08:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654787438; cv=none; d=google.com; s=arc-20160816; b=Mm7fHxvPMm4jjQekulsXpeLpeNl/pxWM/ssb+4IyVeiH5Uk98zp5Hf9OqshzBQHd4Y bZRhpSVbbZ0uV9kLerkqVhSE/eQlcxPS+qrD8L3wS+lhOJCNkY07Cvfp7u53VaVLS0Fe eqhs8vc1Q1igcF26XhaPSYzV+YLfgFBMCYhLqCdSHglbZzTC/eyepcM9+mnkw8FwrElA BnFwNWELPjD+IQ5c5llYsX5jSg6s9M9KEVCms2jFqvGIoGHBmMsZouqVTwHLi54vAwpX DRtt1DXpyR6eY5Wfb3FPus95dlLiPe6Q/J8yaB6ZfvRr73X+4raiSYh/rNKjVr71IYeR jWBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uibqFt2SxUiOpwzGZcWj2jNu4EJxqi10Iy636of5HPQ=; b=E6oTYDgcWNT4l6xlU0XNPGEMy5je5qEeFnNSGda0I1EKBqIVgTH4XAocNEah2Meueo x9eY8rTiUtt74dcZhw1kvGT5s/udUXkI521Ufv65dbV67MbPLapQq4Sut20u/zURgUl8 Ye44bNLb7BrrgDabsddWTbH7XgcEhkbFpZaabvMi45mS1rC3e57Woj+4kwlWfVsqkAsw Vl35LX2moQSPGQUpkKzOQQAqowCYi5ICcdvCRXqZysuidlgb3vp+ftz/b/BFm9CuRopC LQhOTZJ04DHdo/c9oQ+ZlWCxbu92yd85zDb+95XcqCUNMFK85Iqradc5JWfcL9qWANl2 70PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Er44pyHw; 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 mp42-20020a1709071b2a00b007036d734745si5614799ejc.63.2022.06.09.08.10.11; Thu, 09 Jun 2022 08:10:38 -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=Er44pyHw; 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 S243906AbiFIOw6 (ORCPT + 99 others); Thu, 9 Jun 2022 10:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243552AbiFIOwv (ORCPT ); Thu, 9 Jun 2022 10:52:51 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46BB1DB1E2; Thu, 9 Jun 2022 07:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654786369; x=1686322369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PhS3zD/EOK7DCRRrEKVkJqq9D19wwalFl1hpBBbQQZg=; b=Er44pyHwbJhVe7tj9KaURwnFSkbympG99mxTmwSH4Gw3/RslnEAR468U IXvUMxUTybt7ipz8KChKIt90Ib/m0hjHxv2cIsOMfJqALevyr6i5QxBFe gMTgSIxHE2s/pyvei3vrI8w/wRRK5C7PH8qcHmbH+NapZVq/cjAk0ubv/ jGYRQ/7B8pkOMzljudGgW/hzlfBCCpP6Xeog4scgHvjy0aGmAdp35aHb+ jvNBmBSOTb6UoNawo5surXto+Mhmo9ZZG628tc3RSx3ZYBbMRHGue2r1u A29fo3pkcUhqFaprskm9qvjgG2vAw52US+wQVWn5dwxsptvWT2fWuYi9F Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="257736230" X-IronPort-AV: E=Sophos;i="5.91,287,1647327600"; d="scan'208";a="257736230" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 07:52:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,287,1647327600"; d="scan'208";a="827633512" Received: from zxingrtx.sh.intel.com ([10.239.159.110]) by fmsmga006.fm.intel.com with ESMTP; 09 Jun 2022 07:52:45 -0700 From: zhengjun.xing@linux.intel.com To: acme@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@intel.com, jolsa@redhat.com Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, irogers@google.com, adrian.hunter@intel.com, ak@linux.intel.com, kan.liang@linux.intel.com, zhengjun.xing@linux.intel.com Subject: [PATCH v2 1/5] perf stat: Revert "perf stat: Add default hybrid events" Date: Thu, 9 Jun 2022 22:53:10 +0800 Message-Id: <20220609145314.2064632-2-zhengjun.xing@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609145314.2064632-1-zhengjun.xing@linux.intel.com> References: <20220609145314.2064632-1-zhengjun.xing@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: Kan Liang This reverts commit ac2dc29edd21 ("perf stat: Add default hybrid events"). Between this patch and the reverted patch, the commit 6c1912898ed2 ("perf parse-events: Rename parse_events_error functions") and the commit 07eafd4e053a ("perf parse-event: Add init and exit to parse_event_error") clean up the parse_events_error_*() codes. The related change is also reverted. The reverted patch is hard to be extended to support new default events, e.g., Topdown events, and the existing "--detailed" option on a hybrid platform. A new solution will be proposed in the following patch to enable the perf stat default on a hybrid platform. Signed-off-by: Kan Liang Signed-off-by: Zhengjun Xing --- Change log: v2: * no change since v1. tools/perf/builtin-stat.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 4ce87a8eb7d7..6ac79d95f3b5 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1685,12 +1685,6 @@ static int add_default_attributes(void) { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES }, -}; - struct perf_event_attr default_sw_attrs[] = { - { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK }, - { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES }, - { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS }, - { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS }, }; /* @@ -1947,30 +1941,6 @@ static int add_default_attributes(void) } if (!evsel_list->core.nr_entries) { - if (perf_pmu__has_hybrid()) { - struct parse_events_error errinfo; - const char *hybrid_str = "cycles,instructions,branches,branch-misses"; - - if (target__has_cpu(&target)) - default_sw_attrs[0].config = PERF_COUNT_SW_CPU_CLOCK; - - if (evlist__add_default_attrs(evsel_list, - default_sw_attrs) < 0) { - return -1; - } - - parse_events_error__init(&errinfo); - err = parse_events(evsel_list, hybrid_str, &errinfo); - if (err) { - fprintf(stderr, - "Cannot set up hybrid events %s: %d\n", - hybrid_str, err); - parse_events_error__print(&errinfo, hybrid_str); - } - parse_events_error__exit(&errinfo); - return err ? -1 : 0; - } - if (target__has_cpu(&target)) default_attrs0[0].config = PERF_COUNT_SW_CPU_CLOCK; -- 2.25.1