Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp129409pxf; Wed, 10 Mar 2021 23:14:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnOPQn26By+JIz5+YzeBfWeZGON/6iNzgGM5AW00N0Hy3wHZxAFM2/4q3YYY0NpJD9tu6a X-Received: by 2002:a17:906:7150:: with SMTP id z16mr1667162ejj.103.1615446870537; Wed, 10 Mar 2021 23:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615446870; cv=none; d=google.com; s=arc-20160816; b=lqsHDqTIs7UgKD99EfDZ1k2CzfrK1+HHNTVmivYCgzATjDyxHEX6NQHB6PHTWFF0ES gPWnP2czWT1V7WYaS/vx+WOotNYXHp3EECNISqfiaaA/lx5Ldhri4vhXsDLBVOH7hVNc 7/EAzCCQZ1ousVS4ewb1rhLhGc6x4JtzS0WUfIxBzlkj0i5ceT48dZ7rbOQNBzGL5FX8 ggOKVS5nhoOS/ffd/NNbmjSiY38dV2YPZQ5CS3c4U2epPOBOrl50pZHwmkd7T2I1PEWn HxnH/WpRq9n7eJFiNQQiztVkglUsByPSWWz69NAkAmrU7dUPcrlTVwrnCZFzmfDU7k/W 9PfA== 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=Wz9CrV/kwDyRPUOOzDr257WNG6fY/Exp/0u2NiQ4QH0=; b=luxsfdRQKbL3VhpC/OtAZptLTxzsqWKZidNkusj4eBYzKQvwDyALF7fWv4iepHWTZn 24UZtD5RWyp3+eO919oL74bpHJ4QkLajE8jt/9GppIox9+V70DhztR1iAl5Rz4p8/j5C BJfb/BlMhrnlKQWZuUH9okk6ISkWpUtgZb7Dm9BCG6kQVTkEXjDO3wRm+zS2BsUrhObr F0emkcG0Tu24cR8G9Nd3MlGFGxQDQsonezTCPwZju9+frkK4yVihui+Z+EXvDhFPG5WZ 22TEg28XM3nSQuOLoM2ISlNdOm7bwf+32Wo2SJxrOBYvvyS85xSxfNXFTGOu8wiVpH34 Z9DQ== 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 t12si1259133edc.228.2021.03.10.23.14.07; Wed, 10 Mar 2021 23:14:30 -0800 (PST) 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 S232017AbhCKHJn (ORCPT + 99 others); Thu, 11 Mar 2021 02:09:43 -0500 Received: from mga04.intel.com ([192.55.52.120]:22599 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231623AbhCKHJS (ORCPT ); Thu, 11 Mar 2021 02:09:18 -0500 IronPort-SDR: L7+Q7Y0zSjrwNFpj5HBOolp0ccvO9/L6FqnH7Lt6tazIBcv2mQwMFzzdkApUyQqTTK/0trPnoc KwoOmGjm9snQ== X-IronPort-AV: E=McAfee;i="6000,8403,9919"; a="186246124" X-IronPort-AV: E=Sophos;i="5.81,239,1610438400"; d="scan'208";a="186246124" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2021 23:09:17 -0800 IronPort-SDR: ZWK/Dq2in1eswEAc5H2weDhwrrV/iHeAk8Y/mMZh1z8NRL6E7zL4EZWY1BzSE700M3R6yMVOlY fS211KI5u8Fw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,239,1610438400"; d="scan'208";a="509938028" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga001.fm.intel.com with ESMTP; 10 Mar 2021 23:09:15 -0800 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 24/27] perf tests: Support 'Session topology' test for hybrid Date: Thu, 11 Mar 2021 15:07:39 +0800 Message-Id: <20210311070742.9318-25-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210311070742.9318-1-yao.jin@linux.intel.com> References: <20210311070742.9318-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. root@otcpl-adl-s-2:~# ./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 74748ed75b2c..0f6e73baab2d 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -40,7 +40,15 @@ 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(); + perf_pmu__scan(NULL); + if (!perf_pmu__hybrid_exist()) { + 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