Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp359912pxb; Fri, 16 Apr 2021 07:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqzFdT5XEPlLX8elkmHRqEPWo3J894H0/lKJmrwJ+fs8tAja1zYu/T63GlAA3j0bH0NkaQ X-Received: by 2002:a17:906:11ce:: with SMTP id o14mr8471946eja.113.1618583268973; Fri, 16 Apr 2021 07:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618583268; cv=none; d=google.com; s=arc-20160816; b=FOrJbRILda+K/2K7Fy4geV58zYxBXPg3s9Gs/7VTfhb/aaEKv8eZGDjUpfCdt3mPGH XSs4zYnKYr79eoGgMDvepuT0Ok1+4hiRtsduHXIdKsgjeA7IAWs2RFPBsX0qUh0PMHUL Fr4Lj7zOXf2SeXQFUjIm0cemhoS/qtxxrScqQOe0Gf/KaQ8oTbj0yXRAElosnz/esCfy Xa6k6oAAz4Vvi14fDI/wzOKbUG7NED3YDlkiVM7ZCpCYeF6wW/Px31FqI0tjYa0vrrca KK/UCRZSC14RdsGSIw4ecyWsqI/aL+eMPU1wyUGllhODLwW1BfORc0yDdQrPsGIvnTr9 eBoA== 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=2rj+zHmSiEbpLnaF/p/dqBolC+/RuCQhhTo5J1pdDac=; b=rVZwNksRqHO3AX7l5S58UgRGe4PAUa4XJjx8Vh1AR/paaCc5ZdCajRDMSxSeotL2KG i91KEKewPu6nnZR8GfRXweyklpJjE5jEGSlI68KMHiUQz7yTqiBhqQAKjCbKddqBfGA9 vv8e0+88Kv0FpGownA/PqPGcgXllj2nfO/QdsSgKMah2mgMNYFPGbzCbUdsoV5IAOqHW uyTQ8LCu2fewkNPnnWw+hR+Km8gU9p20sdWTkLI0wwysPXzTbaEBxBDVK6/pZO/YWEic q6n9QyvhDZldJMktCBQEy0D1wOsc5E9Yfn+yleWJxza359QNhkTsqgR3XUMuv3rG14V2 3tBQ== 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 g18si4763244ejt.696.2021.04.16.07.27.25; Fri, 16 Apr 2021 07:27:48 -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 S243710AbhDPOJo (ORCPT + 99 others); Fri, 16 Apr 2021 10:09:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:23086 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236380AbhDPOJB (ORCPT ); Fri, 16 Apr 2021 10:09:01 -0400 IronPort-SDR: 9bFlRo1Hxr9eKws2vXYQe7cn+XTxyaVz0HHjuFmG0/7IqJuR1DQKfx7QNcMUlNz0Oh4GUo4o7T Me59VcsNc45w== X-IronPort-AV: E=McAfee;i="6200,9189,9956"; a="191854434" X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="191854434" 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:29 -0700 IronPort-SDR: ved0cnxq/YNsDtJStPEsAUjYm53kn7fGGGp03pp/dRIu0EH9l/xB5AerIGqS9q1h3CPyKeZmu/ Gd7i3FwJ/AbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="612766978" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga006.fm.intel.com with ESMTP; 16 Apr 2021 07:07:26 -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 23/25] perf tests: Support 'Session topology' test for hybrid Date: Fri, 16 Apr 2021 22:05:15 +0800 Message-Id: <20210416140517.18206-24-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 Force to create one event "cpu_core/cycles/" by default, otherwise in evlist__valid_sample_type, the checking of 'if (evlist->core.nr_entries == 1)' would be failed. # ./perf test 41 41: Session topology : Ok Signed-off-by: Jin Yao --- tools/perf/tests/topology.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 050489807a47..30b4acb08d35 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -8,6 +8,7 @@ #include "session.h" #include "evlist.h" #include "debug.h" +#include "pmu.h" #include #define TEMPL "/tmp/perf-test-XXXXXX" @@ -40,7 +41,14 @@ static int session_write_header(char *path) session = perf_session__new(&data, false, NULL); TEST_ASSERT_VAL("can't get session", !IS_ERR(session)); - session->evlist = evlist__new_default(); + if (!perf_pmu__has_hybrid()) { + session->evlist = evlist__new_default(); + } else { + struct parse_events_error err; + + session->evlist = evlist__new(); + parse_events(session->evlist, "cpu_core/cycles/", &err); + } TEST_ASSERT_VAL("can't get evlist", session->evlist); perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); -- 2.17.1