perf evlist: Expose perf_event_mlock_kb_in_pages() helper
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 15 Apr 2016 20:46:31 +0000 (17:46 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 15 Apr 2016 20:46:31 +0000 (17:46 -0300)
commitf5e7150cd9a7779a54b192d21afb9245384db8bc
treee061fe5d0e029765c5c4e57d68cc503198f66bba
parent056149932602ef905f1e26fc4fe242ef0533a597
perf evlist: Expose perf_event_mlock_kb_in_pages() helper

When the user doesn't set --mmap-pages, perf_evlist__mmap() will do it
by reading the maximum possible for a non-root user from the
/proc/sys/kernel/perf_event_mlock_kb file.

Expose that function so that 'perf trace' can, for root users, to bump
mmap-pages to a higher value for root, based on the contents of this
proc file.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-xay69plylwibpb3l4isrpl1k@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evlist.c
tools/perf/util/evlist.h