From patchwork Mon Aug 19 21:21:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 1149587 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lekensteyn.nl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lekensteyn.nl header.i=@lekensteyn.nl header.b="TG42tdnv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46C6LN6PGgz9sN6 for ; Tue, 20 Aug 2019 07:21:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728575AbfHSVV3 (ORCPT ); Mon, 19 Aug 2019 17:21:29 -0400 Received: from lekensteyn.nl ([178.21.112.251]:34193 "EHLO lekensteyn.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbfHSVV2 (ORCPT ); Mon, 19 Aug 2019 17:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=7CupV58WRWiKDxvQAu9+9At5uK+8XL0fGrHzxya5eWk=; b=TG42tdnvVmRV8yPboaizVeQmKvtJjMpuv7o06/I1+F/9Jx8JzuTL3bD/wIoI81Rdi24LSrdsGuKKrLXGpp073aDShnYTEpgjymslcOuCKxLEbxhxSl8BaDatcINUgPqndmvkNwxgydcYpRBnTiT/2rWX2T7Y+RGwW5gczDRQmqDsAJOe75tMknHKbe9E/PYywjSV7/TMEl5S9jSpiito3qlJ9p2kgxD0YJmtxLbc27hglJ5KwML2psT4QN4HgX2XfgvqRzVqAbUU0d3i8jTB68BmE2F/JgcK6A8c2Ogef8p341SkWMwQOMLmqV1lLMlB3QJX3T5CO6iNU3Cdzo3QNw==; Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1hzp5g-0005T6-Ha; Mon, 19 Aug 2019 23:21:24 +0200 From: Peter Wu To: Alexei Starovoitov , Daniel Borkmann Cc: netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation Date: Mon, 19 Aug 2019 22:21:21 +0100 Message-Id: <20190819212122.10286-2-peter@lekensteyn.nl> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190819212122.10286-1-peter@lekensteyn.nl> References: <20190819212122.10286-1-peter@lekensteyn.nl> MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Status: No, hits=-0.0 required=5.0 tests=NO_RELAYS=-0.001 autolearn=unavailable autolearn_force=no Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is no 'struct pt_reg'. Signed-off-by: Peter Wu --- include/uapi/linux/bpf.h | 6 +++--- tools/include/uapi/linux/bpf.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index fa1c753dcdbc..9ca333c3ce91 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -1013,7 +1013,7 @@ union bpf_attr { * The realm of the route for the packet associated to *skb*, or 0 * if none was found. * - * int bpf_perf_event_output(struct pt_reg *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) + * int bpf_perf_event_output(struct pt_regs *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf @@ -1075,7 +1075,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_get_stackid(struct pt_reg *ctx, struct bpf_map *map, u64 flags) + * int bpf_get_stackid(struct pt_regs *ctx, struct bpf_map *map, u64 flags) * Description * Walk a user or a kernel stack and return its id. To achieve * this, the helper needs *ctx*, which is a pointer to the context @@ -1724,7 +1724,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_override_return(struct pt_reg *regs, u64 rc) + * int bpf_override_return(struct pt_regs *regs, u64 rc) * Description * Used for error injection, this helper uses kprobes to override * the return value of the probed function, and to set it to *rc*. diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 4e455018da65..8bff70ff5ce9 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -1013,7 +1013,7 @@ union bpf_attr { * The realm of the route for the packet associated to *skb*, or 0 * if none was found. * - * int bpf_perf_event_output(struct pt_reg *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) + * int bpf_perf_event_output(struct pt_regs *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf @@ -1075,7 +1075,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_get_stackid(struct pt_reg *ctx, struct bpf_map *map, u64 flags) + * int bpf_get_stackid(struct pt_regs *ctx, struct bpf_map *map, u64 flags) * Description * Walk a user or a kernel stack and return its id. To achieve * this, the helper needs *ctx*, which is a pointer to the context @@ -1721,7 +1721,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_override_return(struct pt_reg *regs, u64 rc) + * int bpf_override_return(struct pt_regs *regs, u64 rc) * Description * Used for error injection, this helper uses kprobes to override * the return value of the probed function, and to set it to *rc*. From patchwork Mon Aug 19 21:21:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 1149585 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lekensteyn.nl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lekensteyn.nl header.i=@lekensteyn.nl header.b="RpJXXkmz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46C6LL0p30z9sN4 for ; Tue, 20 Aug 2019 07:21:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbfHSVV3 (ORCPT ); Mon, 19 Aug 2019 17:21:29 -0400 Received: from lekensteyn.nl ([178.21.112.251]:32881 "EHLO lekensteyn.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728376AbfHSVV2 (ORCPT ); Mon, 19 Aug 2019 17:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=CPhDF5jnURDhjAxSFhJHWKq3/SRRecFjjjdMVgviX/E=; b=RpJXXkmzoFgbBUx1sJBeRcHJKuT3/TD6/lyleO5gyECCe5Im1ZGtsgioV7qOQNSOQ9H8LaNRFUpvCyaAI5XWirTUJRmHqgykZG0bncQM6g7OTi/uywPq9eskKMNeNw2mPUIAoTt4rCvsVXnFA93SsSHF+dxJ7WCwl+X1l4x9AsHZ6oG4Cz2Z/EOMcDuM/Qqhr1xj1NpDtweWRh72S1y/+xwr0rVYWjv2c0Xsvz6Cz9/r7lJLQJsV49/MBi6PgbuUG2CoPgZYUSlS6489CWe4iTLWndmoljJoVEuXwsYfOBgWx5iYEkg8EfRsJ6nKzsObRqRWVGPVBLWexQZMJd489g==; Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1hzp5h-0005T6-0w; Mon, 19 Aug 2019 23:21:25 +0200 From: Peter Wu To: Alexei Starovoitov , Daniel Borkmann Cc: netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 2/2] bpf: clarify description for CONFIG_BPF_EVENTS Date: Mon, 19 Aug 2019 22:21:22 +0100 Message-Id: <20190819212122.10286-3-peter@lekensteyn.nl> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190819212122.10286-1-peter@lekensteyn.nl> References: <20190819212122.10286-1-peter@lekensteyn.nl> MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Status: No, hits=-0.0 required=5.0 tests=NO_RELAYS=-0.001 autolearn=unavailable autolearn_force=no Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org PERF_EVENT_IOC_SET_BPF supports uprobes since v4.3, and tracepoints since v4.7 via commit 04a22fae4cbc ("tracing, perf: Implement BPF programs attached to uprobes"), and commit 98b5c2c65c29 ("perf, bpf: allow bpf programs attach to tracepoints") respectively. Signed-off-by: Peter Wu --- kernel/trace/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 98da8998c25c..b09d7b1ffffd 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -520,7 +520,8 @@ config BPF_EVENTS bool default y help - This allows the user to attach BPF programs to kprobe events. + This allows the user to attach BPF programs to kprobe, uprobe, and + tracepoint events. config DYNAMIC_EVENTS def_bool n