From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751554AbdHVPzN (ORCPT ); Tue, 22 Aug 2017 11:55:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbdHVPzM (ORCPT ); Tue, 22 Aug 2017 11:55:12 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D75E620C48 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Tue, 22 Aug 2017 12:55:08 -0300 From: Arnaldo Carvalho de Melo To: Konstantin Khlebnikov Cc: Peter Zijlstra , Alexander Shishkin , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tools/perf: fix documentation for sysctls perf_event_paranoid and perf_event_mlock_kb Message-ID: <20170822155508.GV10891@kernel.org> References: <150322916080.129746.11285255474738558340.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <150322916080.129746.11285255474738558340.stgit@buzz> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, Aug 20, 2017 at 02:39:20PM +0300, Konstantin Khlebnikov escreveu: > Fix misprint CAP_IOC_LOCK -> CAP_IPC_LOCK. This capability have nothing > to do with raw tracepoints. This part is about bypassing mlock limits. > > Sysctl kernel.perf_event_paranoid = -1 allows raw and ftrace function > tracepoints without CAP_SYS_ADMIN. Thanks, looks sane, applied. - Arnaldo > Signed-off-by: Konstantin Khlebnikov > --- > Documentation/sysctl/kernel.txt | 13 ++++++++++++- > tools/perf/util/evsel.c | 4 +++- > 2 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt > index bac23c198360..ce61d1fe08ca 100644 > --- a/Documentation/sysctl/kernel.txt > +++ b/Documentation/sysctl/kernel.txt > @@ -61,6 +61,7 @@ show up in /proc/sys/kernel: > - perf_cpu_time_max_percent > - perf_event_paranoid > - perf_event_max_stack > +- perf_event_mlock_kb > - perf_event_max_contexts_per_stack > - pid_max > - powersave-nap [ PPC only ] > @@ -654,7 +655,9 @@ Controls use of the performance events system by unprivileged > users (without CAP_SYS_ADMIN). The default value is 2. > > -1: Allow use of (almost) all events by all users > ->=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK > + Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK > +>=0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN > + Disallow raw tracepoint access by users without CAP_SYS_ADMIN > >=1: Disallow CPU event access by users without CAP_SYS_ADMIN > >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN > > @@ -673,6 +676,14 @@ The default value is 127. > > ============================================================== > > +perf_event_mlock_kb: > + > +Control size of per-cpu ring buffer not counted agains mlock limit. > + > +The default value is 512 + 1 page > + > +============================================================== > + > perf_event_max_contexts_per_stack: > > Controls maximum number of stack frame context entries for > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > index 413f74df08de..5ed7056d1fd0 100644 > --- a/tools/perf/util/evsel.c > +++ b/tools/perf/util/evsel.c > @@ -2535,7 +2535,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, > "unprivileged users (without CAP_SYS_ADMIN).\n\n" > "The current value is %d:\n\n" > " -1: Allow use of (almost) all events by all users\n" > - ">= 0: Disallow raw tracepoint access by users without CAP_IOC_LOCK\n" > + " Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK\n" > + ">= 0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN\n" > + " Disallow raw tracepoint access by users without CAP_SYS_ADMIN\n" > ">= 1: Disallow CPU event access by users without CAP_SYS_ADMIN\n" > ">= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN\n\n" > "To make this setting permanent, edit /etc/sysctl.conf too, e.g.:\n\n"