History

bpf: Replace prog_raw_tp+btf_id with prog_tracing

The bpf program type raw_tp together with 'expected_attach_type' was the most appropriate api to indicate BTF-enabled raw_tp programs. But during development it became apparent that 'expected_attach_type' cannot be used and new 'attach_btf_id' field had to be introduced. Which means that the information is duplicated in two fields where one of them is ignored. Clean it up by introducing new program type where both 'expected_attach_type' and 'attach_btf_id' fields have specific meaning. In the future 'expected_attach_type' will be extended with other attach points that have similar semantics to raw_tp. This patch is replacing BTF-enabled BPF_PROG_TYPE_RAW_TRACEPOINT with prog_type = BPF_RPOG_TYPE_TRACING expected_attach_type = BPF_TRACE_RAW_TP attach_btf_id = btf_id of raw tracepoint inside the kernel Future patches will add expected_attach_type = BPF_TRACE_FENTRY or BPF_TRACE_FEXIT where programs have the same input context and the same helpers, but different attach points.

Alexei Starovoitov committed 7 years ago

Commit f1b95091 parent af91acb6 files · +71 −21Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/bpf.h+2−0
@@ -173,6 +173,7 @@ enum bpf_prog_type { · 172 unmodified lines
173 BPF_PROG_TYPE_CGROUP_SYSCTL,173 BPF_PROG_TYPE_CGROUP_SYSCTL,
174 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,174 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
175 BPF_PROG_TYPE_CGROUP_SOCKOPT,175 BPF_PROG_TYPE_CGROUP_SOCKOPT,
176 BPF_PROG_TYPE_TRACING,
176};177};
177 178
178enum bpf_attach_type {179enum bpf_attach_type {
@@ -199,6 +200,7 @@ enum bpf_attach_type { · 20 unmodified lines
199 BPF_CGROUP_UDP6_RECVMSG,200 BPF_CGROUP_UDP6_RECVMSG,
200 BPF_CGROUP_GETSOCKOPT,201 BPF_CGROUP_GETSOCKOPT,
201 BPF_CGROUP_SETSOCKOPT,202 BPF_CGROUP_SETSOCKOPT,
203 BPF_TRACE_RAW_TP,
202 __MAX_BPF_ATTACH_TYPE204 __MAX_BPF_ATTACH_TYPE
203};205};
204 206

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