Re: [GIT PULL] perf-tools changes for v6.13

From: Namhyung Kim
Date: Tue Dec 03 2024 - 13:34:07 EST


On Mon, Nov 25, 2024 at 11:36:37PM -0800, Ian Rogers wrote:
> On Mon, Nov 25, 2024 at 6:53 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > Hello,
> >
> > On Mon, Nov 25, 2024 at 02:07:33PM -0500, Sasha Levin wrote:
> > > On Sun, Nov 24, 2024 at 11:16:53PM -0800, Namhyung Kim wrote:
> > > > Hi Linus,
> > > >
> > > > Please consider pulling the following changes in perf tools for v6.13.
> > > >
> > > > Thanks,
> > > > Namhyung
> > > >
> > > >
> > > > The following changes since commit 59b723cd2adbac2a34fc8e12c74ae26ae45bf230:
> > > >
> > > > Linux 6.12-rc6 (2024-11-03 14:05:52 -1000)
> > > >
> > > > are available in the Git repository at:
> > > >
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git tags/perf-tools-for-v6.13-2024-11-24
> > >
> > > Hey Namhyung,
> > >
> > > After merging this PR into linus-next, the "Simple expression parser"
> > > test has started failing:
> > >
> > > --- start ---
> > > test child forked, pid 292
> > > Using CPUID GenuineIntel-6-1A-3
> > > division by zero
> > > syntax error
> > > Failed to find TSC frequency in /proc/cpuinfo
> > > FAILED tests/expr.c:250 #system_tsc_freq > 0
> > > ---- end(-1) ----
> > > 7: Simple expression parser : FAILED!
> > >
> > > Here's a full log of the run: https://qa-reports.linaro.org/lkft/sashal-linus-next/build/v6.11-24716-gab16e9af2ff9/testrun/26045681/suite/perf/test/_7_Simple_expression_parser/log
> >
> > Thanks for the report, I'll take a look.

Sorry about the delay. But I cannot see the log unfornately.

>
> I suspect this is a side effect of the tool PMU refactoring where the
> expr double values were changed to u64 counter like values:
> https://lore.kernel.org/lkml/20241002032016.333748-8-irogers@xxxxxxxxxx/
>
> The CPU model matches nehalemep:

Oh, it's an Intel machine. Then it should have the #system_tsc_freq.


> ```
> $ python tools/perf/pmu-events/models.py x86 GenuineIntel-6-1A-3
> tools/perf/pmu-events/arch/
> nehalemep
> ```
> so the tsc frequency should be determined via /proc/cpuinfo looking
> for "model name ... @ %lfGHz":
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/arch/x86/util/tsc.c?h=perf-tools-next#n44
>
> The logs make the machine look like an emulator (reference to bochs)
> so I wonder if the cpuinfo is incorrect. Why the switch from double to
> u64 would show this problem I'm not sure, perhaps a latent bug was
> exposed in the test as previously NaN would be returned which does
> interesting things with comparisons. The test is expecting on an Intel
> x86 it should be able to compute the TSC frequency and assuming the
> cpuinfo is lacking the "@ ...GHz" then the test could be working as
> intended.

Right, we may change the test code not to assume TSC frequency is always
available on Intel machines.

Thanks,
Namhyung