diff options
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
| -rw-r--r-- | tools/lib/bpf/libbpf.h | 30 | 
1 files changed, 28 insertions, 2 deletions
| diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index e0605403f977..455a957cb702 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -499,9 +499,11 @@ struct bpf_perf_event_opts {  	__u64 bpf_cookie;  	/* don't use BPF link when attach BPF program */  	bool force_ioctl_attach; +	/* don't automatically enable the event */ +	bool dont_enable;  	size_t :0;  }; -#define bpf_perf_event_opts__last_field force_ioctl_attach +#define bpf_perf_event_opts__last_field dont_enable  LIBBPF_API struct bpf_link *  bpf_program__attach_perf_event(const struct bpf_program *prog, int pfd); @@ -877,6 +879,21 @@ LIBBPF_API struct bpf_link *  bpf_program__attach_netkit(const struct bpf_program *prog, int ifindex,  			   const struct bpf_netkit_opts *opts); +struct bpf_cgroup_opts { +	/* size of this struct, for forward/backward compatibility */ +	size_t sz; +	__u32 flags; +	__u32 relative_fd; +	__u32 relative_id; +	__u64 expected_revision; +	size_t :0; +}; +#define bpf_cgroup_opts__last_field expected_revision + +LIBBPF_API struct bpf_link * +bpf_program__attach_cgroup_opts(const struct bpf_program *prog, int cgroup_fd, +				const struct bpf_cgroup_opts *opts); +  struct bpf_map;  LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(const struct bpf_map *map); @@ -940,6 +957,12 @@ LIBBPF_API int bpf_program__set_log_level(struct bpf_program *prog, __u32 log_le  LIBBPF_API const char *bpf_program__log_buf(const struct bpf_program *prog, size_t *log_size);  LIBBPF_API int bpf_program__set_log_buf(struct bpf_program *prog, char *log_buf, size_t log_size); +LIBBPF_API struct bpf_func_info *bpf_program__func_info(const struct bpf_program *prog); +LIBBPF_API __u32 bpf_program__func_info_cnt(const struct bpf_program *prog); + +LIBBPF_API struct bpf_line_info *bpf_program__line_info(const struct bpf_program *prog); +LIBBPF_API __u32 bpf_program__line_info_cnt(const struct bpf_program *prog); +  /**   * @brief **bpf_program__set_attach_target()** sets BTF-based attach target   * for supported BPF program types: @@ -1283,6 +1306,7 @@ enum bpf_tc_attach_point {  	BPF_TC_INGRESS = 1 << 0,  	BPF_TC_EGRESS  = 1 << 1,  	BPF_TC_CUSTOM  = 1 << 2, +	BPF_TC_QDISC   = 1 << 3,  };  #define BPF_TC_PARENT(a, b) 	\ @@ -1297,9 +1321,11 @@ struct bpf_tc_hook {  	int ifindex;  	enum bpf_tc_attach_point attach_point;  	__u32 parent; +	__u32 handle; +	const char *qdisc;  	size_t :0;  }; -#define bpf_tc_hook__last_field parent +#define bpf_tc_hook__last_field qdisc  struct bpf_tc_opts {  	size_t sz; | 
