Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3321314rwa; Tue, 23 Aug 2022 02:47:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR7aKGTNsyIuKAHDvRVgGLWKY7mbzTDd9JLY+H2CG5CVxZ7RNg4hYjPfNwCcAo1nE1vJOTXx X-Received: by 2002:a17:907:7b94:b0:731:1b11:c241 with SMTP id ne20-20020a1709077b9400b007311b11c241mr16274890ejc.676.1661248062088; Tue, 23 Aug 2022 02:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248062; cv=none; d=google.com; s=arc-20160816; b=ohRTJgQYSmv1jJa4OLq/LAZ2Q+G/eNF6UqUKlsW9FUTdaNPJn7WJac1r+Hh7F1PQLk JmUlEX9rJe2bMKcY2zzobP89/vNrXFL1CdG30cdJqkgbPmahtGBoelx1ZErUF+aaZToa ciVafCgAKiiGbhKtpZ8ukZ+paLSQHOdp0nK61tTXwyeWPSfjloUxAy4qXtuFo87lNuHf E8WEapKIu2yraxX6JZO7q7ZIaErmYOlXnDxd1iyYzu90wDalqne9ZB/xd2We5hTHCb+b 8EEfXz6GBGEHGweAbfiyEro0m4RMfSHTCV0N3vskHUfvjxlFA8aiykvfRCXLAG2g1lYH FyUQ== 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=5Idb91e3ILDiBr/VCp3ANUMlPtvsdPB89DkB0Qhvvmo=; b=sqO0G6uz36dstfsTXhLZF8Ho/e60PtDagYRDSxblLHCCzmhHbgTYTmyf2oqbf1grZJ oGyuZSdVBtzWyN4zUpMThAu9CCIAITT66QYVI/aJfqc8RxZOFnYLSOAOqGVl1eSKT3PV YzBjGdXOF2dABZZsWT+/ZvUgJnVeDHr0yJzoshcyOxvRC5DmM6jxhT4iynSSzANOW1JL CCxyUFFoRfJGSQ7hQOS/pUcTGcSvnCycoDq7o5TyK/3wlFhKUeYpT0gQgLz9zbjk79TF yz3NaH0qVewtK00F0e9ccuSvl5dscynxO6vRNosltNgTOyWiIGjBBVHmuH93sKQJQCV+ 4U2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VuQWzv5r; 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 hq42-20020a1709073f2a00b0073da56756b8si623176ejc.607.2022.08.23.02.47.14; Tue, 23 Aug 2022 02:47:42 -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=VuQWzv5r; 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 S1346272AbiHWIkX (ORCPT + 99 others); Tue, 23 Aug 2022 04:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345931AbiHWIjp (ORCPT ); Tue, 23 Aug 2022 04:39:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396921400C; Tue, 23 Aug 2022 01:18:31 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A9ECD61242; Tue, 23 Aug 2022 08:17:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2DDBC433D6; Tue, 23 Aug 2022 08:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242664; bh=/vddohBAtiuE49XccEW6KW7TVaa7sg2giPocq9caIVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VuQWzv5rMu99LLg4icHEnYTNtB6L+FVqlJ8lJTzMF/OScso4MR6+IF20Ko4Js9BjA yogGVxK+W4GnJFqVDOG44jGxWam19hJYSc+NFWTrg39tvTobeujNCuEChJhgeluY8/ U9jp09eurCKzdbu25+ouXWX0IAw7L+dtiN6vGKZA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Ian Rogers , Jin Yao , Jiri Olsa , Namhyung Kim , Arnaldo Carvalho de Melo Subject: [PATCH 5.19 158/365] perf tests: Fix Track with sched_switch test for hybrid case Date: Tue, 23 Aug 2022 10:00:59 +0200 Message-Id: <20220823080124.840728405@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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: Adrian Hunter commit 1da1d60774014137d776d0400fdf2f1779d8d4d5 upstream. If cpu_core PMU event fails to parse, try also cpu_atom PMU event when parsing cycles event. Fixes: 43eb05d066795bdf ("perf tests: Support 'Track with sched_switch' test for hybrid") Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220809080702.6921-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/tests/switch-tracking.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -324,6 +324,7 @@ out_free_nodes: static int test__switch_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused) { const char *sched_switch = "sched:sched_switch"; + const char *cycles = "cycles:u"; struct switch_tracking switch_tracking = { .tids = NULL, }; struct record_opts opts = { .mmap_pages = UINT_MAX, @@ -372,12 +373,19 @@ static int test__switch_tracking(struct cpu_clocks_evsel = evlist__last(evlist); /* Second event */ - if (perf_pmu__has_hybrid()) - err = parse_events(evlist, "cpu_core/cycles/u", NULL); - else - err = parse_events(evlist, "cycles:u", NULL); + if (perf_pmu__has_hybrid()) { + cycles = "cpu_core/cycles/u"; + err = parse_events(evlist, cycles, NULL); + if (err) { + cycles = "cpu_atom/cycles/u"; + pr_debug("Trying %s\n", cycles); + err = parse_events(evlist, cycles, NULL); + } + } else { + err = parse_events(evlist, cycles, NULL); + } if (err) { - pr_debug("Failed to parse event cycles:u\n"); + pr_debug("Failed to parse event %s\n", cycles); goto out_err; }