Message ID | 20240228175617.4049201-8-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-85482-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3510779dyb; Wed, 28 Feb 2024 09:58:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrSnc5kB74ySj21G1lEXV5BGUtSWAbAQBgnfownfFd1NhyvzESNLaEOrWAEjPkJDfQs4sXCDo/SzZ4FUUWpJW2AyGUoQ== X-Google-Smtp-Source: AGHT+IFzdPjGGvvfw01wfgV03NPEfCN6vajd0gsLTd40eyqfqPeXpoR67x7ifnRwnQeR+f8FPDR4 X-Received: by 2002:a05:6871:5316:b0:21f:828:7a7c with SMTP id hx22-20020a056871531600b0021f08287a7cmr505821oac.6.1709143108630; Wed, 28 Feb 2024 09:58:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709143108; cv=pass; d=google.com; s=arc-20160816; b=F6tFwxbz6vKrYDJnWRfZlUFr1/PMNzGPANY2c37aQblzudoyugYiiygWdDEU6GA31y CJJwM4wOXn3px6B44g+evyJ5z7K9sah6sSqteOJTu9CMGbng7sQwc42MFzodnHnV4Ik7 YKVPSfpavOo1isFMAje3ou+JvDONoip1C1hrTypLWeMEm/MAY5aQY+x8Fa8rRqwvt7l0 v+g8GDnDD8f+Ci6h2JlQBA8A4r8uwyjYjmyhAQNG4z4YNHwPdVm3RNPdremK4dvzbiYA 9raXTaSVl981JbBBEU9DL617e0faUik6HTtm/RoLhXnaqxHFBxNIt39eFqa0nEZuRuzG FPDA== 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=Dr8pGAPnm6Hh2FHAABPwd7yyauYEbKCnKNWRhMVNf9o=; fh=dK+KhfUZzVtQkGU9PL8UxJJnckfw3nPcSE5njgzV/Dc=; b=QArQ5pNZvhY3bFDlwcEPlScKz5kwQ41xnzu1aqKxVLqUOFVupCiJ/w2HslJc2UwiXR WuuybT12GmY8JAezDMmJbG4T/w3bUsM9kMkk1L3n4BtptHAvq3bDI8kaHGXZNgjV6yzF GlmkWbm4sSXLD6x+nWbX417ni5Zs2sD24LVW0UdH5J51zOlaUGzwoUA6btk4V9s8hYOM 5GmCYVuuf5gj3Q7og+ZQWux77KOr2v2Z5NY8MRWnz50xVwwlPMRuNuK2Z3eTfbZAvQvo wxP7bGKX2LnaqyV5rDh44F2KHJhHbmE39r9nVM3L5rZwY5IiMQMSx2lr9iGNRfREsBZZ GFlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qpcmE+ak; 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-85482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85482-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q26-20020a05620a039a00b00787f71c0307si7780qkm.738.2024.02.28.09.58.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:58:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85482-ouuuleilei=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=@google.com header.s=20230601 header.b=qpcmE+ak; 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-85482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85482-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 66A281C22742 for <ouuuleilei@gmail.com>; Wed, 28 Feb 2024 17:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B62FA71EBA; Wed, 28 Feb 2024 17:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qpcmE+ak" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 856A54086D for <linux-kernel@vger.kernel.org>; Wed, 28 Feb 2024 17:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709143015; cv=none; b=gjpvvJLwoUSniP4ty4kjWJWvI22B+DaOdsuZGISjq8dChlD3y0bAVzNharoVbhlwx+ScVvzwYxCdcx5jLqXBw1B9xoBY8aWI7RKOAfqFKllbvnSJFEE0RIVc8b04HCwF31dFojNBuMDsu6NgjGR07R4jTMR7pc8MI37czkUT/c8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709143015; c=relaxed/simple; bh=VDOIZB9jv6XKeIi5ciBHo1jjSFStukj9iwmjW2zydxI=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=YipT75Ij1S/8eP2UXf/S03JPe3JCATsPJZ4LZrOMSMRlx1amcVcen9RWLLQsXGqyYGLE8KzCCWO0O7q8yXpgjVrEOqBUxy91760E9RgILWQxIpShrca+klb7+ZM95tmK/w95hHWlOQqpsHNpbNKOWKmVllHGWCCtP1488khXBns= 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=qpcmE+ak; arc=none smtp.client-ip=209.85.128.201 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-f201.google.com with SMTP id 00721157ae682-6094c745eb7so226967b3.2 for <linux-kernel@vger.kernel.org>; Wed, 28 Feb 2024 09:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709143013; x=1709747813; 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=Dr8pGAPnm6Hh2FHAABPwd7yyauYEbKCnKNWRhMVNf9o=; b=qpcmE+ak8GjFEcjjdFkETjUC44tRTp1X5zI7spij8h5ZqwGauVrdz39torUqmyakhb kY7c3u1JI5O+uRPz6EwHqvaEYDaQjgymxmFRHZibiFPRo5PFpK6sat+uPOFfKfocYRrB Pqgdse6NZc4AkhFwHW4eM5E8xTZsAVJYFOxoSndpQ+PLVRzEp94Y/n5784mdCviLkfDO nLcEwjP8TvIjx6sCc57WejRH93dQ/5WuCP45QsqAsOc/oklBg6W+WWBS0lDvtdfpaHaz ilBkC8iOQtvvXUBESENQoI30bqghCEal08tkdUIRUuJBsgtJHHpMRLcRupnqqWCMAXrX RRaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709143013; x=1709747813; 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=Dr8pGAPnm6Hh2FHAABPwd7yyauYEbKCnKNWRhMVNf9o=; b=EDS1MLGbuPkwI7T7CiFCFuGLVMDob99+DNJXGdjds58USonf5BpSk87kKPoK8WAPGo AMSZh7iVsncJF+ypjILdjjWs/J/eYteY1f6Hl354qh9maDBZ9bXrDtbPsmKjotsZEz6A ek5nIn4Tk4qJi74gPwpQ3PQ1goxhzsSrbremweUGZG+UqbkjSnNkk024IZ/Ioc+rU3yF FymOcTxA8QgSTnKds+rcFbOzVixIoBogMf/p0b5VIX8EZI5wL4QBQ5GBlo5nfDSwAW+O 1LJwvRgOIWc0XTttam64GUf3cABCdcTTGTtmjdKpbLGpfwNyNEg2E2MDaELHyLJ9g8yU Bveg== X-Forwarded-Encrypted: i=1; AJvYcCX1GUtVydK9g5acQ9voKyk0cyvx+FFxud3VB9tCrn1Wx0EX6ZeWexPw5DYcQ+naRBi6wIY/WhppcJW5Lrqw8AP2D2TX1/whkr2m4GX0 X-Gm-Message-State: AOJu0YyOscNxj2a7Loh+wlp74fhDURHkTu42LDA2VNQI8x/0itx8mQDz hWwv+0sKiX2j6yhmED4vcDcGoyjVuUlDLzjb0bstvFRSciJkN9xQtkKq8O1AUpvuDvk+X2eE1zl 2+zfFLA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:77dc:144c:334e:e2dd]) (user=irogers job=sendgmr) by 2002:a0d:cc57:0:b0:609:3c40:e31c with SMTP id o84-20020a0dcc57000000b006093c40e31cmr379602ywd.6.1709143012824; Wed, 28 Feb 2024 09:56:52 -0800 (PST) Date: Wed, 28 Feb 2024 09:56:12 -0800 In-Reply-To: <20240228175617.4049201-1-irogers@google.com> Message-Id: <20240228175617.4049201-8-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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 07/12] perf jevents: Add threshold expressions to Metric From: Ian Rogers <irogers@google.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, John Garry <john.g.garry@oracle.com>, Kan Liang <kan.liang@linux.intel.com>, Jing Zhang <renyu.zj@linux.alibaba.com>, Thomas Richter <tmricht@linux.ibm.com>, James Clark <james.clark@arm.com>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Andi Kleen <ak@linux.intel.com>, Kajol Jain <kjain@linux.ibm.com>, Sandipan Das <sandipan.das@amd.com>, Ravi Bangoria <ravi.bangoria@amd.com>, Perry Taylor <perry.taylor@intel.com>, Samantha Alt <samantha.alt@intel.com>, Caleb Biggers <caleb.biggers@intel.com>, Weilin Wang <weilin.wang@intel.com>, Edward Baker <edward.baker@intel.com>, Stephane Eranian <eranian@google.com> Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792166444192847319 X-GMAIL-MSGID: 1792166444192847319 |
Series |
[v1,01/12] perf jevents: Allow multiple metricgroups.json files
|
|
Commit Message
Ian Rogers
Feb. 28, 2024, 5:56 p.m. UTC
Allow threshold expressions for metrics to be generated.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/pmu-events/metric.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index 0f4e67e5cfea..88022b7f08f4 100644 --- a/tools/perf/pmu-events/metric.py +++ b/tools/perf/pmu-events/metric.py @@ -436,7 +436,8 @@ class Metric: description: str, expr: Expression, scale_unit: str, - constraint: MetricConstraint = MetricConstraint.GROUPED_EVENTS): + constraint: MetricConstraint = MetricConstraint.GROUPED_EVENTS, + threshold: Optional[Expression] = None): self.name = name self.description = description self.expr = expr.Simplify() @@ -447,6 +448,7 @@ class Metric: else: self.scale_unit = f'1{scale_unit}' self.constraint = constraint + self.threshold = threshold self.groups = set() def __lt__(self, other): @@ -473,6 +475,8 @@ class Metric: } if self.constraint != MetricConstraint.GROUPED_EVENTS: result['MetricConstraint'] = self.constraint.name + if self.threshold: + result['MetricThreshold'] = self.threshold.ToPerfJson() return result