From: Arnaldo Carvalho de Melo Date: Fri, 12 Dec 2014 18:59:51 +0000 (-0300) Subject: perf evlist: Clarify sterror_mmap variable names X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e5d4a290da5366c397653c47c3e869a67b1bfa07;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf evlist: Clarify sterror_mmap variable names Prep patch for doing further checks like when the number of pages that is being attempted is actually below /proc/sys/kernel/perf_event_mlock_kb but the operation fails because the user doesn't have CAP_IPC_LOCK. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-wetzlux7mzvofu5cuji5i71i@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index de7515dd683a..d661f252b891 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1487,16 +1487,16 @@ int perf_evlist__strerror_open(struct perf_evlist *evlist __maybe_unused, int perf_evlist__strerror_mmap(struct perf_evlist *evlist, int err, char *buf, size_t size) { char sbuf[STRERR_BUFSIZE], *emsg = strerror_r(err, sbuf, sizeof(sbuf)); - int value; + int pages_attempted = evlist->mmap_len / 1024, pages_max_per_user; switch (err) { case EPERM: - sysctl__read_int("kernel/perf_event_mlock_kb", &value); + sysctl__read_int("kernel/perf_event_mlock_kb", &pages_max_per_user); scnprintf(buf, size, "Error:\t%s.\n" "Hint:\tCheck /proc/sys/kernel/perf_event_mlock_kb (%d kB) setting.\n" "Hint:\tTried using %zd kB.\n" "Hint:\tTry using a smaller -m/--mmap-pages value.", - emsg, value, evlist->mmap_len / 1024); + emsg, pages_max_per_user, pages_attempted); break; default: scnprintf(buf, size, "%s", emsg);