Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp359019pxb; Fri, 16 Apr 2021 07:26:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAMUFULQU+Vv71pmAo02QuUZtNvNokZCc/eqb+oXwtK9LZfd+5/xRejzvVea52G/SA+3Q6 X-Received: by 2002:a05:6402:34c4:: with SMTP id w4mr10570009edc.367.1618583187535; Fri, 16 Apr 2021 07:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618583187; cv=none; d=google.com; s=arc-20160816; b=WwVtR3zl93sQbIn8rSGSi/Jp33/oizmRGc0QT3qh2xGcYNnXr82WjYj9lRSIrU/vtc /VW8o9l9rPPTcdl2rfGE3DAvM13aEBKooypXftyDWhYtdg8pez0PPhCUWIsWUOQDArYQ cL1OvvpPx1ur3dFfHFXZmMJ0akeXgWqZxWa06XM6KYZZY89vKPYDLud9DmxoqZuWIqOp wTb34XPLXlRGD0YAfAQg0Jxpi97gL17OU+tY6nCZXZadVVzhb2GJwt2X68GcuIDWcnUB TAxourUT23+60Dd4c5/PH3jOKK35zIVcna8ri14RxxuwL7XM11sA1T5xtaWKOXuTAAbE T2OQ== 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=Zn6wb+Gzb1IxdvFOmWwukph00VwX9mgEE4ymMBvDsq4=; b=GR9S7ZoyjqjamFwoFsc1YQn3/SnYa8ExmJNr3cAPmYFqUaayaykTvhr4AJJUNnvd2D OnxmQyuva4X9rBJnquW1Ye77nhMQXQpOSnuEMIWsnM1K7oNNniKcVsmRI8sfHo9fOYFr tYdKj8L/xW3H4F8T2WioH8aykG7u+JEtKQyGM6cnzbq/XgGdofM6YPBCH/yvD6IC91QP zsfbgne1czl4U2rYdSi+yGFk831MidI5IxoNXSh6+3zXbNVTNk/LhgRT4sI5HuwmjU1w FGXuucw8qgFY8XL38eF//SiN8FXs+fjQ1EHlEv1gi5S43PkUUf5+sHlHMYZowuG+y7zw vyjg== 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 w13si4673703ejv.399.2021.04.16.07.26.03; Fri, 16 Apr 2021 07:26:27 -0700 (PDT) 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 S244375AbhDPOJL (ORCPT + 99 others); Fri, 16 Apr 2021 10:09:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:23099 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241981AbhDPOIH (ORCPT ); Fri, 16 Apr 2021 10:08:07 -0400 IronPort-SDR: 9bi+ZV6Rn5aWaZp3r5TDgHYH/qY+uS2yE1E09Eo9RyiJRJG8WnwLFJ6jDJBgoQLPbxozCTsLny Tar7DcxOKSfQ== X-IronPort-AV: E=McAfee;i="6200,9189,9956"; a="191854411" X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="191854411" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2021 07:07:22 -0700 IronPort-SDR: tJRshybsdz8G9E9jotllid3kQIWeDI7FMxR8aStIeMZnoN6fXN3ioj9Ip/Ay6D/RbwZNBx8FJG khBYMiD+46jw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="612766932" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga006.fm.intel.com with ESMTP; 16 Apr 2021 07:07:19 -0700 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 v4 21/25] perf tests: Support 'Track with sched_switch' test for hybrid Date: Fri, 16 Apr 2021 22:05:13 +0800 Message-Id: <20210416140517.18206-22-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210416140517.18206-1-yao.jin@linux.intel.com> References: <20210416140517.18206-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. # ./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..3a12176f8c46 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -18,6 +18,7 @@ #include "record.h" #include "tests.h" #include "util/mmap.h" +#include "pmu.h" static int spin_sleep(void) { @@ -340,6 +341,10 @@ 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; + + if (perf_pmu__has_hybrid()) + 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