Yonghong Song
254471e57a
tools/bpf: bpftool: add support for func types
This patch added support to print function signature
if btf func_info is available. Note that ksym
now uses function name instead of prog_name as
prog_name has a limit of 16 bytes including
ending '\0'.
The following is a sample output for selftests
test_btf with file test_btf_haskv.o for translated insns
and jited insns respectively.
$ bpftool prog dump xlated id 1
int _dummy_tracepoint(struct dummy_tracepoint_args * arg):
0: (85) call pc+2#bpf_prog_2dcecc18072623fc_test_long_fname_1
1: (b7) r0 = 0
2: (95) exit
int test_long_fname_1(struct dummy_tracepoint_args * arg):
3: (85) call pc+1#bpf_prog_89d64e4abf0f0126_test_long_fname_2
4: (95) exit
int test_long_fname_2(struct dummy_tracepoint_args * arg):
5: (b7) r2 = 0
6: (63) *(u32 *)(r10 -4) = r2
7: (79) r1 = *(u64 *)(r1 +8)
...
22: (07) r1 += 1
23: (63) *(u32 *)(r0 +4) = r1
24: (95) exit
$ bpftool prog dump jited id 1
int _dummy_tracepoint(struct dummy_tracepoint_args * arg):
bpf_prog_b07ccb89267cf242__dummy_tracepoint:
0: push %rbp
1: mov %rsp,%rbp
......
3c: add $0x28,%rbp
40: leaveq
41: retq
int test_long_fname_1(struct dummy_tracepoint_args * arg):
bpf_prog_2dcecc18072623fc_test_long_fname_1:
0: push %rbp
1: mov %rsp,%rbp
......
3a: add $0x28,%rbp
3e: leaveq
3f: retq
int test_long_fname_2(struct dummy_tracepoint_args * arg):
bpf_prog_89d64e4abf0f0126_test_long_fname_2:
0: push %rbp
1: mov %rsp,%rbp
......
80: add $0x28,%rbp
84: leaveq
85: retq
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-11-20 10:54:39 -08:00
..
2018-10-26 16:26:32 -07:00
2018-10-31 09:57:53 -03:00
2018-11-20 10:54:39 -08:00
2018-08-15 15:04:25 -07:00
2018-09-28 12:46:26 +08:00
2018-09-30 08:49:55 -07:00
2018-07-23 19:18:10 +01:00
2018-11-20 10:54:39 -08:00
2018-10-01 15:40:59 +02:00
2018-11-20 10:54:39 -08:00
2018-10-02 10:28:04 +02:00
2018-11-03 23:42:16 +01:00
2018-10-03 11:19:52 +01:00
2018-11-03 18:13:43 -07:00
2018-10-23 16:16:40 +01:00
2018-09-04 17:00:37 +01:00
2018-11-20 10:54:39 -08:00
2018-10-18 19:44:39 +02:00
2018-07-27 16:54:40 +03:00
2018-09-04 16:45:02 -07:00
2018-10-03 11:19:52 +01:00