Skip to contentSkip to conversation

bpf: change int cmd argument in __sys_bpf into typed enum bpf_cmd

PATCH Applied Andrii Nakryiko 2 participants 2 messages Sep 5, 2024 – Sep 6, 2024

Subsystems (2)
lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

PATCH 1/1 bpf: change int cmd argument in __sys_bpf into typed enum bpf_cmd

This improves BTF data recorded about this function and makes debugging/tracing better, because now command can be displayed as symbolic name, instead of obscure number.

---
 kernel/bpf/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/syscall.c +1 -1
index fc62f5c4faf9..6988e432fc3d 100644
@@ -5670,7 +5670,7 @@ static int token_create(union bpf_attr *attr)
 	return bpf_token_create(attr);
 }
 
-static int __sys_bpf(int cmd, bpfptr_t uattr, unsigned int size)
+static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size)
 {
 	union bpf_attr attr;
 	int err;
Signature · 1 line
2.43.5
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 8 lines · On Thu, 5 Sep 2024 14:05:20 -0700 you wrote:

This improves BTF data recorded about this function and makes debugging/tracing better, because now command can be displayed as symbolic name, instead of obscure number.

---
 kernel/bpf/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [bpf-next] bpf: change int cmd argument in __sys_bpf into typed enum bpf_cmd

    https://git.kernel.org/bpf/bpf-next/c/2db2b8cb8f96

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html