From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Subject: Re: [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process Date: Sat, 11 Jan 2020 08:47:35 +0900 Message-ID: <20200111084735.0ff01c758bfbfd0ae2e1f24e@kernel.org> References: <20200108160713.GI2844@hirez.programming.kicks-ass.net> <20200110140234.GO2844@hirez.programming.kicks-ass.net> <20200111005213.6dfd98fb36ace098004bde0e@kernel.org> <20200110164531.GA2598@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200110164531.GA2598@kernel.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Arnaldo Carvalho de Melo Cc: Mark Rutland , Song Liu , Peter Zijlstra , Benjamin Herrenschmidt , Will Deacon , Alexei Starovoitov , Stephane Eranian , "james.bottomley@hansenpartnership.com" , Paul Mackerras , Jiri Olsa , Andi Kleen , Michael Ellerman , Igor Lubashev , James Morris , Alexander Shishkin , Ingo Molnar , oprofile-list@lists.sf.net, Serge Hallyn , Robert Richter , Kees Cook , Jann Horn , "selinux@vger.kernel.org" , intel-gfx@lists.f List-Id: linux-perf-users.vger.kernel.org On Fri, 10 Jan 2020 13:45:31 -0300 Arnaldo Carvalho de Melo wrote: > Em Sat, Jan 11, 2020 at 12:52:13AM +0900, Masami Hiramatsu escreveu: > > On Fri, 10 Jan 2020 15:02:34 +0100 Peter Zijlstra wrote: > > > Again, this only allows attaching to previously created kprobes, it does > > > not allow creating kprobes, right? > > > > That is; I don't think CAP_SYS_PERFMON should be allowed to create > > > kprobes. > > > > As might be clear; I don't actually know what the user-ABI is for > > > creating kprobes. > > > There are 2 ABIs nowadays, ftrace and ebpf. perf-probe uses ftrace interface to > > define new kprobe events, and those events are treated as completely same as > > tracepoint events. On the other hand, ebpf tries to define new probe event > > via perf_event interface. Above one is that interface. IOW, it creates new kprobe. > > Masami, any plans to make 'perf probe' use the perf_event_open() > interface for creating kprobes/uprobes? Would you mean perf probe to switch to perf_event_open()? No, perf probe is for setting up the ftrace probe events. I think we can add an option to use perf_event_open(). But current kprobe creation from perf_event_open() is separated from ftrace by design. I think the reason why ebpf uses perf_event_open() interface is to avoid conflict with ftrace users. Those probes are temporally used by ebpf, but if it is appeared on ftrace, it is easy to be used by ftrace. In that case, it can not be removed when the ebpf exits. Thank you, -- Masami Hiramatsu 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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2E663C282DD for ; Fri, 10 Jan 2020 23:49:28 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 785DD2072E for ; Fri, 10 Jan 2020 23:49:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="t116nza3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 785DD2072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47vfpY3WndzDqpC for ; Sat, 11 Jan 2020 10:49:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=mhiramat@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=t116nza3; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47vfmh0YvMzDqkL for ; Sat, 11 Jan 2020 10:47:47 +1100 (AEDT) Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A61EC20721; Fri, 10 Jan 2020 23:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578700065; bh=NuMXPw3kPSPAokfxRtkSxkyo7a4EVAlOcwjKZAwv8nY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t116nza3ajSBnjZbfKgcN5ONvfAghlxApVIAIUZPf0R8FY7ey0DryHbox6JEQPVwR 2xql9T24vHJ7lZgd8/0P6ybYgmcY34jFGX+VnlShjoGYoVU3chcg4p7xaRfP4Azzzx FSSjjNHlhTZMBRDpXhh2exzFwwJlouRtCsAGpcsw= Date: Sat, 11 Jan 2020 08:47:35 +0900 From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Subject: Re: [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process Message-Id: <20200111084735.0ff01c758bfbfd0ae2e1f24e@kernel.org> In-Reply-To: <20200110164531.GA2598@kernel.org> References: <20200108160713.GI2844@hirez.programming.kicks-ass.net> <20200110140234.GO2844@hirez.programming.kicks-ass.net> <20200111005213.6dfd98fb36ace098004bde0e@kernel.org> <20200110164531.GA2598@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Song Liu , Peter Zijlstra , "joonas.lahtinen@linux.intel.com" , Will Deacon , Alexei Starovoitov , Stephane Eranian , "james.bottomley@hansenpartnership.com" , Paul Mackerras , Jiri Olsa , Andi Kleen , Alexey Budankov , Igor Lubashev , James Morris , Alexander Shishkin , Ingo Molnar , oprofile-list@lists.sf.net, Serge Hallyn , Robert Richter , Kees Cook , Jann Horn , "selinux@vger.kernel.org" , "intel-gfx@lists.freedesktop.org" , "jani.nikula@linux.intel.com" , Lionel Landwerlin , "rodrigo.vivi@intel.com" , Namhyung Kim , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Tvrtko Ursulin , "linux-parisc@vger.kernel.org" , linux-kernel , "linux-perf-users@vger.kernel.org" , "linux-security-module@vger.kernel.org" , Casey Schaufler , "bpf@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, 10 Jan 2020 13:45:31 -0300 Arnaldo Carvalho de Melo wrote: > Em Sat, Jan 11, 2020 at 12:52:13AM +0900, Masami Hiramatsu escreveu: > > On Fri, 10 Jan 2020 15:02:34 +0100 Peter Zijlstra wrote: > > > Again, this only allows attaching to previously created kprobes, it does > > > not allow creating kprobes, right? > > > > That is; I don't think CAP_SYS_PERFMON should be allowed to create > > > kprobes. > > > > As might be clear; I don't actually know what the user-ABI is for > > > creating kprobes. > > > There are 2 ABIs nowadays, ftrace and ebpf. perf-probe uses ftrace interface to > > define new kprobe events, and those events are treated as completely same as > > tracepoint events. On the other hand, ebpf tries to define new probe event > > via perf_event interface. Above one is that interface. IOW, it creates new kprobe. > > Masami, any plans to make 'perf probe' use the perf_event_open() > interface for creating kprobes/uprobes? Would you mean perf probe to switch to perf_event_open()? No, perf probe is for setting up the ftrace probe events. I think we can add an option to use perf_event_open(). But current kprobe creation from perf_event_open() is separated from ftrace by design. I think the reason why ebpf uses perf_event_open() interface is to avoid conflict with ftrace users. Those probes are temporally used by ebpf, but if it is appeared on ftrace, it is easy to be used by ftrace. In that case, it can not be removed when the ebpf exits. Thank you, -- Masami Hiramatsu 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 8F8B0C282DD for ; Fri, 10 Jan 2020 23:47:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5864A2072E for ; Fri, 10 Jan 2020 23:47:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OkGdx1tl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="t116nza3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5864A2072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QyMjdIypUxDnn+IIO8vJgEc//8EKivUc4wniyNqQzv0=; b=OkGdx1tlJipUPe HEKUx2lpWzqu928K2kr7WUXBJZvx356p7HBfctsqzlt+O/cbDDeBji1/znlsRCsOKyoS+VtI4Dtmk EL9ax8T8aNQ/1UunqtbCaZ9Y7fLcsVjdwaHYPPLXz8LHYY0/6FWDb3gEOKp++X4CFI9woZrnji/0g krIvaCMo2wKOu8P7g1dL0EnkILlx/c7wCuUeMHrQBvr9y9BKxtKeUhzHzZ6AySKIsApqUAWAH0YH8 rYB1uc6GgisQvjT/wTyWvVlPGNL21Gdrw+N4tWUZvxLqksyMLqj63BM0Ae+ke6XMlS9A1wQJX4P6k mRgEfpalSW3AEsANMz+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iq40L-0004qw-Ih; Fri, 10 Jan 2020 23:47:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iq40I-0004qc-CC for linux-arm-kernel@lists.infradead.org; Fri, 10 Jan 2020 23:47:47 +0000 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A61EC20721; Fri, 10 Jan 2020 23:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578700065; bh=NuMXPw3kPSPAokfxRtkSxkyo7a4EVAlOcwjKZAwv8nY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t116nza3ajSBnjZbfKgcN5ONvfAghlxApVIAIUZPf0R8FY7ey0DryHbox6JEQPVwR 2xql9T24vHJ7lZgd8/0P6ybYgmcY34jFGX+VnlShjoGYoVU3chcg4p7xaRfP4Azzzx FSSjjNHlhTZMBRDpXhh2exzFwwJlouRtCsAGpcsw= Date: Sat, 11 Jan 2020 08:47:35 +0900 From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Subject: Re: [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process Message-Id: <20200111084735.0ff01c758bfbfd0ae2e1f24e@kernel.org> In-Reply-To: <20200110164531.GA2598@kernel.org> References: <20200108160713.GI2844@hirez.programming.kicks-ass.net> <20200110140234.GO2844@hirez.programming.kicks-ass.net> <20200111005213.6dfd98fb36ace098004bde0e@kernel.org> <20200110164531.GA2598@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200110_154746_455762_E0EFAF21 X-CRM114-Status: GOOD ( 16.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Song Liu , Peter Zijlstra , Benjamin Herrenschmidt , "joonas.lahtinen@linux.intel.com" , Will Deacon , Alexei Starovoitov , Stephane Eranian , "james.bottomley@hansenpartnership.com" , Paul Mackerras , Jiri Olsa , Andi Kleen , Michael Ellerman , Alexey Budankov , Igor Lubashev , James Morris , Alexander Shishkin , Ingo Molnar , oprofile-list@lists.sf.net, Serge Hallyn , Robert Richter , Kees Cook , Jann Horn , "selinux@vger.kernel.org" , "intel-gfx@lists.freedesktop.org" , "jani.nikula@linux.intel.com" , Lionel Landwerlin , "rodrigo.vivi@intel.com" , Namhyung Kim , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Tvrtko Ursulin , "linux-parisc@vger.kernel.org" , linux-kernel , "linux-perf-users@vger.kernel.org" , "linux-security-module@vger.kernel.org" , Casey Schaufler , "bpf@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 10 Jan 2020 13:45:31 -0300 Arnaldo Carvalho de Melo wrote: > Em Sat, Jan 11, 2020 at 12:52:13AM +0900, Masami Hiramatsu escreveu: > > On Fri, 10 Jan 2020 15:02:34 +0100 Peter Zijlstra wrote: > > > Again, this only allows attaching to previously created kprobes, it does > > > not allow creating kprobes, right? > > > > That is; I don't think CAP_SYS_PERFMON should be allowed to create > > > kprobes. > > > > As might be clear; I don't actually know what the user-ABI is for > > > creating kprobes. > > > There are 2 ABIs nowadays, ftrace and ebpf. perf-probe uses ftrace interface to > > define new kprobe events, and those events are treated as completely same as > > tracepoint events. On the other hand, ebpf tries to define new probe event > > via perf_event interface. Above one is that interface. IOW, it creates new kprobe. > > Masami, any plans to make 'perf probe' use the perf_event_open() > interface for creating kprobes/uprobes? Would you mean perf probe to switch to perf_event_open()? No, perf probe is for setting up the ftrace probe events. I think we can add an option to use perf_event_open(). But current kprobe creation from perf_event_open() is separated from ftrace by design. I think the reason why ebpf uses perf_event_open() interface is to avoid conflict with ftrace users. Those probes are temporally used by ebpf, but if it is appeared on ftrace, it is easy to be used by ftrace. In that case, it can not be removed when the ebpf exits. Thank you, -- Masami Hiramatsu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 E37B7C282DD for ; Fri, 10 Jan 2020 23:47:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACA472072E for ; Fri, 10 Jan 2020 23:47:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="t116nza3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACA472072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27C0D89CDE; Fri, 10 Jan 2020 23:47:47 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED52789CDE for ; Fri, 10 Jan 2020 23:47:45 +0000 (UTC) Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A61EC20721; Fri, 10 Jan 2020 23:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578700065; bh=NuMXPw3kPSPAokfxRtkSxkyo7a4EVAlOcwjKZAwv8nY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t116nza3ajSBnjZbfKgcN5ONvfAghlxApVIAIUZPf0R8FY7ey0DryHbox6JEQPVwR 2xql9T24vHJ7lZgd8/0P6ybYgmcY34jFGX+VnlShjoGYoVU3chcg4p7xaRfP4Azzzx FSSjjNHlhTZMBRDpXhh2exzFwwJlouRtCsAGpcsw= Date: Sat, 11 Jan 2020 08:47:35 +0900 From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Message-Id: <20200111084735.0ff01c758bfbfd0ae2e1f24e@kernel.org> In-Reply-To: <20200110164531.GA2598@kernel.org> References: <20200108160713.GI2844@hirez.programming.kicks-ass.net> <20200110140234.GO2844@hirez.programming.kicks-ass.net> <20200111005213.6dfd98fb36ace098004bde0e@kernel.org> <20200110164531.GA2598@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Song Liu , Peter Zijlstra , Benjamin Herrenschmidt , Will Deacon , Alexei Starovoitov , Stephane Eranian , "james.bottomley@hansenpartnership.com" , Paul Mackerras , Jiri Olsa , Andi Kleen , Michael Ellerman , Igor Lubashev , James Morris , Alexander Shishkin , Ingo Molnar , oprofile-list@lists.sf.net, Serge Hallyn , Robert Richter , Kees Cook , Jann Horn , "selinux@vger.kernel.org" , "intel-gfx@lists.freedesktop.org" , Namhyung Kim , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, "linux-parisc@vger.kernel.org" , linux-kernel , "linux-perf-users@vger.kernel.org" , "linux-security-module@vger.kernel.org" , Casey Schaufler , "bpf@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 10 Jan 2020 13:45:31 -0300 Arnaldo Carvalho de Melo wrote: > Em Sat, Jan 11, 2020 at 12:52:13AM +0900, Masami Hiramatsu escreveu: > > On Fri, 10 Jan 2020 15:02:34 +0100 Peter Zijlstra wrote: > > > Again, this only allows attaching to previously created kprobes, it does > > > not allow creating kprobes, right? > > > > That is; I don't think CAP_SYS_PERFMON should be allowed to create > > > kprobes. > > > > As might be clear; I don't actually know what the user-ABI is for > > > creating kprobes. > > > There are 2 ABIs nowadays, ftrace and ebpf. perf-probe uses ftrace interface to > > define new kprobe events, and those events are treated as completely same as > > tracepoint events. On the other hand, ebpf tries to define new probe event > > via perf_event interface. Above one is that interface. IOW, it creates new kprobe. > > Masami, any plans to make 'perf probe' use the perf_event_open() > interface for creating kprobes/uprobes? Would you mean perf probe to switch to perf_event_open()? No, perf probe is for setting up the ftrace probe events. I think we can add an option to use perf_event_open(). But current kprobe creation from perf_event_open() is separated from ftrace by design. I think the reason why ebpf uses perf_event_open() interface is to avoid conflict with ftrace users. Those probes are temporally used by ebpf, but if it is appeared on ftrace, it is easy to be used by ftrace. In that case, it can not be removed when the ebpf exits. Thank you, -- Masami Hiramatsu _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx