All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Small BPF documentation fixes
@ 2019-08-19 21:21 Peter Wu
  2019-08-19 21:21 ` [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation Peter Wu
  2019-08-19 21:21 ` [PATCH 2/2] bpf: clarify description for CONFIG_BPF_EVENTS Peter Wu
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Wu @ 2019-08-19 21:21 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann; +Cc: netdev, bpf

Hi,

Some fixes for doc issues I ran into while playing with BPF and uprobes.

Kind regards,
Peter

Peter Wu (2):
  bpf: fix 'struct pt_reg' typo in documentation
  bpf: clarify description for CONFIG_BPF_EVENTS

 include/uapi/linux/bpf.h       | 6 +++---
 kernel/trace/Kconfig           | 3 ++-
 tools/include/uapi/linux/bpf.h | 6 +++---
 3 files changed, 8 insertions(+), 7 deletions(-)

-- 
2.22.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation
  2019-08-19 21:21 [PATCH 0/2] Small BPF documentation fixes Peter Wu
@ 2019-08-19 21:21 ` Peter Wu
  2019-08-20  1:44   ` Alexei Starovoitov
  2019-08-19 21:21 ` [PATCH 2/2] bpf: clarify description for CONFIG_BPF_EVENTS Peter Wu
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Wu @ 2019-08-19 21:21 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann; +Cc: netdev, bpf

There is no 'struct pt_reg'.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
---
 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*.
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] bpf: clarify description for CONFIG_BPF_EVENTS
  2019-08-19 21:21 [PATCH 0/2] Small BPF documentation fixes Peter Wu
  2019-08-19 21:21 ` [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation Peter Wu
@ 2019-08-19 21:21 ` Peter Wu
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Wu @ 2019-08-19 21:21 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann; +Cc: netdev, bpf

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 <peter@lekensteyn.nl>
---
 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
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation
  2019-08-19 21:21 ` [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation Peter Wu
@ 2019-08-20  1:44   ` Alexei Starovoitov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2019-08-20  1:44 UTC (permalink / raw)
  To: Peter Wu; +Cc: Alexei Starovoitov, Daniel Borkmann, Network Development, bpf

On Mon, Aug 19, 2019 at 2:21 PM Peter Wu <peter@lekensteyn.nl> wrote:
>
> There is no 'struct pt_reg'.
>
> Signed-off-by: Peter Wu <peter@lekensteyn.nl>
> ---
>  include/uapi/linux/bpf.h       | 6 +++---
>  tools/include/uapi/linux/bpf.h | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)

please split it into two patches. One for kernel and one for user.
We need tools/* to be updated separately due to auto-sync
of libbpf into github.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-20  1:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 21:21 [PATCH 0/2] Small BPF documentation fixes Peter Wu
2019-08-19 21:21 ` [PATCH 1/2] bpf: fix 'struct pt_reg' typo in documentation Peter Wu
2019-08-20  1:44   ` Alexei Starovoitov
2019-08-19 21:21 ` [PATCH 2/2] bpf: clarify description for CONFIG_BPF_EVENTS Peter Wu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.