Commit 0146580
bpf: Extend bpf syscall with common attributes support
Extend the 'bpf()' syscall to support a set of common attributes shared
across all BPF commands:
1. 'log_buf': User-provided buffer for storing logs.
2. 'log_size': Size of the log buffer.
3. 'log_level': Log verbosity level.
4. 'log_true_size': The size of log reported by kernel.
These common attributes are passed as the 4th argument to the 'bpf()'
syscall, with the 5th argument specifying the size of this structure.
To indicate the use of these common attributes from userspace, a new flag
'BPF_COMMON_ATTRS' ('1 << 16') is introduced. This flag is OR-ed into the
'cmd' field of the syscall.
When 'cmd & BPF_COMMON_ATTRS' is set, the kernel will copy the common
attributes from userspace into kernel space for use.
Signed-off-by: Leon Hwang <[email protected]>1 parent 5d00461 commit 0146580
File tree
4 files changed
+37
-5
lines changed- include
- linux
- uapi/linux
- kernel/bpf
- tools/include/uapi/linux
4 files changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | | - | |
| 936 | + | |
| 937 | + | |
937 | 938 | | |
938 | 939 | | |
939 | 940 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
975 | 975 | | |
976 | 976 | | |
977 | 977 | | |
| 978 | + | |
978 | 979 | | |
979 | 980 | | |
980 | 981 | | |
| |||
1474 | 1475 | | |
1475 | 1476 | | |
1476 | 1477 | | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1477 | 1485 | | |
1478 | 1486 | | |
1479 | 1487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6092 | 6092 | | |
6093 | 6093 | | |
6094 | 6094 | | |
6095 | | - | |
| 6095 | + | |
| 6096 | + | |
6096 | 6097 | | |
| 6098 | + | |
6097 | 6099 | | |
6098 | 6100 | | |
6099 | 6101 | | |
| |||
6107 | 6109 | | |
6108 | 6110 | | |
6109 | 6111 | | |
| 6112 | + | |
| 6113 | + | |
| 6114 | + | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
| 6118 | + | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
6110 | 6124 | | |
6111 | 6125 | | |
6112 | 6126 | | |
| |||
6239 | 6253 | | |
6240 | 6254 | | |
6241 | 6255 | | |
6242 | | - | |
| 6256 | + | |
| 6257 | + | |
6243 | 6258 | | |
6244 | | - | |
| 6259 | + | |
6245 | 6260 | | |
6246 | 6261 | | |
6247 | 6262 | | |
| |||
6272 | 6287 | | |
6273 | 6288 | | |
6274 | 6289 | | |
6275 | | - | |
| 6290 | + | |
6276 | 6291 | | |
6277 | 6292 | | |
6278 | 6293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
975 | 975 | | |
976 | 976 | | |
977 | 977 | | |
| 978 | + | |
978 | 979 | | |
979 | 980 | | |
980 | 981 | | |
| |||
1474 | 1475 | | |
1475 | 1476 | | |
1476 | 1477 | | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1477 | 1485 | | |
1478 | 1486 | | |
1479 | 1487 | | |
| |||
0 commit comments