From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C0BA53D9699; Fri, 16 Oct 2026 21:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792185691; cv=none; b=hSYvLWFPb6dbP66Zx41Lh9fVqz5LBGQmmz1F3Z0MoDxLqS19ktbUl2HoBribKsnV5WiyWRlYG3uIrlJ5wwmHGVhgnsv3jnhjdKgCIyqNFETZkNkh1C0cSAKiI6suTc4tWU1Qp5pbS3BpLkZF3G9PW0xMLFYwOxLBUMJgMPGVwOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792185691; c=relaxed/simple; bh=30A+mZvAX+X2EB/Nmf4O8qBc5lmLwSd8N/bZGzVhrIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EHRg9qUeRyUEVOYk8ZHmEKWp33lCxJ/odvjy3m8PbCJ5wF+V/j8hx0OkwY4Ny6GutAcnLJGdI2nbG5hlx0BcHneVHLtOWmNMqYaJn4t8WSYVWHQQ0ZSuSvKPWl6na1atiWTBBJ4Ceq7MPoQl9TfWzy4smemK/4lOJmGB6rJJgR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BK/55dav; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BK/55dav" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02E491F000C4; Fri, 16 Oct 2026 21:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792185689; bh=r/O/LS+JOnQTqJBY3m1juJWDC12ucJNtzXROp9rHI7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BK/55davwTU/W2kzenFsno0scSlw+DfEAN0atSKP0gpagpketpSlmO0UckIEGcRJM rglLQoRwTDbx6vvJKjk+H2Axj/SforqcAM7YyHwkmLrwicpFNmbXkcDOQ2Ei7zkdxz XVckHlctHjCGufvKzMmZGUJdaq2UUcWcT6os9qa4O5g2q29Kk+huG5LO5JW6rnfWNd mnYUnra/U8XqPIHUyrYkwkCRKBspZpq+Vy42F0LNAXBGe/NgOJ0nqF6phsXn77Yxvk vWVQoIynMHnop5xy4X0KYwibxLobQ1lM3/19VcKWX7Czn2D5WZZjs0SzMFAkZXaNfH q3oymQQOa4bEQ== From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , James Clark , Jiri Olsa , Ian Rogers , Adrian Hunter , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo Subject: [PATCH v4 06/21] perf test attr: Relax group checking for ungrouped expectations Date: Fri, 16 Oct 2026 18:20:47 -0300 Message-ID: <20261016212102.76550-7-acme@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261016212102.76550-1-acme@kernel.org> References: <20261016212102.76550-1-acme@kernel.org> 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: Arnaldo Carvalho de Melo When matching the recorded events back against the expectations, attr.py requires every event opened in a group to match an expectation that declares the same group. The perf stat default metrics open the events of each metric in groups, but the test expectations only verify the event attributes, so test-stat-default fails with: FAILED '.../test-stat-default' - group failure Only enforce the group of a recorded event when the expectation it matches declares one. Expectations that ask for a group are still verified in both directions. Fixes: c7adeb0974f18da4 ("perf jevents: Add set of common metrics based on default ones") Fixes: 2dfc0cab3da4a205 ("perf stat: Add detail -d,-dd,-ddd metrics") Assisted-by: LLM Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/shell/lib/attr.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/shell/lib/attr.py b/tools/perf/tests/shell/lib/attr.py index 2d7dd26a5737777c..087bfa4532b69c58 100644 --- a/tools/perf/tests/shell/lib/attr.py +++ b/tools/perf/tests/shell/lib/attr.py @@ -372,7 +372,7 @@ class Test(object): else: raise Unsup(self) - def compare(self, expect, result): + def compare(self, expect, result, strict_groups=True): match = {} log.debug(" compare") @@ -406,8 +406,9 @@ class Test(object): match[exp_name] = exp_list - # For each defined group in the expected events - # check we match the same group in the result. + # Check that each expected group is matched in the result; an event + # opened in a group may match an expectation that doesn't declare + # one, as those only verify the event attributes. for exp_name, exp_event in expect.items(): group = exp_event.group @@ -416,6 +417,8 @@ class Test(object): for res_name in match[exp_name]: res_group = result[res_name].group + if res_group == '' and not strict_groups: + continue if res_group not in match[group]: raise Fail(self, 'group failure') @@ -454,7 +457,7 @@ class Test(object): # do the expectation - results matching - both ways self.compare(self.expect, self.result) - self.compare(self.result, self.expect) + self.compare(self.result, self.expect, strict_groups=False) finally: # cleanup -- 2.55.0