Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arnaldo Carvalho de Melo" <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 10/17] perf tests record: Exercise more record options
Date: Tue, 24 Nov 2026 19:03:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-231875@kernel.org> (raw)
In-Reply-To: <20261124184604.24983-11-acme@kernel.org>

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] perf tests record: invalid --switch-output=size=64K in
  test_switch_output()
- [Medium] perf tests record: unguarded --aio options fail when
  HAVE_AIO_SUPPORT=n
- [Medium] perf tests record: unguarded --threads=numa fails without
  NUMA or node CPUs
- [Medium] perf tests record: --threads tests do not raise soft
  RLIMIT_NOFILE ulimit
--

commit effd3981a11a3f57fa8f8fe4b22989f457d3f787
Author: Arnaldo Carvalho de Melo <acme@redhat.com>

perf tests record: Exercise more record options

This commit adds a new shell test script, record_options.sh, to exercise
various perf record command-line options.

> diff --git a/tools/perf/tests/shell/record_options.sh b/tools/perf/tests/shell/record_options.sh
> new file mode 100755
> index 0000000000000..b2bf51b5dc44c
> --- /dev/null
> +++ b/tools/perf/tests/shell/record_options.sh
> @@ -0,0 +1,173 @@

[ ... ]

> +test_switch_output() {
> +	echo "Record switch output"
> +	if ! perf record -q -e cpu-clock -c 1 --switch-output=size=64K \
> +			-o "${temp_dir}/sw" -- sleep 0.2
> +	then
> +		echo "Record switch output [Failed: perf record failed]"
> +		err=1
> +		return
> +	fi
> +	if ! ls "${temp_dir}/sw".* > /dev/null 2>&1
> +	then
> +		echo "Record switch output [Failed: no switched files]"
> +		err=1
> +		return
> +	fi
> +	echo "Record switch output [Success]"
> +}

[Severity: Medium]
Does --switch-output=size=64K actually enable size-based output switching
in switch_output_setup()?

switch_output_setup() expects a bare size or time value such as
--switch-output=64K without a "size=" prefix.  With "size=64K",
parse_tag_value(s->str, tags_size) fails because strtoul() stops at the
leading 's', and parse_tag_value(s->str, tags_time) then matches the
leading 's' as a 0-second time tag, leaving both s->size and s->time as 0.
Because switch_output_setup() still sets rec->timestamp_filename = true,
perf record renames the single output file to sw.<timestamp> at exit and
the ls check passes without any output switch occurring.

[ ... ]

> +test_record "aio" "aio" --aio=2

[Severity: Medium]
Will this test and the "test_record_option aio-one --aio=1" test below
fail on builds without HAVE_AIO_SUPPORT?

In tools/perf/builtin-record.c, the --aio option is only compiled in when
HAVE_AIO_SUPPORT is defined, so passing --aio unconditionally fails with
an unknown option error when perf is built with NO_AIO=1 or against a
libc without POSIX AIO.  Guarding both subtests with
"perf check feature -q aio" would avoid this failure.

> +test_record "threads core" "threads-core" --threads=core
> +test_record "threads package" "threads-package" --threads=package

[Severity: Medium]
Can the --threads subtests fail with EMFILE on high-core-count systems?

Each --threads run opens per-CPU event descriptors, per-CPU directory data
files, and control pipes per worker thread across all online CPUs, which
exceeds the default soft RLIMIT_NOFILE limit of 1024 on systems with 128
or more CPUs unless ulimit -Sn is raised (as record.sh does with
16 * nr_cpus).

> +test_record "threads numa" "threads-numa" --threads=numa

[Severity: Medium]
Can --threads=numa fail on kernels built without CONFIG_NUMA or on systems
with CPU-less NUMA nodes?

record__init_thread_numa_masks() calls numa_topology__new(), which fails
when /sys/devices/system/node/online is absent, and then passes each
online node's cpulist to record__init_thread_masks_spec(), which rejects
empty cpulists on memory-only NUMA nodes with -EINVAL.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124184604.24983-1-acme@kernel.org?part=10

  reply	other threads:[~2026-11-24 19:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 18:45 [PATCH v1 00/17] perf tests: Add coverage for the untested perf subcommands Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 01/17] perf tests top: Pin the ring buffer size Arnaldo Carvalho de Melo
2026-11-24 19:01   ` sashiko-bot
2026-11-24 18:45 ` [PATCH v1 02/17] perf tests sched: Exercise the sched views and options Arnaldo Carvalho de Melo
2026-11-24 18:58   ` sashiko-bot
2026-11-24 18:45 ` [PATCH v1 03/17] perf tests help: Add a basic perf help test Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 04/17] perf tests config: Exercise the config file and list options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 05/17] perf tests script: Exercise the list, fields and dump options Arnaldo Carvalho de Melo
2026-11-24 18:54   ` sashiko-bot
2026-11-24 18:45 ` [PATCH v1 06/17] perf tests sort: Exercise the report and diff sort keys Arnaldo Carvalho de Melo
2026-11-24 19:02   ` sashiko-bot
2026-11-24 18:45 ` [PATCH v1 07/17] perf tests diff: Exercise the output options Arnaldo Carvalho de Melo
2026-11-24 18:57   ` sashiko-bot
2026-11-24 18:45 ` [PATCH v1 08/17] perf tests annotate: Exercise the output and filter options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 09/17] perf tests report: Exercise the output and format options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 10/17] perf tests record: Exercise more record options Arnaldo Carvalho de Melo
2026-11-24 19:03   ` sashiko-bot [this message]
2026-11-24 18:45 ` [PATCH v1 11/17] perf tests trace: Exercise the tracing options Arnaldo Carvalho de Melo
2026-11-24 19:02   ` sashiko-bot
2026-11-24 18:45 ` [PATCH v1 12/17] perf tests timechart: Exercise the report options Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 13/17] perf tests kmem: Add a basic perf kmem test Arnaldo Carvalho de Melo
2026-11-24 18:57   ` sashiko-bot
2026-11-24 18:46 ` [PATCH v1 14/17] perf tests bench: Add smoke tests for perf bench Arnaldo Carvalho de Melo
2026-11-24 19:03   ` sashiko-bot
2026-11-24 18:46 ` [PATCH v1 15/17] perf tests lock: Exercise perf lock report and info Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 16/17] perf tests probe: Exercise the variable and line listing Arnaldo Carvalho de Melo
2026-11-24 19:00   ` sashiko-bot
2026-11-24 18:46 ` [PATCH v1 17/17] perf tests report: Exercise the TUI browsers Arnaldo Carvalho de Melo
2026-11-24 19:01   ` sashiko-bot
2026-11-24 19:03 ` [PATCH v1 00/17] perf tests: Add coverage for the untested perf subcommands sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-231875@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acme@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox