Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp599109lqp; Wed, 22 May 2024 13:43:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYMhDY+Ti2gVBGNdn/el5fp6v2CJSwr6WfsBqUIVX6Q46FEztvLEdYr6uabjzp7+xosOs4gkz0EFLqD26RHnlpgbBpnFCfKvSLIkEdJg== X-Google-Smtp-Source: AGHT+IEiwMg5WKbIqbPkJG9gljHon8RDbcpESEjGobg5tjdJ6xSx9+fLSr85Apj59u4zlg2sNkbe X-Received: by 2002:aca:1c17:0:b0:3c9:94cc:6cd1 with SMTP id 5614622812f47-3cdbb526f52mr3047121b6e.53.1716410594007; Wed, 22 May 2024 13:43:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716410593; cv=pass; d=google.com; s=arc-20160816; b=Ryu3xz3xInkdejp7arF77Ww+NlEEUdQxc+fLRW48Ldf+A16YyrDEkAXYTSf5MuUmhZ ++CEQPJ+WCWEr/W5L48LExXZ7f0PWDsrStddVrgf/d6IW5+Ywa3xu8gu/4mFmPrglNhN rJUmxKREJaWPlQdghMrmilUOfFhrArUqKwgiKD70VbO8nxu30ANj3q96nuDZTnF1+87b sYpcGHXF49FtMFsrYDwDLaqaBTVD0pB1MdU795CpscLgIXqVu+EnWSo7n9cDyqe1j8hx 6dys3lLGAfC2KtfNcrixYGyyTYEsqapiZY00gBdTCDhFUUu4QpGpulksf/ZtTESWc6di +DnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ORy3noFmvt+sDmP25yU/YY10Uz5hgK3e5b6Z+y4dL6g=; fh=2mx6v3byCNS4RNMabLmfY6Bz0Xn6VvJsmk1bF8Vd49Q=; b=ixrb314bzKzhiwKNEer1yEosNEWA+Sk/U0pKZ4+cyATClW0xSIvduEVygwfl9oPplX 4ylGLdaFApUssUPZSj+r2emgnZ4N/8n6ST0RJObMMC4k2PPBxCOwJY0qnF8+sUmn3t9b 4RDckc8nkVLpy2rkrbVrwIy6oVanz+zq8C/M1mLFV1A5uUshKr3/l5M9aaHryMCBG/aa o0qNcnfnyj5ph7DPcop7E/NP1M634/pzIhPN6xFAAs1rKezC2RPqL4HnvR/EqC46ljY/ IZ3rfT8istFfFt4KjsZRyosoEd6vgj+X2/5j+yF0lxS61b3VQrq8OWieP2uGADGTZVgG pZQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y7YoX9Sq; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-186698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186698-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf33b563si26981985a.477.2024.05.22.13.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 13:43:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y7YoX9Sq; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-186698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186698-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B53C51C20D7D for ; Wed, 22 May 2024 20:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4278A7E575; Wed, 22 May 2024 20:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Y7YoX9Sq" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55AF041A80; Wed, 22 May 2024 20:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716410588; cv=none; b=aD7+7FsBEoD7ptS9LpO4npxx0+Gau49T7IpfjxqPksMNSfFvC+h/CX0stsJXVKBcENTu2/oVBjbTh/8xscmrWOSS4NPIQjKwAazwBX1d/mykfmBXgqdNZFSUm4ituYx9XupVNnsc0tsBmNw3q0LEaWOFqUJtxiDtlww6cQYI2rI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716410588; c=relaxed/simple; bh=vSToaAWtI+UPNyxsJqewuE9SnVckwS20wFWAi6Bsrn0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ubvDmpXamTSuJmEEqP6sRpGAidHJ05Rw6Xrj+cxrjhr4Yc0zx5mIpMoh18tGkcHwzjJ5XyDmzxabxzTR4oCjdoqg8AlPxXwZn3IPLlTjZ10FPBrCPleLVFsaHES2dL+YGMWFdzbLAUFSsmKgLeV8S4+8DqVBFTdPeC3uBdPxv7E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Y7YoX9Sq; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716410587; x=1747946587; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vSToaAWtI+UPNyxsJqewuE9SnVckwS20wFWAi6Bsrn0=; b=Y7YoX9SquuxnEzTJIE4kph/tNWsfNO54gwOfTzLJN4r63YbADxcIMne/ rCVv1bJvf0nPr8RY0W+k/MFm7ZMZrftTe4IJuER7pzlQ1LPRKiQApJo1B TVVAfBefsxY3Fb/BEthFthcPDFcmxQaYUWRqxsDqecaCG6pyKVr4oQPlw 7pgXBdMfZVk6gsmhieK2KjJ7y6ldI8/0Y6XTFsaFHIUFK+YrRBi7pZR6A ROD8R26UNL7OVKl0RlAQMJiUxxoWYpQGnzgthMOStlbNf9QKB4+WdDmoz BwJzzymlJWTD9DLC+Su5pCh+av9JbFsWKgiLY6/l6zmgBMPu2pvsVvaT8 Q==; X-CSE-ConnectionGUID: QtVu16vtTHu1gJX0LtrQww== X-CSE-MsgGUID: CLG+wj07QMK8N1py2bWDHg== X-IronPort-AV: E=McAfee;i="6600,9927,11080"; a="23827657" X-IronPort-AV: E=Sophos;i="6.08,181,1712646000"; d="scan'208";a="23827657" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 13:43:06 -0700 X-CSE-ConnectionGUID: xFsTQ040Qf2GV9etUehbUg== X-CSE-MsgGUID: NtZGR2rcSoOELGV7oq9UDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,181,1712646000"; d="scan'208";a="64648569" Received: from b49691a74b80.jf.intel.com ([10.165.54.183]) by fmviesa001.fm.intel.com with ESMTP; 22 May 2024 13:43:05 -0700 From: weilin.wang@intel.com To: weilin.wang@intel.com, Ian Rogers , Kan Liang , Namhyung Kim , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Subject: [PATCH v1 1/1] perf test: make metric validation test return early when there is no metric supported on the test system Date: Wed, 22 May 2024 13:42:54 -0700 Message-ID: <20240522204254.1841420-1-weilin.wang@intel.com> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Weilin Wang Add a check to return the metric validation test early when perf list metric does not output any metric. This would happen when NO_JEVENTS=1 is set or in a system that there is no metric supported. Signed-off-by: Weilin Wang --- tools/perf/tests/shell/lib/perf_metric_validation.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/shell/lib/perf_metric_validation.py b/tools/perf/tests/shell/lib/perf_metric_validation.py index a2d235252183..0b94216c9c46 100644 --- a/tools/perf/tests/shell/lib/perf_metric_validation.py +++ b/tools/perf/tests/shell/lib/perf_metric_validation.py @@ -95,7 +95,7 @@ class Validator: indent=4) def get_results(self, idx: int = 0): - return self.results[idx] + return self.results.get(idx) def get_bounds(self, lb, ub, error, alias={}, ridx: int = 0) -> list: """ @@ -173,7 +173,10 @@ class Validator: pcnt = 0 tcnt = 0 rerun = list() - for name, val in self.get_results().items(): + results = self.get_results() + if not results: + return + for name, val in results.items(): if val < 0: negmetric[name] = val rerun.append(name) @@ -532,6 +535,9 @@ class Validator: ''' if not self.collectlist: self.parse_perf_metrics() + if not self.metrics: + print("No metric found for testing") + return 0 self.create_rules() for i in range(0, len(self.workloads)): self.wlidx = i -- 2.42.0