Skip to content

Commit ee491d8

Browse files
iamkafaiAlexei Starovoitov
authored andcommitted
bpf: tools: Sync uapi bpf.h
Sync uapi bpf.h to tools/include/uapi/linux for the new bpf_line_info. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent c454a46 commit ee491d8

File tree

1 file changed

+19
-0
lines changed
  • tools/include/uapi/linux

1 file changed

+19
-0
lines changed

tools/include/uapi/linux/bpf.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ union bpf_attr {
356356
__u32 func_info_rec_size; /* userspace bpf_func_info size */
357357
__aligned_u64 func_info; /* func info */
358358
__u32 func_info_cnt; /* number of bpf_func_info records */
359+
__u32 line_info_rec_size; /* userspace bpf_line_info size */
360+
__aligned_u64 line_info; /* line info */
361+
__u32 line_info_cnt; /* number of bpf_line_info records */
359362
};
360363

361364
struct { /* anonymous struct used by BPF_OBJ_* commands */
@@ -2679,6 +2682,12 @@ struct bpf_prog_info {
26792682
__u32 func_info_rec_size;
26802683
__aligned_u64 func_info;
26812684
__u32 func_info_cnt;
2685+
__u32 line_info_cnt;
2686+
__aligned_u64 line_info;
2687+
__aligned_u64 jited_line_info;
2688+
__u32 jited_line_info_cnt;
2689+
__u32 line_info_rec_size;
2690+
__u32 jited_line_info_rec_size;
26822691
} __attribute__((aligned(8)));
26832692

26842693
struct bpf_map_info {
@@ -2995,4 +3004,14 @@ struct bpf_func_info {
29953004
__u32 type_id;
29963005
};
29973006

3007+
#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10)
3008+
#define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)
3009+
3010+
struct bpf_line_info {
3011+
__u32 insn_off;
3012+
__u32 file_name_off;
3013+
__u32 line_off;
3014+
__u32 line_col;
3015+
};
3016+
29983017
#endif /* _UAPI__LINUX_BPF_H__ */

0 commit comments

Comments
 (0)