lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fUG65e4JzqKbJrJY2DAsj56ZLJwFqekgDScMWTCtzycdg@mail.gmail.com>
Date: Fri, 7 Nov 2025 09:29:15 -0800
From: Ian Rogers <irogers@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, 
	Arnaldo Carvalho de Melo <acme@...nel.org>, Alexander Shishkin <alexander.shishkin@...ux.intel.com>, 
	Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>, 
	Kan Liang <kan.liang@...ux.intel.com>, James Clark <james.clark@...aro.org>, 
	linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v2 2/2] perf test: Add test that command line period
 overrides sysfs/json values

On Thu, Nov 6, 2025 at 5:39 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> On Thu, Nov 06, 2025 at 03:37:10PM -0800, Ian Rogers wrote:
> > The behavior of weak terms is subtle, add a test that they aren't
> > accidentally broken.
>
> I've got this error.
>
>   $ sudo ./perf test -v 'record weak terms'
>   --- start ---
>   test child forked, pid 4014275
>   Testing that for cpu/event=0..0xfff,edge,inv,.../modifier the period is overridden with 1000
>   Fail: Unexpected verbose output and sample period

Ah, the raw encoding from:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/pmus.c?h=perf-tools-next#n745
this will need skipping.

Thanks,
Ian

>   ---- end(-1) ----
>    92: record weak terms                                               : FAILED!
>
> Thanks,
> Namhyung
>
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> > v2: Add more comments to the test code and reduce the line length (Namhyung).
> > ---
> >  tools/perf/tests/shell/record_weak_term.sh | 36 ++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >  create mode 100755 tools/perf/tests/shell/record_weak_term.sh
> >
> > diff --git a/tools/perf/tests/shell/record_weak_term.sh b/tools/perf/tests/shell/record_weak_term.sh
> > new file mode 100755
> > index 000000000000..ee4bcc792aeb
> > --- /dev/null
> > +++ b/tools/perf/tests/shell/record_weak_term.sh
> > @@ -0,0 +1,36 @@
> > +#!/bin/bash
> > +# record weak terms
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Test that command line options override weak terms from sysfs or inbuilt json.
> > +set -e
> > +
> > +shelldir=$(dirname "$0")
> > +# shellcheck source=lib/setup_python.sh
> > +. "${shelldir}"/lib/setup_python.sh
> > +
> > +# Find the first event with a specified period, such as
> > +# "cpu_core/event=0x24,period=200003,umask=0xff/"
> > +event=$(perf list --json | $PYTHON -c '
> > +import json, sys
> > +for e in json.load(sys.stdin):
> > +    if "Encoding" in e and "period=" in e["Encoding"]:
> > +       print(e["EventName"])
> > +       sys.exit(0)
> > +sys.exit(1)
> > +')
> > +if [[ "$?" != "0" ]]
> > +then
> > +  echo "Skip: No sysfs/json events with inbuilt period."
> > +  exit 2
> > +fi
> > +
> > +echo "Testing that for $event the period is overridden with 1000"
> > +perf list --detail "$event"
> > +if ! perf record -c 1000 -vv -e "$event" -o /dev/null true 2>&1 | \
> > +  grep -q -F '{ sample_period, sample_freq }   1000'
> > +then
> > +  echo "Fail: Unexpected verbose output and sample period"
> > +  exit 1
> > +fi
> > +echo "Success"
> > +exit 0
> > --
> > 2.51.2.1041.gc1ab5b90ca-goog
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ