Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp638035lqg; Fri, 1 Mar 2024 17:01:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7v2HyQL/Lix/2M5Q19gWaf0P1Ig0hjlSbg5laPNGZ1BimEtKLUKWZmCagFROtgSKNpnwRPjvZphDfL6b2m3pW/M8GOT5xiNh77Sduqw== X-Google-Smtp-Source: AGHT+IGwIKMk1yPkykcTe7YzDdWdAKCSpxU6TJLJb/gPCd2x5IIjYKHAazeGHMkZDZJ+g+GgWuWT X-Received: by 2002:a17:902:f683:b0:1db:f7f6:a73a with SMTP id l3-20020a170902f68300b001dbf7f6a73amr3679146plg.25.1709341267744; Fri, 01 Mar 2024 17:01:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709341267; cv=pass; d=google.com; s=arc-20160816; b=0xkL0lax3ILn9+D+Zrd6T6OtQheptK1/c8JfWQPkGCcuDo6OsmyXlwWaYIXOun6Qhl 8hISGRz349IrIHqi9oxHvXr4NxmZ/s6zg30LnFJkCMNavEQ5738z3tsjgiGtI90NA6ZT umfj1lqWnxDQ3nSTgbHxq91VfAL4xxQm09Q1b7hGveX1+ut2044vmCPfd1fyg2zSyTg3 uJOScaUCl+LI+/OPNWklILI2DHdUcVwkpjknEdsADakn8DUvLy8+/HwBP0M9iZyO+csZ PE78qxNHwvWI7KjWy+iPbPAzlZENi4+9ca+V+vaKw7pEJbygcR279W36bdKtilopA0of Hsdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=0l9FS4zSa3KVc8IImImj1SVx9SNoPylTIMS2zSJSapM=; fh=Pa5EZPoDmFhldCqaw0CToD6ur18etrTLFA8ewJaEYyg=; b=dFEmjwBtP3ITphL3eVm0VXc4T52AI4K6CvH0jISsLzb48HWBKVxGLil//48OchhZ3b wkL88fb27Pny0zFWJ3dP52GHJsJ9Z5QywqnH8lMUHPnj+bl2Inru42t7sgQ5AOgZbjZd 4PxaHmagy32pCnPxIWI4FzuBKyGNQ+Yl6Crwtd0XTSIF0ok3N1+Rls2jWemqj1isLBOR ZODa59sZ/Lpib8xXxdh2PznwT4s13t0krynVGqaIGI5VbWBas5jZpbuwDgEP3NROURdk +bnT8auYaaqoeLYEXphxRCwtoRAy6k1XbK0LkR5SsikLQv81LZVG5r26luVIB1T+24B1 6Etw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hSUiKKTZ; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-89278-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k15-20020a170902ba8f00b001db70a99e90si4292693pls.430.2024.03.01.17.01.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:01:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89278-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hSUiKKTZ; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-89278-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6CCB8286CE0 for ; Sat, 2 Mar 2024 01:01:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA32011C82; Sat, 2 Mar 2024 01:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hSUiKKTZ" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98EE310A23 for ; Sat, 2 Mar 2024 01:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709341210; cv=none; b=Raljo1ze8dpsAArjkwV5HAv+nVFfBPGx7E2x0UmeXm9skJa4bHnMCZ6qQOt+fN0ATaHJ+6Q3AvONhpeGAYgr+oM5k5jebSx1w+fbY9aUMi7AQ3r5NUA3jdXxzKks6PqgeEAedHCwllaNyrxuk8PxdDVl/FfbkVeMRmwTbXjYUPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709341210; c=relaxed/simple; bh=0IeSdmWuvcjIVBTAhF6kJkhdSlGmwLTCZHLsTn46VzI=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=sV+GLo1rRBcZM/AsGgJgGcC2WoqLrxUkzXmBJ3VpPJVDRf08IVuMKyjYOGtJPoNRcgGpRy6uD1h8ZHRPp835nBZDWVKaZCkWGnHoZDu1P/TxZ1sEJWOUVdSyZzYi+amKSO1ttBMG4+wlyXKIfYaqR2kqr4rOKdO8IUUp4mzqJZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hSUiKKTZ; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6b269686aso4064752276.1 for ; Fri, 01 Mar 2024 17:00:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709341207; x=1709946007; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=0l9FS4zSa3KVc8IImImj1SVx9SNoPylTIMS2zSJSapM=; b=hSUiKKTZMo51O4TPXi6JpFPqXDNBdygWk1alNNT5UMxotiYh9mVdfQhPB97foUdymr GdZNLnjq8z2Q8tLWlM1Q2vk4nhV9Rb4An47vFsQVVnbcb0uIkhakLLDsx0H3ojz422vr DhD/BoXxAMunHTqXPJ195BYsv/Ak3mbVzjC9Fni3/s5YkIQ4cGpGcgmfBEZPA8V4e4U7 AI1+2gjO9kx+wbxvdDL06vD7QZVdEh5ONgYkjkv9rb7UqVSbCibY+VAgEshDgSPjEkOM d59LTJDnFVa3jYvaFFZT0+jI9pgGNYAbKSzWfSIepmM8TYxUCURGsZt58QAveSQlo4kR o6+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709341207; x=1709946007; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0l9FS4zSa3KVc8IImImj1SVx9SNoPylTIMS2zSJSapM=; b=UaVxZ/+vvUVMMrfvruLTUTJZeSMXxrA+jYFWC3Huso/s9YoTaK2IAYSnXqJrn2L+En /11JXTfFCS61hT8Q1tC3KX3WOMXZACAb62o4HNvUFw0ZinckWK81kx1K3gxyHNG8/EL1 9GNiAQkHxYHTM3pHlXh0B+zQhVFwjEzQVEbEO2dgk/CxI7ID1wOFilvXfFdW1Mvn7KTx Ao1bsaaI7PdbfSiFKh7hTw7TZYjusxtiujyKzkLs5MgurzXsdkEMhO3tZhYOYH+O8DGN UV9YmLzMh3SbPaYQMgjlcNjOhCotwGhH3DUTRlyFkrec2sCYPHXhgRx0T7n3H3ZSk2Ye fG6g== X-Forwarded-Encrypted: i=1; AJvYcCV6LmaA6OIg4JNpVl/4r4PVDQYHmHjAcVyfbDFzN2dwstZPbSecXqORdlxL4L/J++P+XHQbgQ55G4stp7EuegR8uz19MqIwjURVsro+ X-Gm-Message-State: AOJu0Yz/+cpaQeiiv5O9QZ2Mt8UHh3iZaTQekJ9ozNsLQHlPDnzt/k2M Phq/oUp/b3pUl4WK2ZT1mvmo8sxTdxfnYX7tBSqWASM9yRMHIWl/HOfaDo7aQsPjS84u4LsYCYG YefBheA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:aba7:66c5:3365:7114]) (user=irogers job=sendgmr) by 2002:a05:6902:1142:b0:dce:5218:c89b with SMTP id p2-20020a056902114200b00dce5218c89bmr130999ybu.5.1709341207587; Fri, 01 Mar 2024 17:00:07 -0800 (PST) Date: Fri, 1 Mar 2024 16:59:42 -0800 In-Reply-To: <20240302005950.2847058-1-irogers@google.com> Message-Id: <20240302005950.2847058-5-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240302005950.2847058-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Subject: [PATCH v2 04/12] perf jevents: Allow metric groups not to be named From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , John Garry , Kan Liang , Jing Zhang , Thomas Richter , James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Andi Kleen , Kajol Jain , Sandipan Das , Ravi Bangoria , Perry Taylor , Samantha Alt , Caleb Biggers , Weilin Wang , Edward Baker , Stephane Eranian Content-Type: text/plain; charset="UTF-8" It can be convenient to have unnamed metric groups for the sake of organizing other metrics and metric groups. An unspecified name shouldn't contribute to the MetricGroup json value, so don't record it. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index 1de4fb72c75e..847b614d40d5 100644 --- a/tools/perf/pmu-events/metric.py +++ b/tools/perf/pmu-events/metric.py @@ -455,7 +455,8 @@ class Metric: def AddToMetricGroup(self, group): """Callback used when being added to a MetricGroup.""" - self.groups.add(group.name) + if group.name: + self.groups.add(group.name) def Flatten(self) -> Set['Metric']: """Return a leaf metric.""" -- 2.44.0.278.ge034bb2e1d-goog