From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25D04C47088 for ; Wed, 26 May 2021 13:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDC3A613B9 for ; Wed, 26 May 2021 13:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232802AbhEZNSY (ORCPT ); Wed, 26 May 2021 09:18:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:41954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbhEZNSW (ORCPT ); Wed, 26 May 2021 09:18:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CAB0E613B9; Wed, 26 May 2021 13:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622035011; bh=LXobja8LB8VO3c7Zu/EJvpMV/chTpzUwIFAvo7VkUo4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o8+8KqKHcCohw74SaIRiCSvUii4D11QGetAyKuAJo5lpXWEF5Q17G0GUseaKPFAW0 uendXzieCizlb510GuvCFxNPX72cPRjhZKi4SFY1U2E909xbbpw/klvhk9TauBc73l rJ5889/HMZPlLOcobHkEt8g4vUX76XDuwsv7+xmqFVc9EjqcQ3YETxzYfp+XlMm2xO DNJXFP5FU2j0ENO7eIgIvshS07YKt4UgepfEn0eoVTyGhjhlMuvzbKj6cNPvlnwd1b Wa1s8whBOkXFN0RWeJjvDQ7ssMai8kdteBWBey8bmiIZBMwIczBzvOyeBwlpHL1h5n kk0CxKTZ5C9VQ== Date: Wed, 26 May 2021 22:16:47 +0900 From: Masami Hiramatsu To: Ravi Bangoria Cc: Jiri Olsa , jolsa@redhat.com, linux-kernel@vger.kernel.org, "Aneesh Kumar K . V" , Arnaldo Carvalho de Melo , acme@kernel.org Subject: Re: [PATCH] tools/perf: doc: Add permission and sysctl notice Message-Id: <20210526221647.972ffffddc88c1b08c19a024@kernel.org> In-Reply-To: References: <20210525043744.193297-1-ravi.bangoria@linux.ibm.com> <162201967838.287555.4257117900130102987.stgit@devnote2> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 May 2021 15:20:58 +0530 Ravi Bangoria wrote: > > > On 5/26/21 2:31 PM, Masami Hiramatsu wrote: > > Add a section to notify the permission and sysctl setting > > for perf probe. And fix some indentations. > > Yes, it makes sense to have this detail in man page. > > Few minor points below ... > > > > > +PERMISSIONS AND SYSCTL > > +---------------------- > > +Since perf probe depends on ftrace (tracefs) and kallsyms (/proc/kallsyms), you have to care about the permission and some sysctl knobs. > > + > > + - Since tracefs and kallsyms requires root or privileged user to access it, the following perf probe commands also require it; --add, --del, --list (except for --cache option) > > + > > + - /proc/sys/kernel/kptr_restrict = 2 (restrict all users) also prevents perf probe to retrieve the important information from kallsyms. You also need to set to 1 (restrict non CAP_SYSLOG users) for the above commands. > > + > > + - Since the perf probe commands read the vmlinux and/or the debuginfo file, you need to ensure that you can read those files. > > 1) Last two points are applicable to kprobes only, not uprobes. Would > it make sense to clarify that? Ah, right. And the last one may be also related to uprobes. > 2) For 3rd point, simple perf probe on function entry will work without > vmlinux/debuginfo (by using kallsyms). Should we mention that? Hmm, that depends on the options. If we use -k option, it will get the symbols from the given vmlinux. > > In any case, > > Acked-by: Ravi Bangoria Thanks! I'll update it for uprobe. > > Ravi -- Masami Hiramatsu