Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2410717ioo; Sat, 28 May 2022 12:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8KjUUB8FlP7JJQUyoACKlUKWKZQjofvOB3Z2aEZFRa6zr3VXWz7UdN2B6RsYDvD1NgF+k X-Received: by 2002:a17:902:ea06:b0:163:584c:8ec with SMTP id s6-20020a170902ea0600b00163584c08ecmr18870832plg.103.1653767106817; Sat, 28 May 2022 12:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653767106; cv=none; d=google.com; s=arc-20160816; b=YQEAa5Gy669rt72kdat85MyuEwBEFbefnCEUmCP5rGQf0poD98QLhbxnAlj6l5Nsd5 W+MDzuc+d/CulTPfsNhd/mGvvrnbeC6lJUM5zaLgpsWGaxZ15Zjjo3cB3EkBDDe+/mRU mGExAnbJ4JFGigrdxghl6k+eSxONlXlM4yCmHw3ctEQBMSzm+iSwbvPCGMcYpbjt93PS M3NZWij4DEaVGzZOt9MltzQ3ri/HzGZkoyEQrd71WxEw+ekEYJsN5CAiHgYgefgBXlb0 sZpl81a5sk/dzvsA6nEeU+3JwbB7kDRKs5vvXxvHwB8EsCHqpDpPxJnEs5Dudz8fLyq/ KkZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=raIeKlSNrDXKcGAZNA1Wi607LJfguWIntg7t2NTDT6M=; b=iJXISIBtW55TEYyGnTw2Zdcj0jMJqBULADXFZd9lKgejZSS9tQabstLYLr1SsXlC6b Cs6/NCEoLtHG7wJ9vaoSMum4QgGPVhIR5KLiELjlRpA2DgQdZahAr+wbaJFPcYL5yQlf H7qzZ/zFK+OQEJYBumMgAEa0AHKKx9/zPPnjeV9CAmAP6/kbIrP0K80zLv7U2dcpBANq +MbfcLOAeYb7Wsxii5QPk2m1iVrD2VkZ5R4NjaEIfvYOjgYArcaMO2IYIelXiYeWAzcX 9Ug27iZMGVGeF0TeYlTrQowPQArPb2ZyDpgy6rPMRldwDRtLvwcRqJy0dAo4JdgLD/nD OjQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IWxpxjdX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c4-20020a170902b68400b00161f8628ed7si8272442pls.238.2022.05.28.12.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:45:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IWxpxjdX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 227AC663E7; Sat, 28 May 2022 12:07:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237831AbiE1Pkq (ORCPT + 99 others); Sat, 28 May 2022 11:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237805AbiE1Pkp (ORCPT ); Sat, 28 May 2022 11:40:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD72417E24; Sat, 28 May 2022 08:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=raIeKlSNrDXKcGAZNA1Wi607LJfguWIntg7t2NTDT6M=; b=IWxpxjdX5iE9ZgGsLmhtg4M4CH vH/pGfaYquhHc8sshNukZNP4RSGaGcUORANzG+7DvofGt8mi1UE8qQmrARdgxTpgYMI5LQ1Cddimp +3+KFTStRV2FpDyn02LUuhImPCyrDxCYtFS9kto1Xa55IP0B13e3SoJ22Gf2O4s9IRnoT7F04i2cJ sxVyEL0HK25o1q/eNcBb4j3hVO05QjT3EvO+X+ig/mVchAOCHiEsB7mY6QRJX1LL6iId7ye0wb6Mt /hKdxWcjA9vyHDM9HxOhgdRvXHpvQS5VLE/mCLqPxjr/8OC76KoVs0/hfNWwadlHoQtcY5nP++GTD L2EppRjQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuyXs-002xVY-9v; Sat, 28 May 2022 15:40:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DD2A630022C; Sat, 28 May 2022 17:40:00 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C8AB0207C0205; Sat, 28 May 2022 17:40:00 +0200 (CEST) Date: Sat, 28 May 2022 17:40:00 +0200 From: Peter Zijlstra To: Ian Rogers Cc: Andi Kleen , perry.taylor@intel.com, caleb.biggers@intel.com, kshipra.bopardikar@intel.com, Kan Liang , Zhengjun Xing , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Maxime Coquelin , Alexandre Torgue , James Clark , John Garry , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian , Thomas Gleixner Subject: Re: [PATCH v2] perf metrics: Add literal for system TSC frequency Message-ID: References: <20220527040407.4193232-1-irogers@google.com> <76dce5d3-6c69-e403-c4d9-f882967a4467@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 28, 2022 at 07:50:40AM -0700, Ian Rogers wrote: > On Sat, May 28, 2022 at 7:02 AM Peter Zijlstra wrote: > > > > On Fri, May 27, 2022 at 07:54:19AM -0700, Andi Kleen wrote: > > > > > > This all seems bonghits inspired... and perf actually does expose the > > > > tsc frequency. What do you think is in perf_event_mmap_page::time_* ? > > > > > > > > > That's not really available to perf stat, which is the primary metrics user. > > > > Why not? You can mmap any perf-fd (even software events) and these > > fields should be filled out. > > > > It should work on any x86 CPU that has a TSC. The only caveat is that > > the kernel must not have marked the TSC unstable. > > > > It could even work for virt -- all you need is for virt to use > > native_sched_clock() instead of the paravirt nonsense. > > It will at least fail if inherit is enabled, no? For per-task events, yes, I suppose it will. I'd forgotten about that restriction on perf_mmap() :/