History

bpf: Add attach_btf_id attribute to program load

Add attach_btf_id attribute to prog_load command. It's similar to existing expected_attach_type attribute which is used in several cgroup based program types. Unfortunately expected_attach_type is ignored for tracing programs and cannot be reused for new purpose. Hence introduce attach_btf_id to verify bpf programs against given in-kernel BTF type id at load time. It is strictly checked to be valid for raw_tp programs only. In a later patches it will become: btf_id == 0 semantics of existing raw_tp progs. btd_id > 0 raw_tp with BTF and additional type safety.

Alexei Starovoitov committed 7 years ago

Commit ccfe29e1 parent 8580ac94 files · +17 −4Browse files

Showing the changes to tools/include/uapi (1 of 4 files). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+1−0
@@ -420,6 +420,7 @@ union bpf_attr { · 419 unmodified lines
420420 __u32 line_info_rec_size; /* userspace bpf_line_info size */
421421 __aligned_u64 line_info; /* line info */
422422 __u32 line_info_cnt; /* number of bpf_line_info records */
423+ __u32 attach_btf_id; /* in-kernel BTF type id to attach to */
423424 };
424425
425426 struct { /* anonymous struct used by BPF_OBJ_* commands */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t