perf python: Add missing util/rlimit.c file to the python binding linkage list

Message ID 20231027023028.1106441-1-yangjihong1@huawei.com
State New
Headers
Series perf python: Add missing util/rlimit.c file to the python binding linkage list |

Commit Message

Yang Jihong Oct. 27, 2023, 2:30 a.m. UTC
  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 <acme@redhat.com>
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
 tools/perf/util/python-ext-sources | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Arnaldo Carvalho de Melo Oct. 27, 2023, 1:39 p.m. UTC | #1
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 <yangjihong1@huawei.com>

to it.

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

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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
  

Patch

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