Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3252653rwb; Mon, 15 Aug 2022 22:22:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR681I1aEkJ8pepUbIowyD3zmYhFtmusjIYsz6gmSxkZRHdorab8s+XIcAew4e2tx+TVJq3v X-Received: by 2002:a17:90b:4f49:b0:1f5:c7c:b565 with SMTP id pj9-20020a17090b4f4900b001f50c7cb565mr32688699pjb.32.1660627336176; Mon, 15 Aug 2022 22:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627336; cv=none; d=google.com; s=arc-20160816; b=jbAhFDeIshPbZv70FvzkrU7qvWNj+vXABavQ+NJo/UJqMBi9fRF9nYprrZ2UmmQucU yvjzYXvKAcu5tklPnYNZUz2HtlmYm2m0XLwQZtroj3wnpjfQBKZ37k5oAHaZp6amtXo7 Cd/qwxNPuo6yskzXIfdsHCJmlG0t5xyHnvhHihwz4cwg28yPwVfuIwUnrXrLlfTG5SzA WWLPb1xudvWIpt/qblr8z1HYYnvXMX41Fm5xroSjzls+3R4K54yQ7hFHdh26zg/mbwv0 SHOuS1b1vKgCvJdHFwv9ySpDU22GLmbJJDHS2GyHwTqe7RVAenKSbLMEOlFKyl+wI5FO QcYA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V6ofmzR67BkX4HXBM4tb1OKiACnHtwpusb8zh4xxi3U=; b=0GNpAXqdqi9pluDEo+QTdZPVD/JCFz3K/aYM1g8nIq7w03vFSyX6mvPsCTl+6Ohxvm ksZp/fIL3RJvTaJ1ZX7AIqgLRjzylrnXvlDbZ1tNFnUtII6+7zXDSihUBSCeBYjyNN8l QWc3GJAMHZiW1jU3ly8xNdctxjCuLhFYQXhBYIlrk5bkByTd6frSTb6glj5/ZikxdPo+ 73Mie8y2UE3vG9vefl3ETPdMjpjujw8/cHnGUPYxnuf/rjmcv30UZs2fWsbgGglTVi7l XPJzDf3eUW9OvXUHEqT/rwNqymEtX2iJJt9hbDB8U4RhKBEtoU5jP1cw76NqHliWzfNc ccjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FbjBukhu; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt19-20020a056a00439300b0052f75073e5bsi11792550pfb.7.2022.08.15.22.22.05; Mon, 15 Aug 2022 22:22:16 -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=@linuxfoundation.org header.s=korg header.b=FbjBukhu; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233146AbiHPEum (ORCPT + 99 others); Tue, 16 Aug 2022 00:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233263AbiHPEqi (ORCPT ); Tue, 16 Aug 2022 00:46:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF934B249B; Mon, 15 Aug 2022 13:43:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E2A7DB81197; Mon, 15 Aug 2022 20:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03638C433C1; Mon, 15 Aug 2022 20:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596207; bh=zqRJVTqnhVnCcS8AAZW3JKoLlu8MDd4u9JRcij25GfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FbjBukhuAnusNpHiF6Eg9v1CLdK5NzXxRmai34uuFCkjwkKZ6hRA2qaGFnDeXY4i+ FJq452Dv2z8zkEjGS7gOxCJvkCbCt+5rjTbw6HLToyAyX0WvaWgTKGe5/4kD8RhIvh hchm/GlfdzD1rhqD/MplwFaRIMl7aA7+eWaWAnv4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kan Liang , Ian Rogers , Namhyung Kim , Alexander Shishkin , Andi Kleen , Ingo Molnar , Jiri Olsa , Peter Zijlstra , Xing Zhengjun , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.19 1005/1157] perf stat: Revert "perf stat: Add default hybrid events" Date: Mon, 15 Aug 2022 20:06:01 +0200 Message-Id: <20220815180520.003520098@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Kan Liang [ Upstream commit ace3e31e653e79cae9b047e85f567e6b44c98532 ] This reverts commit Fixes: ac2dc29edd21f9ec ("perf stat: Add default hybrid events") Between this patch and the reverted patch, the commit 6c1912898ed21bef ("perf parse-events: Rename parse_events_error functions") and the commit 07eafd4e053a41d7 ("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 Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220721065706.2886112-2-zhengjun.xing@linux.intel.com Signed-off-by: Xing Zhengjun Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- 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 d2ecd4d29624..86f838c5661e 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.35.1