Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp446237lqg; Fri, 1 Mar 2024 09:50:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFJ/NcIsnqVebKhgnSU5UThqKVYCqTHIaAqDA1zloVxACACtN14z0T4p/iRaJZxWxatBGLp281BiolaDB64aLrCOzCQ1onpT7tvyQHeA== X-Google-Smtp-Source: AGHT+IGynnNSdq8fQ4uLBNgaXY5vlwClu++Tr3m3PwnGq6JXL1G/DnB7tmekWIpYIM1LWrbdsqdg X-Received: by 2002:a17:906:f989:b0:a43:bf12:e8a0 with SMTP id li9-20020a170906f98900b00a43bf12e8a0mr1811890ejb.15.1709315409422; Fri, 01 Mar 2024 09:50:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709315409; cv=pass; d=google.com; s=arc-20160816; b=hgEeiNCjZZNzYqWV5ZF4m+KHx+QM+qmzZxPQA8uirb8srANRRVCpceNuPvpgLRif6f mD18aeb1f4ks7hLhcpr0vAppS2FkOx1YTx/sowd1dI/wMu3tnRhHA+thvptJZeTKWhkt Ced7etjlIAY0pRHOjFvsW6rHis5C10XY+WRSTQcwXhrGvWHPoGvu4vnkyIwZxbNpxXMk xKXEVd48r4t6hqvQJJDbPj1zCM2PrSbzUGdPg+QPNn/Pnr17fX3D3utfSR9UV9izbiVv x2GNPOhXacl+jqDQt7pWKbQL4ziSMTvyShpuJ9lCjCG0/sNDsjUOvElTDG4SHIAGLbWS KV7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FZedr8QD6xfrmqPv3GlOXEiDAC8wYuc4NhVJktCOziU=; fh=Kl8AKtbEbUbPt232piqkqGAOdCxfwncSqeNEStJfT0A=; b=lBEhOwRuvrU0mSYv5WHHhJkv9bYEJWtnr9Nc1vBpmbg5es2zMqaRYMfkS+87WnZ6IG YxgU422XmnlI3WWjArrsN7SOcM/40YdVPKpPjrxEiY1z82LMiNdqz7DH2ZEkLDOeXX79 6vMR8SQ7NkslrFbKT6BC6xQH3CBd0kk2BMvUsA4lf+w3ZesEZokHySr0oCcH8LMBZojR Z49FeCyJrWXc/DFNPVHCsjT1P+GzfxyoolA1bsk+9YED/CliQs5MUeGd03lD2AaWf3X4 HX3lg2CkIugQIR3Z68kW3AJJ2CaAu7/UU0RG8aUFWN252Mfd88EctqjFQj849CsJfLA/ aDvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tgpy2GH4; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88865-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bp12-20020a17090726cc00b00a43fe0538ecsi1729529ejc.516.2024.03.01.09.50.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:50:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88865-linux.lists.archive=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=@intel.com header.s=Intel header.b=Tgpy2GH4; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88865-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 122591F26103 for ; Fri, 1 Mar 2024 17:50:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEB9711CA1; Fri, 1 Mar 2024 17:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Tgpy2GH4" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 62E2410A26; Fri, 1 Mar 2024 17:49:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709315398; cv=none; b=fZM364JTisRU5nfsiMIFZvULWJrSqYv630Nwy2VWzW0cjLwOcdXKLmUNb/3yGi0+d0nvzbZ8RlqHlWpRrHRzPm5yQJUp4r3FGTHk1BLqWfkdi603jH6vh/jcw8gDY1qngS9zyNo6GHF3cCmr1ZdK5lYJ2bVefBo5FdVuajEnwkg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709315398; c=relaxed/simple; bh=8/Y/XDxLandSPlCC4m1v59y5UXjkcBey2CL+Iq3VD04=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YD5RnDAuuTGwEYjKWryCZC3qO+7V9xHSl0MDfbUgPXFYmN0dSQEQxmdWylSI4vomrwYVDHqJaz/cEbYfVGEtU7XE+y5yMPxgE1cn97Du+O+2w1UsnFds24lp06g3rObB6i/DlI1i9y1wnCuJTaD0LaFVzbXDyomKWm34mwMgcHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Tgpy2GH4; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709315397; x=1740851397; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=8/Y/XDxLandSPlCC4m1v59y5UXjkcBey2CL+Iq3VD04=; b=Tgpy2GH4/7e8PoT6ITtbPp3SpA7E8Q2pn7kjE4R8jrOry/pI4EuDI54t cL2wE6dPiYHE+Z5eIsDGCkppD3pUtI4tDGIK5dMX4DMgZ7sx5JoPVOMpk WhRZTEiwkwaHN1UVrdM7kw1OI+v4/ujE35m1aVl03sq3c5eEUDRgF8PC7 kOKXVN/iYZf/8BzRCQZibJXVk6JRjgVvY5vXzACBn6HoupL7Q+rIqXhOx wh/NZhn/+9K9x4mdQbpa77k3kmXbOc7inXOvczxSge96vr6T5HxIDsGkI C5B/raOrvjKh8hb2WcAfYVXTuWlKDIIiX18AyuraStR3WIVLcIQoPyTo5 A==; X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="3989035" X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="3989035" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 09:49:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="12855371" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 09:49:56 -0800 Date: Fri, 1 Mar 2024 09:49:54 -0800 From: Andi Kleen To: Ian Rogers Cc: Perry Taylor , Samantha Alt , Caleb Biggers , Weilin Wang , Edward Baker , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , John Garry , Kan Liang , Jing Zhang , Thomas Richter , James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian Subject: Re: [PATCH v1 02/20] perf jevents: Add idle metric for Intel models Message-ID: References: <20240229001806.4158429-1-irogers@google.com> <20240229001806.4158429-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240229001806.4158429-3-irogers@google.com> > +def Idle() -> Metric: > + cyc = Event("msr/mperf/") > + tsc = Event("msr/tsc/") > + low = max(tsc - cyc, 0) > + return Metric( > + "idle", > + "Percentage of total wallclock cycles where CPUs are in low power state (C1 or deeper sleep state)", > + d_ratio(low, tsc), "100%") TBH I fail to see the advantage over the JSON. That's much more verbose and we don't expect to have really complex metrics anyways. And then we have a gigantic patch kit for what gain? The motivation was the lack of comments in JSON? We could just add some to the parser (e.g. with /* */ ). And we could allow an JSON array for the expression to get multiple lines. -Andi