From patchwork Sat Mar 2 00:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 209157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp248042dyc; Fri, 1 Mar 2024 17:01:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQHcwZFXMpFWu2kAhsrSpTOqaHkYDPOWtxMqDGZ0inyp6wyWJjv5nOS32b5LR7rrWi73pOvhGaP/P5GzlyVUF2WcoyHA== X-Google-Smtp-Source: AGHT+IFGkexL3QPjURghYWvlGKqyDRQ2/jDK3UVAbHW3WSsvQZdDWhv8DaM0bpjJwdvINGdYzkZf X-Received: by 2002:a05:6214:1786:b0:690:521b:df12 with SMTP id ct6-20020a056214178600b00690521bdf12mr3588512qvb.8.1709341278439; Fri, 01 Mar 2024 17:01:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709341278; cv=pass; d=google.com; s=arc-20160816; b=jLqTwKklSIcfDx6bLbM+5CDFFBeiFS+Zx2zhbSYVKTRB/sNMg2wk7n/tmNzo4DNUKF 979HDvzN+oemIz72DV8yxFCRXSYSyvumlCkgPQcjULzAUDFNLrqkyANJljFrIlP73Gn0 g/Z5gbLRVxzvr6L+9Z97lR2b0wnpase+1CNs1zJ2xzeU0e7XjgPr2qjFJ84A6mA5YkAp q84itPMuEGi04IkRjGlufJNPo+D+XdOeERXHsiA+mzbLckA/NAw4XeJo8V3aW/5i8AvK KoVjDURQfx+7MzE/q8OQglvFYvmbxH6AhOorJuAzYEKlkXVE9mlUvYSTsK8SpNqlOdYP kQUw== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89278-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id eo13-20020ad4594d000000b0069017323b96si4741349qvb.208.2024.03.01.17.01.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:01:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89278-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89278-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3D3511C2160C for ; Sat, 2 Mar 2024 01:01:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B375312B80; Sat, 2 Mar 2024 01:00:12 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792374240287543463 X-GMAIL-MSGID: 1792374240287543463 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."""