From patchwork Wed Feb 28 17:56:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 207942 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3510460dyb; Wed, 28 Feb 2024 09:57:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQr04nfPmGCkLJ9CgjB/kpPvzjqxzLOtDCzeRX/ric6n5iATZoR9KZw6Ybfb2jCMhieJZLckL+/XuoexeFdVIew3NaJw== X-Google-Smtp-Source: AGHT+IFncTgtD8vpHTz0M5QaHKlZxB6H5WXDFflkVkz+dCj3D6IBcd3kbqCxhv0FEzQkqbBqIapz X-Received: by 2002:a17:906:4ed7:b0:a43:fb63:a072 with SMTP id i23-20020a1709064ed700b00a43fb63a072mr82051ejv.9.1709143070432; Wed, 28 Feb 2024 09:57:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709143070; cv=pass; d=google.com; s=arc-20160816; b=msPOcgpPv8cBvo1t+PT693hjThuZXSKl5lygXuuHO/VZfdtEbr0rnDxPK2vAgCN8l4 8Q6ouxWuy7O8kjWDXM4uUSJeTI4Toj21Ciiad5EJ5ocJwfsYjtk9vJ1fp4qGFHjsmIA1 8o1Ds4R64FWqDwmceqCN2pkt9BvtXKDv2xHM7EwxEjjt1ycuH4FiqJxJoFhr1vGIgXn9 2I/g2P4O8HS358Fe8v18IH/GmEB61vocYXy/08q8/pbU2k8W3u/fiR4BkfqBszlupLRl 1zITbTkAfyD3B1OdA9KsTSFRL84dsbCojBsffUCcPJEruWzjhy/7Xu6jR/gcy56MxJs5 WaQw== 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=N8RBTgsotTVydp8jE0D/yVui4Z9aVs+9/BJBOrb7o94=; b=RSwk546Scx8frGEScgyIz1HKjXjT44S4Yh0EZHSnjs5u9yEgiTas7zi91QRLg/nFHj tYUTs22SAPDUqdGuxUVskzpmHlhPJWEWJlyT7J0LYtWoSiTS8Yyrk3UaS6KSqnQwgAor rhEqo+JUArFhMafbN2Ex7oVHJCTx91cVWOVSE61VpMpnowDbftza78b6QVS9XVo0wI4C UBv92U3Mb3mc4e31F5P6FNd8Lx1jX3wgMsvz3dgu3sgs8JXP2sy16IwtfMAiAq2MHXYP 9i+rzgopjejtIDIuWcnLu5bI7eKYjZrM3jO4Kq/T8Uz5/7wZ8U9tH02dIwMDfjtny6LR 0aiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kcIKqnPO; 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-85479-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85479-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ji16-20020a170907981000b00a4425f8658bsi162331ejc.735.2024.02.28.09.57.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:57:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85479-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kcIKqnPO; 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-85479-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85479-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 13B1C1F2429E for ; Wed, 28 Feb 2024 17:57:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8275240846; Wed, 28 Feb 2024 17:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kcIKqnPO" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.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 5385F161B5E for ; Wed, 28 Feb 2024 17:56:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709143007; cv=none; b=j+KOaNE1zK1HgYAZXrpmNUSMj9fN0VhxY4LZOnrxPurJ1FCfnJYmz2WSdtH9o6W1fTLsGguhljiaNL7hczSDvF8OQBageq9H+ohgj51YN5wVhwRpGlD4EhYzOxaKu6uefHXAP2b07UUHLCsmoeHt/X63At0LWXpxX0fOgcpllfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709143007; c=relaxed/simple; bh=0IeSdmWuvcjIVBTAhF6kJkhdSlGmwLTCZHLsTn46VzI=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=uO1n0GKTrtTamyL3pvsB2fSCXb6+QGUtvTKP/z0JagA+tANQCbeaefD68tMVQ4YMbc6Bk3Z3W6qi39RoWsrTx8yv1s2W+uba/L7s1Lqr7+wrQDTR2CUSzRwbkQngEi/ViIBL0tfOUXyDZKUY68jqiNvwrwe/E+2o272WIorlfxo= 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=kcIKqnPO; arc=none smtp.client-ip=209.85.128.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-yw1-f202.google.com with SMTP id 00721157ae682-608ad239f8fso461487b3.0 for ; Wed, 28 Feb 2024 09:56:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709143005; x=1709747805; 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=kcIKqnPOKw9EJqisLSIhEUzgsmkv672BDsQe3FsP7iPJkgPtUuKr3zSuzI22hMErze ol43m/rT+lVrP3Z38szF6HI1bwWgQ6qYlLqA+EH3Y8WGHwfXf3vbSZjsTDyBdynBJAO1 LkUJTQkGM2IcYc3vBusGr+lRhe2RlPWjz0NEhdehywATWRf4cMIJ01sG2y0c3OyDF+cP skf7RvD7RYv8tTNRSVqmUYzJIS8ww54wBKCtXCI5hLXODdYeY65qZjH9AT6It8g0flhJ dl2gXlssCjT269TaGmPB06M+3oV8b0ypyYhw3kgOLZ94Ezf9WozFsrFMIBoU/ZFuAdcj /kew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709143005; x=1709747805; 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=vpC8ezQUg9t7sRloF9dCGghG0+6OsNbJUJWtdkPPwE1qs0OZm0eNPzVT/aH7JEIeRk up1r+7kg5TcoVwrEbRUGcALQt5UjhJ6Uu+nsa4lmukVc2zgtxx3JaxO3ZBDCsSwT0b0u IWLAlDN2mRzYU+dZ3F2pP3IfE9oIDy/3RfvDkGVd4cZYqTRJYVD/noZqmMC6sOF8P3X4 bPyEmSwVLu6U1IG+Ky2oXzyh/p4mbhRkqRyu0KnutA+9hwGMTOO8f3yRt7XAA+clnoiN FGKE3FEWGTpXZ7IZoxS9bIbWXUSrg1T6mtpuZCNuDBfRDMRCOZPrfQ0IMhuYgOFs3ABT z0nQ== X-Forwarded-Encrypted: i=1; AJvYcCVtLpk3hFDeLJLKv9KOs7w4aoJJzgr30+myyYaukRME1p+CUrfgY+NckRCwFN9jaeowM64bWEOhaZ/nXm7n2u+ThjexKVn1R7suMUof X-Gm-Message-State: AOJu0YycmeI9OOoXBrH3wnoHM1CKUmiinZAT4YxDiNQoG/bKqBKddsKM o/9cOvkdWaRH3E/25Oc6EoeI3yMtEV4fAFWYVPxGWrdvIFCedt5Jz1EHPi0nTk+V01XKKNS+Wr4 SaZ/xdA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:77dc:144c:334e:e2dd]) (user=irogers job=sendgmr) by 2002:a0d:cb10:0:b0:609:3c14:b700 with SMTP id n16-20020a0dcb10000000b006093c14b700mr601418ywd.5.1709143005547; Wed, 28 Feb 2024 09:56:45 -0800 (PST) Date: Wed, 28 Feb 2024 09:56:09 -0800 In-Reply-To: <20240228175617.4049201-1-irogers@google.com> Message-Id: <20240228175617.4049201-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: <20240228175617.4049201-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Subject: [PATCH v1 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: 1792166404453353236 X-GMAIL-MSGID: 1792166404453353236 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."""