Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp6192pxv; Wed, 7 Jul 2021 18:45:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpHbj/F4hq1x0Zcl383uCR43jMMflFiXUXMuYOwsX7apR/gRb5lCNbp77P/riwfO/km4Im X-Received: by 2002:a17:906:f112:: with SMTP id gv18mr18161540ejb.387.1625708753086; Wed, 07 Jul 2021 18:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625708753; cv=none; d=google.com; s=arc-20160816; b=R82ryKBfKmtwHwQ23VmY/mvVBhh0ursH49ds9EAm03hQfP9WZIvhNrVtvVJcURc9UR zDD+qHKLOdbmYUueCDkxgtPZdy2v0HzDsf5Nzf/WAp3h3UkmNJkSQI3Eo+diKsley/AS 6wdrHZImEiFKQ4Mh0/SELiv842tIqW4jNRxC1bAl2T+yXI3g9NV2YB4Rj4gvnmuYl6MC Hyje/nDMZmJSlD46Z8jV5MsIsK1NNPGZBzgKMVnqDxKMlFMPp/W+LI/eu4EwO0PKMIoC zkPR2KN/+Q1tWvdk6g/Sgb1saRKVwGnUmeJKF52eEp+15N6qIOIipd3JjuqG8EYvAxtJ 1Stw== 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; bh=+2fgGPr+Gx7JctxPOls1QSWYOf+JSe4/sI248wNL5XU=; b=1GD+D45gWdnsc3LKssXS+2KE9gNGLt7beAIT6QtZN40dxWTnOZyU+DMUrOCCvo+nbx K05Zq6ICcsCGo08lPa3nsPlhhEpiPI+q1/F6Hpxn2btx8J+6N3izE3Cg2rrilpdoTuTg K3Ksgr3SYM21X8CmgTgN5fdqDzl3atpxmdBbYph+XOFtTrynnzFWPPoE5R6T/P+tRK2R /X9RvAzzpWA0tAwydpcKnW3svFNxS7CDy8TR9ZzkJF7Ypv8lMcQJfdSJ2yz/38xlaVcp pf94gNQzyFNDmLDMAHqBj+mQS8sOtrtL2QP4L8dt9a6yWIcbHqyNbcNnLScmBQ4iX8l1 FchQ== 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 p12si862059ejy.328.2021.07.07.18.45.27; Wed, 07 Jul 2021 18:45:53 -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 S230244AbhGHBlO (ORCPT + 99 others); Wed, 7 Jul 2021 21:41:14 -0400 Received: from mga06.intel.com ([134.134.136.31]:38895 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbhGHBlJ (ORCPT ); Wed, 7 Jul 2021 21:41:09 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10038"; a="270538748" X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="270538748" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 18:38:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="457708836" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by orsmga008.jf.intel.com with ESMTP; 07 Jul 2021 18:38:25 -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 v2 2/4] perf tests: Fix 'Parse event definition strings' on core-only system Date: Thu, 8 Jul 2021 09:36:59 +0800 Message-Id: <20210708013701.20347-3-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210708013701.20347-1-yao.jin@linux.intel.com> References: <20210708013701.20347-1-yao.jin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the atom CPUs are offlined, the 'cpu_atom' is not valid. We don't need the test case for 'cpu_atom'. Signed-off-by: Jin Yao --- tools/perf/tests/parse-events.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 0f113b2b36a3..3ca515fb141f 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -6,6 +6,7 @@ #include "tests.h" #include "debug.h" #include "pmu.h" +#include "pmu-hybrid.h" #include #include #include @@ -1596,6 +1597,13 @@ static int test__hybrid_raw1(struct evlist *evlist) { struct evsel *evsel = evlist__first(evlist); + if (!perf_pmu__hybrid_mounted("cpu_atom")) { + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); + TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); + return 0; + } + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); @@ -1620,13 +1628,9 @@ static int test__hybrid_cache_event(struct evlist *evlist) { struct evsel *evsel = evlist__first(evlist); - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0x2 == (evsel->core.attr.config & 0xffffffff)); - - evsel = evsel__next(evsel); - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); - TEST_ASSERT_VAL("wrong config", 0x10002 == (evsel->core.attr.config & 0xffffffff)); return 0; } @@ -2028,7 +2032,7 @@ static struct evlist_test test__hybrid_events[] = { .id = 7, }, { - .name = "cpu_core/LLC-loads/,cpu_atom/LLC-load-misses/", + .name = "cpu_core/LLC-loads/", .check = test__hybrid_cache_event, .id = 8, }, -- 2.17.1