[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fVxFy36wZKu+M199qic1VYWo_Z9GQ+jBAp6ZkBHTHv4Ww@mail.gmail.com>
Date: Wed, 2 Feb 2022 23:58:02 -0800
From: Ian Rogers <irogers@...gle.com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: vineet.singh@...el.com, perry.taylor@...el.com,
caleb.biggers@...el.com, asaf.yaffe@...el.com,
kshipra.bopardikar@...el.com,
Kan Liang <kan.liang@...ux.intel.com>,
Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
James Clark <james.clark@....com>,
John Garry <john.garry@...wei.com>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH] perf metrics: Add literal for system TSC frequency
On Wed, Feb 2, 2022 at 7:59 PM Andi Kleen <ak@...ux.intel.com> wrote:
>
>
> On 2/2/2022 5:07 PM, Ian Rogers wrote:
> > Such a literal is useful to calculate things like the average frequency
> > [1]. The TSC frequency isn't exposed by sysfs although some experimental
> > drivers look to add it [2]. This change computes the value using the
> > frequency in /proc/cpuinfo which is accruate at least on Intel
> > processors.
>
> FWIW the information in /proc/cpuinfo is going away.
>
> You should really use CPUID for this, which has a new leaf for this.
> Unfortunately there
>
> were a few systems were it was inaccurate, but I suppose you could still
> prefer /proc/cpuinfo
>
> Also your method will not work when the metrics are used through perf
> stat report or perf script
>
> and run on another system. For the perf script case there is support for
> putting the TSC into
>
> perf.data (that is needed for PT), but the header is not dumped by
> default unfortunately.
>
> So likely you would need some new mechanism for that.
Thanks Andi,
yep metrics with perf stat record are broken on a number of fronts and
this will be another that will need a fix. It looks like the cpuid
approach won't work pre-Skylake so sysfs could act as a fallback, but
I don't have an ETA on when that will be available. We could have
additional warnings when reading /proc/cpuinfo fails. Wdyt?
Thanks,
Ian
> -Andi
>
Powered by blists - more mailing lists