No output for tracing functions #2656
Unanswered
pkropachev
asked this question in
Q&A
Replies: 1 comment
-
Currently several of required kernel options are missing. # ./check_kernel_features.sh
Required option CONFIG_BPF_JIT not set
Required option CONFIG_UPROBES not set
Required option CONFIG_UPROBE_EVENTS not set
Missing required features Is # ./strace -ebpf /data/bin/bpftools/bpftrace -e 'kprobe:wait_for_unix_gc { printf("function is called\n"); }' -v
INFO: node count: 6
Attaching 1 probe...
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7fc9eee010, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS}, 116) = -1 EINVAL (Invalid argument)
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7fc9eee020, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="libbpf_nametest"}, 64) = 3
bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_PERF_EVENT_ARRAY, key_size=4, value_size=4, max_entries=8, map_flags=0, inner_map_fd=0, map_name="printf", map_ifindex=0}, 72) = 3
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fc9eee54c, value=0x7fc9eee50c, flags=BPF_ANY}, 32) = 0
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=2, insns=0x7fc9eedf60, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="ksys_read", prog_ifindex=0, expected_attach_type=0x2a /* BPF_??? */}, 128) = 13
bpf(0x1c /* BPF_??? */, 0x7fc9eeddd0, 48) = -1 EINVAL (Invalid argument)
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=12, insns=0xb4000077c280baa0, license="GPL", log_level=1, log_size=1000000, log_buf="", kern_version=KERNEL_VERSION(5, 10, 43), prog_flags=0, prog_name="wait_for_unix_g", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS}, 128) = 14
bpf(BPF_OBJ_GET_INFO_BY_FD, {info={bpf_fd=14, info_len=232 => 208, info=0x7fc9eee100}}, 16) = 0
Program ID: 116
The verifier log:
processed 10 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
Attaching kprobe:wait_for_unix_gc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I've built bpftools (including bpftrace) for aach64 using the set of makefiles from ExtendedAndroidTools repo.
# /data/bin/bpftools/bpftrace -l 'kprobe:do*sleep' kprobe:do_cpu_nanosleep kprobe:do_nanosleep
But by some reason in case of trying trace I don't see any output from bpftrace.
# BPFTRACE_KERNEL_SOURCE=/data/bin/linux-5.10.43 /data/bin/bpftools/bpftrace -e 'kprobe:do_nanosleep { printf("sleep by %d\n", tid); }' Attaching 1 probe...
I've tried other functions, but result the same.
Could you please advice what next steps I should done to find the cause of such behavior?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions