Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1991336lfo; Sat, 28 May 2022 12:57:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyriiId2tBOxmvdnHF7IXEldQxNex4ObhtO5hmDT0bZ7Nv1oAQ+s5K8poM6xkguQgCFbyTa X-Received: by 2002:a17:902:f68f:b0:162:23c6:e61b with SMTP id l15-20020a170902f68f00b0016223c6e61bmr31247649plg.136.1653767843630; Sat, 28 May 2022 12:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653767843; cv=none; d=google.com; s=arc-20160816; b=E4mV/IoUwLY0VIT8VnuG4+wjAGyW3t9KiAfUccCCsXveZ3DJsX7G5u4V1MnqHRQ11x GlgvNWuAYZ6VUaX1Xmtz9nqEQV0wWLE2WZuPtyU5HUhWBMAC3JI7C7bHzSea1gLFe+dy M6EIs0pYoIUOhgDlGdhIyGViZK7Xi5FXnTOwK1BdUdlSyal4n3BeAL5xqPk1mReWiuEX 7B2Np7J//1bVRkNn9vr6zKwSQIl3W57LMysx9EyN643rtvO8UHrjSxlrIXZMgElIzZyw eDtR6yw/Tl7kqZf/t0yQONGuNvFB7f14HGa6Xf6ia3oBh6vDKqoefreZb71YlbuEi3mk h4vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=87UMH55qhP/F7dWZ9iWyn0juZKRL0czGeuBEHHkp02w=; b=gXe9wsgeJw4K7opD0hz62LjJ1tCzs6icCWTjJOA0RSoOwl4ccvuLD5T2JiC+ZncVAb 0YRvYgyMedQUY2NclmokK2Q527kndDTQZJEoatQejPAQMdqlp2kuCb8iXsictnYtMShx 01WUjS3z6NyCP5MGzbz8C0J+keZAHRfl+ZUX/Jg6kfTR6g+zrZTfS280m+Pkv3+71BtB +D8JjiLe/etAfmRzHF8kmUip734xmiBZtv1KDUup+fLE9vRDH/z/AjUSGcUzeocpU+c/ i8kNWEc8dk4bnxVqy5IhZFP9reOk643Pg+xftCiMVNHmKRNAkgBimgTVsHXjGjbR06W7 eHBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=M9m1lPTf; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q29-20020aa7961d000000b004fa3a8dff75si9671977pfg.44.2022.05.28.12.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:57:23 -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=@google.com header.s=20210112 header.b=M9m1lPTf; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BCA531CE; Sat, 28 May 2022 12:16:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236802AbiE1Ou4 (ORCPT + 99 others); Sat, 28 May 2022 10:50:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiE1Ouy (ORCPT ); Sat, 28 May 2022 10:50:54 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A62BB264C for ; Sat, 28 May 2022 07:50:53 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id p5-20020a1c2905000000b003970dd5404dso4183038wmp.0 for ; Sat, 28 May 2022 07:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=87UMH55qhP/F7dWZ9iWyn0juZKRL0czGeuBEHHkp02w=; b=M9m1lPTfTKvLG11Iinnl/uRVdXiNC3C5HJ0y5+ViXA8hxKj1xwRcTeA9olVCFnJV4G gDXPkWbrL9UWtaWw+Lks/+5xWKY+ZCwtL75nZ92Yz9Ufodq62YAr+BvMHP2CAUGPkH3d qxGfTVdggo3HUHLhkdAhz9IeFn/ZKO+I3ANHGE0g/mCvRX7fhccPDWuvPjmE/u9whzoo 829N4hm41WQ6OsBaFPAGinqkCCh52VpiJkFq+poS3P/8NRcIHDnti1c7HQFThlcxn3/5 uwn5obDh2cpu7xj0Ef4I53Dc8/QHVOsNTOjmUUrim14VQLjkqgFbfk5Qn2AEYpRJSqBP 8/OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=87UMH55qhP/F7dWZ9iWyn0juZKRL0czGeuBEHHkp02w=; b=w7zY/LQKJNAnawTf75PciogoV/UrvBSGGImGrnkqhSIUHbVWYfs5ltcr1HK8LdMiq/ xFxDa22OYqZWzaAjxT6SbhavZlnG03/0lA53FtyUmqEjOpL7sfFr66JT3tcSIP+Zk9bq NzkfrmNh+lOT44sU1BmHj4JzNBDXmk7xf7zjI5HUagsvW6+nEZRkBFoZzwE1/dS3VUaq mV5t0Tn8A1jx9uyPZvrTHcbRN9IjMMFkVCnazLwZqxodePZMIPEIDEgh0lvgu7FXFsgR 85W1GQGKdY8nGRGUsT6kDLlOX5UgWM3xQ4pljs90g9dvahw82KhZjdYM6Z7rf4dKIYBR 3EUg== X-Gm-Message-State: AOAM530utIsIhv68La4gAEfMz5j/ig8ng7A/JFAVkkvnws9WG5qqD+ew ayDpSusCabTalGvRJ4wySHpTenAvvDhMlSyCFXa4Pg== X-Received: by 2002:a05:600c:19cb:b0:397:51db:446f with SMTP id u11-20020a05600c19cb00b0039751db446fmr11533653wmq.182.1653749452050; Sat, 28 May 2022 07:50:52 -0700 (PDT) MIME-Version: 1.0 References: <20220527040407.4193232-1-irogers@google.com> <76dce5d3-6c69-e403-c4d9-f882967a4467@linux.intel.com> In-Reply-To: From: Ian Rogers Date: Sat, 28 May 2022 07:50:40 -0700 Message-ID: Subject: Re: [PATCH v2] perf metrics: Add literal for system TSC frequency To: Peter Zijlstra 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 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? Thanks, Ian