Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp109509pxy; Wed, 21 Apr 2021 20:16:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxggosfP62SNubpDPMXsFL1sf2QnJzQOPofmI8/4C/pJFweJZyULr/jmZW7OmGOtSOvfvzJ X-Received: by 2002:a17:907:1b1e:: with SMTP id mp30mr1002477ejc.532.1619061411506; Wed, 21 Apr 2021 20:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619061411; cv=none; d=google.com; s=arc-20160816; b=CMgDl/S/xo50Do4+dLfEgQf37LJuxHuWqayMIi6bvKs/RC80/lmiXbH68vGVKjensM +brHBtzJcPUJi5H9J3A0PpeDZZji6mVOaJxuK0NukTU2kNeFES9R/hjHjtO54MvfdBX3 XAb8ILSb+r7uvGNr3+pZMVnMpmObo8+OMcdQw58mmzrLULIZ813wbeDcOJIaNDFI6+v6 KsDovm3MIggt3IG4wCvdXy8glMamqzROfJu+Yf0CKqbXEIeIlurJwQT8MVImtIn6XJim i1nOEwdpcSW4STeoOsdjX3F7rM3qEGMkoz/7Wh9IS1NIgYH4/eUoKBOTeo0a6i0J5A/Q hVOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=ES29/gt0yLJ89ljSInLuUB5wGchfdYsuboOLnpKub20=; b=ujsDzzYs8Tu4Q0sLubgVDB5NyQvbby9Y7lI69YaAr9BDMF9Z5S/44FILw9yIwnBFcj 19UPhrSq4h/I42ryXdRSxY+5pVgJRV08cdEvo/K+4X70DRb79PM4PuPiro8gtsqNq+7j 0D/6bigDj6rW06mkUqe+KVwaHgz1SxZIljwxsIl0MDtE0+oOfltRCKH+BXFDPoMm+ska ZkyPcZQ1IEtQyUgz3z8J1i8hFA0x13+KxxkHsDcMMjf5oSYckhqK054WwfmGR6F8JbBX 0UqlVpjbbaktuGObHgtsGfbzCe2/C1UYlsHFsXpsNtfb6jFfvugwIllmiNWP/urYrgeC Yotw== 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 hj9si999794ejb.190.2021.04.21.20.16.22; Wed, 21 Apr 2021 20:16:51 -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 S233061AbhDVDPb (ORCPT + 99 others); Wed, 21 Apr 2021 23:15:31 -0400 Received: from mga12.intel.com ([192.55.52.136]:54538 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbhDVDPa (ORCPT ); Wed, 21 Apr 2021 23:15:30 -0400 IronPort-SDR: zxNHQBXmcrHT7F84/VJgNaRSE2Q9o9n/gyuLIpzXaB82mOqhHl/YbY6IEfvVDEAM/KXlYurM6d tqyz3Sho5d1g== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="175304633" X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="175304633" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 20:14:56 -0700 IronPort-SDR: bDOvQcQ80TiwH++t2tfBI9FIOnRx5Zy68NDD/duyIyZ6IqKnrEMEtUgdKAG0WGL4sjKRLpNi9B S0eriEEYyIog== X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="427756217" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.4.6]) ([10.238.4.6]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 20:14:53 -0700 Subject: Re: [PATCH v4 21/25] perf tests: Support 'Track with sched_switch' test for hybrid To: Jiri Olsa Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <20210416140517.18206-1-yao.jin@linux.intel.com> <20210416140517.18206-22-yao.jin@linux.intel.com> From: "Jin, Yao" Message-ID: <42749f8d-50ed-aa91-2dc0-31cb0cc146ee@linux.intel.com> Date: Thu, 22 Apr 2021 11:14:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On 4/22/2021 2:28 AM, Jiri Olsa wrote: > On Fri, Apr 16, 2021 at 10:05:13PM +0800, Jin Yao wrote: >> 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) > > why the variable? some leftover? could be directly > 'if (perf_pmu__has_hybrid())' no? > Yes, using 'if (perf_pmu__has_hybrid())' is the better style. Thanks Jin Yao > thanks, > jirka > >> + 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 >> >