Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp128465pxf; Wed, 10 Mar 2021 23:12:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6oUYGIDqB8ZpyS0O80Lu9sVRhCM+LI59JxQwhgsNX2/e2jEuY53QbHM+6j0xSxJ5cGh2t X-Received: by 2002:a17:906:1712:: with SMTP id c18mr1690598eje.417.1615446756853; Wed, 10 Mar 2021 23:12:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615446756; cv=none; d=google.com; s=arc-20160816; b=yQBVfOzFi3tNG3gMQnXSiBTXEYkx13CnHZnrvXby7aLhXiQDnhMU3Tg8gL6Q1fgI4Q r35+taWhCcdF0ioLjc5UesrVLVcDskqamu8/xWPZyTxy1REOPgk35dAwpx1AF0BTh811 jLClvsX0vhoaLZ0LIznbQ7RWAcjKQOcdGJZA76ituzVRf0c+w7/oESj21VJXwtPM+yfP U3sq9zu85R1tfcJqx/FRnvB5TsldoQTE7OEVj07iHfqVTSdgUzMVBHFh7KVY36z0nv6M i+jwiBl+rfQTE5ErZHEl/zfP7X2Fe06yfTeED4LKsu3ARAOfpGwrA02/E3zim7+TeS+I 64SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=uCKVl4LD4WR5ut+zKwVk7cZcmGgsGfLCRx/nEfT0Ezk=; b=PAZU61rwdKOT0Ga3sOAHTi5zNl1H/k5KCavyyhc3Uw8cHIOZU6ejzrNiLgqI0ovSrZ kkIOC8wM4T6/uNl4t7NM3WR1t32N5pULwLSPKrJLSfKTP3pgRrCJKwde8IhOXPgCmQNL OwAoFVFd00I+sViEZNYNASIzNTrDlx1dIvFzUmvXbOL9ADn5T2slH6ZvfhHpOs3YqjF+ b+Aw3ZGU1Q2z6kYqWrFm/X6UODNFUs24eu6TctosQTp4bJPhrwWl+ViICMJlGlXFIPcg kbzKh+cczNLlFZXBXRNP5I/fgZBzHjHDttXnDFmdzvoF1w/h2CNwzEB7sBaxOwko5q/q ZPpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l25si1264193ejg.664.2021.03.10.23.12.14; Wed, 10 Mar 2021 23:12:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231964AbhCKHJk (ORCPT + 99 others); Thu, 11 Mar 2021 02:09:40 -0500 Received: from mga04.intel.com ([192.55.52.120]:22599 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbhCKHJN (ORCPT ); Thu, 11 Mar 2021 02:09:13 -0500 IronPort-SDR: cK3/AVJez5JLjpwJl8bMiR4pepkFvxbnTTv9E3EW1/vNS6gxGPbHv8tHlBa41WHDehOKSZQSxd QQ78D3OZzBZA== X-IronPort-AV: E=McAfee;i="6000,8403,9919"; a="186246113" X-IronPort-AV: E=Sophos;i="5.81,239,1610438400"; d="scan'208";a="186246113" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2021 23:09:13 -0800 IronPort-SDR: rVwHcjj8SMSBf/soIaJbMiDSM2mVLWlqgxEZZh26/il702Nvi0kRbYIRoF6y44KmpSrFKMvTNI KtHfAJLwahqg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,239,1610438400"; d="scan'208";a="509938016" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga001.fm.intel.com with ESMTP; 10 Mar 2021 23:09:10 -0800 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Jin Yao Subject: [PATCH v2 22/27] perf tests: Support 'Track with sched_switch' test for hybrid Date: Thu, 11 Mar 2021 15:07:37 +0800 Message-Id: <20210311070742.9318-23-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210311070742.9318-1-yao.jin@linux.intel.com> References: <20210311070742.9318-1-yao.jin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since for "cycles:u' on hybrid platform, it creates two "cycles". So the number of events in evlist is not expected in next test steps. Now we just use one event "cpu_core/cycles:u/" for hybrid. root@otcpl-adl-s-2:~# ./perf test 35 35: Track with sched_switch : Ok Signed-off-by: Jin Yao --- tools/perf/tests/switch-tracking.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 3ebaa758df77..13a11ce51a1a 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -340,6 +340,11 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ struct evsel *switch_evsel, *tracking_evsel; const char *comm; int err = -1; + bool hybrid = false; + + perf_pmu__scan(NULL); + if (perf_pmu__hybrid_exist()) + hybrid = true; threads = thread_map__new(-1, getpid(), UINT_MAX); if (!threads) { @@ -371,7 +376,10 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ cpu_clocks_evsel = evlist__last(evlist); /* Second event */ - err = parse_events(evlist, "cycles:u", NULL); + if (!hybrid) + err = parse_events(evlist, "cycles:u", NULL); + else + err = parse_events(evlist, "cpu_core/cycles:u/", NULL); if (err) { pr_debug("Failed to parse event cycles:u\n"); goto out_err; -- 2.17.1