Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp111464pxy; Wed, 21 Apr 2021 20:21:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiItY9ZUsLYnGLquifx6HMg1mjxUokCsdOZSj9wxuUzDH3usQgaRblHbSMX4wE+D45uH+U X-Received: by 2002:a63:c145:: with SMTP id p5mr1309167pgi.451.1619061682523; Wed, 21 Apr 2021 20:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619061682; cv=none; d=google.com; s=arc-20160816; b=Q6TyBP0jut7sz2kJzuZKr2tzsTN98vfltRRgARiK27FxnchrMsAYwTa7QSLRYQPRf4 dCdzZlyZTbDCHixAFHOqhLh1A3JwWTvSYDParrqZw/3pommCweuVUIxHzAA+LorTQsYL wgh2v1ZbS+CJxePUV7jIIcBYb/NjmKPzck4LlE7S0R84aT0hDm89nmhrAEk/IELi/hN0 jQWUAZ0EhkWqhq4Gus8YAfnDC5rQQOc1kRF+6Huz6wDzcHCdNzTG0IdtwlG/OI1XmnaG M+o+N3gHsyLQR5mbVUFHPJsfj1OuyHXTUhwiH/dZL2njN7/hXaTKWejYGYEDQn1l3VdN IPsQ== 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=HJc4pAf9msqd/K3VbblgEV3/2GmMlpVEu+uM4qsBDlI=; b=xCzBpGGw3q/O5CNRTSC9IQANcCg9jhgXK8CvJeVNoDnWIWow3nWREAPZ6vRV73S8MX q4r8GBYsB+swwh+XuWB0qHmt1R7L3JQJKPOiTCX6lRUYogRpGQB+QXC8uGYXKrgaWcpp SQnW/qupnu9ogJYTNKfeKjgIJ1j68dObHVu92h9Urv4u+6Ci8dyw5pml/7c1jPqHR/zI 1NgTgWvAHtIC2bxTNZP5wZSKOlZdKzzN5wGPhhQDoKExHFuC7zIxYczxRQzzZZforxb6 9bQsvVJbZpS7TcILcDEvSXEVWE0lYyC2XU0u4tb03hnNWITzXKRdl4MR/lJxEF4Ht4g4 qQsA== 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 k18si1651211pll.324.2021.04.21.20.21.10; Wed, 21 Apr 2021 20:21:22 -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 S232796AbhDVDVO (ORCPT + 99 others); Wed, 21 Apr 2021 23:21:14 -0400 Received: from mga14.intel.com ([192.55.52.115]:30679 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbhDVDVK (ORCPT ); Wed, 21 Apr 2021 23:21:10 -0400 IronPort-SDR: A5j7p4fHeEHSRVj16REpRZrI72gTkhctAcOsCqkILLjBCc/rZqUiz5P+fxUkRwZmQnK4JwvKhW /WK84pkjRU5Q== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="195374634" X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="195374634" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 20:20:36 -0700 IronPort-SDR: yVVoCITEhMtrYlRnDNznNapeCo1lLh06PpoVBcjBbMQs4Jez762KE/0UyjN5HYz4ehnNevA+2Z bhv09PTIbzkw== X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="427757313" 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:20:34 -0700 Subject: Re: [PATCH v4 22/25] perf tests: Support 'Parse and process metrics' 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-23-yao.jin@linux.intel.com> From: "Jin, Yao" Message-ID: Date: Thu, 22 Apr 2021 11:20:32 +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:29 AM, Jiri Olsa wrote: > On Fri, Apr 16, 2021 at 10:05:14PM +0800, Jin Yao wrote: >> Some events are not supported. Only pick up some cases for hybrid. >> >> # ./perf test 67 >> 67: Parse and process metrics : Ok >> >> Signed-off-by: Jin Yao >> --- >> tools/perf/tests/parse-metric.c | 10 ++++++++-- >> 1 file changed, 8 insertions(+), 2 deletions(-) >> >> diff --git a/tools/perf/tests/parse-metric.c b/tools/perf/tests/parse-metric.c >> index 4968c4106254..24e5ddff515e 100644 >> --- a/tools/perf/tests/parse-metric.c >> +++ b/tools/perf/tests/parse-metric.c >> @@ -11,6 +11,7 @@ >> #include "debug.h" >> #include "expr.h" >> #include "stat.h" >> +#include "pmu.h" >> >> static struct pmu_event pme_test[] = { >> { >> @@ -370,12 +371,17 @@ static int test_metric_group(void) >> >> int test__parse_metric(struct test *test __maybe_unused, int subtest __maybe_unused) >> { >> + perf_pmu__scan(NULL); > > perf_pmu__has_hybrid calls perf_pmu__scan no? > > jirka > Sorry, I don't need to call perf_pmu_scan here. +bool perf_pmu__has_hybrid(void) +{ + if (!hybrid_scanned) { + hybrid_scanned = true; + perf_pmu__scan(NULL); + } + + return !list_empty(&perf_pmu__hybrid_pmus); +} perf_pmu__has_hybrid calls perf_pmu__scan if it's not scanned yet. Thanks Jin Yao >> + >> TEST_ASSERT_VAL("IPC failed", test_ipc() == 0); >> TEST_ASSERT_VAL("frontend failed", test_frontend() == 0); >> - TEST_ASSERT_VAL("cache_miss_cycles failed", test_cache_miss_cycles() == 0); >> TEST_ASSERT_VAL("DCache_L2 failed", test_dcache_l2() == 0); >> TEST_ASSERT_VAL("recursion fail failed", test_recursion_fail() == 0); >> - TEST_ASSERT_VAL("test metric group", test_metric_group() == 0); >> TEST_ASSERT_VAL("Memory bandwidth", test_memory_bandwidth() == 0); >> + >> + if (!perf_pmu__has_hybrid()) { >> + TEST_ASSERT_VAL("cache_miss_cycles failed", test_cache_miss_cycles() == 0); >> + TEST_ASSERT_VAL("test metric group", test_metric_group() == 0); >> + } >> return 0; >> } >> -- >> 2.17.1 >> >