2023-10-27 02:33:44

by Yang Jihong

[permalink] [raw]
Subject: [PATCH] perf python: Add missing util/rlimit.c file to the python binding linkage list

In commit c4a852635edd ("perf data: Increase RLIMIT_NOFILE limit when open
too many files in perf_data__create_dir()") we started using the
evsel__increase_rlimit() function from util/rlimit.c used
in the python binding, which caused this entry in 'perf test' to fail:

$ ./perf test python
19: 'import perf' in python : FAILED!

After:

$ ./perf test -v python
Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc
19: 'import perf' in python :
--- start ---
test child forked, pid 1100249
python usage test: "echo "import sys ; sys.path.insert(0, 'python'); import perf" | '/usr/bin/python3' "
test child finished with 0
---- end ----
'import perf' in python: Ok

Fixes: c4a852635edd ("perf data: Increase RLIMIT_NOFILE limit when open too many files in perf_data__create_dir()")
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Yang Jihong <[email protected]>
---
tools/perf/util/python-ext-sources | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources
index 26e1c8d973ea..593b660ec75e 100644
--- a/tools/perf/util/python-ext-sources
+++ b/tools/perf/util/python-ext-sources
@@ -40,6 +40,7 @@ util/rwsem.c
util/hashmap.c
util/perf_regs.c
util/fncache.c
+util/rlimit.c
util/perf-regs-arch/perf_regs_aarch64.c
util/perf-regs-arch/perf_regs_arm.c
util/perf-regs-arch/perf_regs_csky.c
--
2.34.1


2023-10-27 13:40:13

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf python: Add missing util/rlimit.c file to the python binding linkage list

Em Fri, Oct 27, 2023 at 02:30:28AM +0000, Yang Jihong escreveu:
> Fixes: c4a852635edd ("perf data: Increase RLIMIT_NOFILE limit when open too many files in perf_data__create_dir()")

This is not the cset that introduced the problem, I added it to the
patch I submitted for this:

Fixes: e093a222d7cba1eb ("perf evsel: Rename evsel__increase_rlimit to rlimit__increase_nofile")

Since the patch in your messgage basically has what is in the patch I
submitted, I added an:

Acked-by: Yang Jihong <[email protected]>

to it.

In the future, the right thing would be for you to use:

Reported-by: Arnaldo Carvalho de Melo <[email protected]>

As I didn't provide a Signed-off-by for the patch, I just mentioned that
the patch cured things for me, sometimes a patch like this may not be
the ultimate fix.

Thanks,

- Arnaldo