Re: [PATCH v2] perf test record.sh: Raise limit of open file descriptors

From: Arnaldo Carvalho de Melo
Date: Mon Aug 12 2024 - 13:02:21 EST


On Mon, Aug 12, 2024 at 10:21:36AM -0300, Arnaldo Carvalho de Melo wrote:
> On Mon, Aug 12, 2024 at 10:16:10AM -0300, Arnaldo Carvalho de Melo wrote:
> > On Tue, May 21, 2024 at 11:27:56AM +0200, Michael Petlan wrote:
> > > On Mon, 29 Apr 2024, vmolnaro@xxxxxxxxxx wrote:
> > > > From: Veronika Molnarova <vmolnaro@xxxxxxxxxx>

> > > > Subtest for system-wide record with '--threads=cpu' option fails due
> > > > to a limit of open file descriptors on systems with 128 or more CPUs
> > > > as the default limit is set to 1024.

> > > > The number of open file descriptors should be slightly above
> > > > nmb_events*nmb_cpus + nmb_cpus(for perf.data.n) + 4*nmb_cpus(for pipes),
> > > > which equals 8*nmb_cpus. Therefore, temporarily raise the limit to
> > > > 16*nmb_cpus for the test.

> > > > Signed-off-by: Veronika Molnarova <vmolnaro@xxxxxxxxxx>

> > > Acked-by: Michael Petlan <mpetlan@xxxxxxxxxx>

> > b4 got confused, I'll pick the rigth version manually...

Also please install ShellCheck, with it installed, as I do, you'll get
this warning, that we should address:

CC /tmp/build/perf-tools-next/util/synthetic-events.o

In tests/shell/record.sh line 24:
default_fd_limit=$(ulimit -n)
^-- SC3045 (warning): In POSIX sh, ulimit -n is undefined.


In tests/shell/record.sh line 203:
if [[ $default_fd_limit -lt $min_fd_limit ]]; then
^-- SC3010 (warning): In POSIX sh, [[ ]] is undefined.


In tests/shell/record.sh line 204:
ulimit -n $min_fd_limit
^-- SC3045 (warning): In POSIX sh, ulimit -n is undefined.


In tests/shell/record.sh line 214:
ulimit -n $default_fd_limit
^-- SC3045 (warning): In POSIX sh, ulimit -n is undefined.

For more information:
https://www.shellcheck.net/wiki/SC3010 -- In POSIX sh, [[ ]] is undefined.
https://www.shellcheck.net/wiki/SC3045 -- In POSIX sh, ulimit -n is undefin...
make[4]: *** [tests/Build:90: /tmp/build/perf-tools-next/tests/shell/record.sh.shellcheck_log] Error 1
make[3]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:158: tests] Error 2
make[2]: *** [Makefile.perf:777: /tmp/build/perf-tools-next/perf-test-in.o] Error 2
CC /tmp/build/perf-tools-next/util/data.o
make[2]: *** Waiting for unfinished jobs....