perf tools: Introduce rlimit__bump_memlock() helper
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 9 Jul 2019 17:49:26 +0000 (14:49 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 9 Jul 2019 17:59:11 +0000 (14:59 -0300)
commit4975223b8156c14f0537dcde1554f050fb4d29bf
treed4ffefa1da356cf3fe58291ef88061c2cd9d4645
parent323fd749821daab0f327ec86d707c4542963cdb0
perf tools: Introduce rlimit__bump_memlock() helper

Just like the BPF guys did when faced with failures with map creation,
etc, i.e. their solution is:

  tools/testing/selftests/bpf/bpf_rlimit.h

For perf use this function in 'perf test' and in 'perf trace'.

Make it bump to 4 times the current value, if it fails twice the current
value and if it still fails, warn that things like BPF map creation may
fail, to help in diagnosing the problem.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-muvqef2i7n6pzqbmu7tn2d2y@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/Build
tools/perf/util/rlimit.c [new file with mode: 0644]
tools/perf/util/rlimit.h [new file with mode: 0644]