Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1787131ybl; Sat, 31 Aug 2019 02:14:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSdFIQYKRPxUx33aJpAYFpqe1wfpYkO/yRZ93rdWQtnC65NRK9mqEUvS7EclkUcdaGbZfi X-Received: by 2002:a63:3112:: with SMTP id x18mr16661975pgx.385.1567242863030; Sat, 31 Aug 2019 02:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567242863; cv=none; d=google.com; s=arc-20160816; b=KYD/THG/od2FytR5lSi73Jnj5UGqp75yjxvfi9Qgyr39GYbRoaUjMwZZxch3qdK18R 62cVzE2JdJNwNpsMXzNBc08wt7Cg/y6nGCg/PQeAfkR7UH6XCNnUchzZogsJBFPe10UL 39teFr4ofDNJ3UZsQdaFd9GMntEklcZeGtQT1S7vMMARDGHCjQyzw59qiKNB6BFGMbsf 9GMeb5xaIQAnTjDj9CoSi5SR/6pF1/B2HwRwkdXeoLUSJ3wG5L05Hx1u8ihK5P25t35o l+JADVhtkuKLLrzWZkYXKJv3M4QrlaSj5qqbd+xVZCOpbV1LAPAgbCeOBLEqdariYA6h NH1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NjP1K4B+dJg4KiSw2tkIWX3jIArsrWzA1uaNHVJvlN0=; b=FXjyc0Ad56z0FhZp/7Q45wjKXmazVIXusUlesDRnUQb02Tv0bjCBgwfHwsXXdc9jhA TXzT6m1OxQ+FzEYO43WSCGIe/h2w0gSpVA5a6yiCAZhzPegmp/eyN/H3uQ/x1bLjPOLW Qc5QUKLww7PH85IGZ6IKwxAGdg9XBIlk9s3s0Js5DeqtiMKZp3YYJ75AZJapPYWJ5+4C o9nmbP1tM6rkRdRE70I8HgSg9/9+dEhnLOCg90R91HJW84yseZdCk36j9dyDpREB77TB WNsMLFodZ+u2mPZ9LrofKO72Td5Q/OwGfl/vUxpcMHQMmeywDrpfjlbdS6gA/uEpaA8R M1IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ECY/8G9V"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si6357526pgn.77.2019.08.31.02.14.06; Sat, 31 Aug 2019 02:14:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ECY/8G9V"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbfHaJNS (ORCPT + 99 others); Sat, 31 Aug 2019 05:13:18 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:41064 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbfHaJNS (ORCPT ); Sat, 31 Aug 2019 05:13:18 -0400 Received: by mail-io1-f65.google.com with SMTP id j5so19000867ioj.8 for ; Sat, 31 Aug 2019 02:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NjP1K4B+dJg4KiSw2tkIWX3jIArsrWzA1uaNHVJvlN0=; b=ECY/8G9VMWkU8NkmeoAPTBGwZKyqTh/0buwe3wSCqSCkeqp3BzM+7oO/JHpnh/ommu b8MdYwzPvfhgtrMkO1AdzVFJXguJZr/5FVKX1x/O4TuzWdsRnHe+ux5I4cpPIHEm1CY2 RGd3YR6AMNcRYvcJJHIW34c5Z9lsd95tzZwU/eTxnMfZSJNl8//BWonTqKt2sPPP9S52 U1WaxdM+pzKOjVj2OBaOw+FmDxGO2LN69kTyMOxCFvaDmRnWTqd/ydnN5Ba0Ejj5IrNo rbHSzezZnygxAi09/2x950anFWbi6vQcxPowzXLJ/0apKokBCeOdyQEg05SDzZE7imaR BN7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NjP1K4B+dJg4KiSw2tkIWX3jIArsrWzA1uaNHVJvlN0=; b=eu/WXBEF4ibUESX9DX7ADfuND2mtNqGKcEPumAwdT+bAKKpNN6EFmZIiSwA/KRNpk4 jUqp24LwfN7rtIDPV8r/kDUGw1DdU+kVSq8CsFT6uyIudYR4R3QS6up5lbGjRpXYoXdv r9VJqMifMOAXV3cYEyrpJepCGGJdh/k2mthoO6DR09T5nNWOIYHW80LfO/2AJD0oHLKK p3k/D/nd5RJ4+OUqfjQEQp4ZB18cyYf0IexfaMvMlWtyIChZlx4Xpons/2Cnnb35ZgaL QDwQamsYY2blGfGf5SdjrQSLpl3q6cKZVNZL/STe4HitJkIUrYil21sVXHgNgf85BzFd oH7A== X-Gm-Message-State: APjAAAXZB85r1xW3dAucl0yDgW7Sb4lY0bOvPt9TPHckvv6cwE2tRZCa JfqH1LszhybBtMu1UWusHF5b/NrVuOiwPcOEUMpDGw== X-Received: by 2002:a5e:a90f:: with SMTP id c15mr6701972iod.41.1567242797252; Sat, 31 Aug 2019 02:13:17 -0700 (PDT) MIME-Version: 1.0 References: <20190826144740.10163-1-kan.liang@linux.intel.com> <20190826144740.10163-4-kan.liang@linux.intel.com> <20190831003110.GA5447@tassilo.jf.intel.com> In-Reply-To: <20190831003110.GA5447@tassilo.jf.intel.com> From: Stephane Eranian Date: Sat, 31 Aug 2019 02:13:05 -0700 Message-ID: Subject: Re: [RESEND PATCH V3 3/8] perf/x86/intel: Support hardware TopDown metrics To: Andi Kleen Cc: "Liang, Kan" , Peter Zijlstra , Arnaldo Carvalho de Melo , Ingo Molnar , LKML , Thomas Gleixner , Jiri Olsa , Alexander Shishkin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andi, On Fri, Aug 30, 2019 at 5:31 PM Andi Kleen wrote: > > > the same manner. It would greatly simplify the kernel implementation. > > I tried that originally. It was actually more complicated. > > You can't really do deltas on raw metrics, and a lot of the perf > infrastructure is built around deltas. > How is RAPL handled? No deltas there either. It uses the snapshot model. At each interval, perf stat just reads the current count, and does not compute a delta since previous read. With PERF_METRICS, the delta is always since previous read. If you read frequently enough you do not lose precision. > > To do the regular reset and not lose precision over time internally > you have to keep expanded counters anyways. And if you do that > you can just expose them to user space too, and have everything > in user space just work without any changes (except for the final > output) > > -Andi >