[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQl06yRnXvdBEkJ4@google.com>
Date: Mon, 3 Nov 2025 19:37:15 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
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 v1 2/2] perf test: Add test that command line period
overrides sysfs/json values
On Wed, Oct 29, 2025 at 03:26:38PM -0700, Ian Rogers wrote:
> The behavior of weak terms is subtle, add a test that they aren't
> accidentally broken.
>
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> tools/perf/tests/shell/record_weak_term.sh | 25 ++++++++++++++++++++++
> 1 file changed, 25 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..7b747b383796
> --- /dev/null
> +++ b/tools/perf/tests/shell/record_weak_term.sh
> @@ -0,0 +1,25 @@
> +#!/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
> +
> +
> +event=$(perf list --json | $PYTHON -c "import json,sys; next((print(e['EventName']) for e in json.load(sys.stdin) if e.get('Encoding') and 'period=' in e.get('Encoding')))")
This line is too long and needs some explanation like what's like the
original text and what it does.
Thanks,
Namhyung
> +if [[ "$?" != "0" ]]
> +then
> + echo "No sysfs/json events with inbuilt period."
> + exit 2
> +fi
> +
> +if ! perf record -c 1000 -vv -e "$event" -o /dev/null true 2>&1 | \
> + grep -q -F '{ sample_period, sample_freq } 1000'
> +then
> + echo "Unexpected verbose output and sample period"
> + exit 1
> +fi
> +exit 0
> --
> 2.51.1.851.g4ebd6896fd-goog
>
Powered by blists - more mailing lists