libbpf / bpftool

Automated upstream mirror for bpftool stand-alone build.
Other
377 stars 69 forks source link

use bpftool dump this bpf_prog_982904fb4a4dfbdb_tracepoint_sche at 0x8a0/0x1000 how to do it? #133

Closed lichm1007 closed 6 months ago

lichm1007 commented 6 months ago

[39188.715853][ 7] CPU: 7 PID: 22871 Comm: global-event-lo Tainted: P W O 5.4.219-ss3-g28f91c85ef4d-dirty-ab421 #1 [39188.716379][ 7] Hardware name: LIA SS3 MAX B0 Default (DT) [39188.716754][ 7] pstate: 20400085 (nzCv daIf +PAN -UAO) [39188.717112][ 7] pc : bpf_prog_982904fb4a4dfbdb_tracepoint_sche+0x8a0/0x1000 [39188.717490][ 7] lr : bpf_prog_982904fb4a4dfbdb_tracepoint_sche+0x898/0x1000 [39188.717686][ 7] sp : ffffffc036aeb6c0 [39188.717818][ 7] x29: ffffffc036aeb730 x28: ffffffe2065784e8 [39188.718023][ 7] x27: ffffffe204697790 x26: 0000000000000000 [39188.718303][ 7] x25: ffffffc036aeb700 x24: 0000000005de0e82 [39188.718665][ 7] x23: ffffffe206b59ed8 x22: 00000000000035a6 [39188.719118][ 7] x21: 000023a4017327b2 x20: 000023a4017327b2 [39188.719564][ 7] x19: fffffffebfedf0e8 x18: ffffffc0310bb058 [39188.720010][ 7] x17: 0000000005f5e100 x16: 000000000006d003 [39188.720475][ 7] x15: 0000000000000ad4 x14: 0000000000000010 [39188.720958][ 7] x13: ffffffe204a6ca18 x12: 000000008d07db4b [39188.721408][ 7] x11: 00000000d958f55b x10: 0080000000000038 [39188.721822][ 7] x9 : 0000000100000005 x8 : 0000000100000005 [39188.722218][ 7] x7 : 00000000fffffff9 x6 : ffffffe204a6eab0 [39188.722640][ 7] x5 : 0000000000000000 x4 : 0000000000000080 [39188.723094][ 7] x3 : 0000000000000000 x2 : ffffffe204a6aecc [39188.723556][ 7] x1 : ffffffe204a6aecc x0 : 00000000fffffff9 [39188.723957][ 7] Call trace: [39188.724131][ 7] bpf_prog_982904fb4a4dfbdb_tracepoint_sche+0x8a0/0x1000 [39188.724558][ 7] trace_call_bpf+0x160/0x1f0 [39188.724850][ 7] perf_trace_run_bpf_submit+0x54/0xc4 [39188.725212][ 7] perf_trace_sched_switch+0x180/0x1bc [39188.725575][ 7] trace_sched_switch+0x168/0x1e8 [39188.726003][ 7] schedule+0x280/0x884 [39188.726306][ 7] schedule+0x8c/0xc0 [39188.726570][ 7] schedule_hrtimeout_range_clock+0x98/0x110 [39188.726916][ 7] do_sys_poll+0x28c/0x688 [39188.727193][ 7] arm64_sys_ppoll+0x84/0x12c [39188.727662][ 7] el0_svc_common+0xc4/0x1ac [39188.728007][ 7] el0_svc_handler+0x24/0x8c [39188.728335][ 7] el0_svc+0x8/0x300 [39188.728644][ 7] Code: f2dffc4a d63f0140 91000007 d280070a (b86a6a60) [39188.729112][ 7] ---[ end trace b9ed398d83e9ceab ]--- [39188.753983][ 7] Kernel panic - not syncing: Fatal exception

bpftool --json --pretty prog show

{ "id": 82, "type": "tracepoint", "name": "tracepoint_sche", "tag": "982904fb4a4dfbdb", "gpl_compatible": true, "loaded_at": 1709710265, "uid": 0, "bytes_xlated": 1648, "jited": true, "bytes_jited": 1700, "bytes_memlock": 4096, "map_ids": [109,110,108,107 ] },

i want to dump bpf_prog_982904fb4a4dfbdb_tracepoint_sche at 0x8a0/0x1000

qmonnet commented 6 months ago

Please can you clarify your question? It's not clear to me what you're trying to do. Is the kernel backtrace something that was caused by your bpftool invocation, or something you're trying to debug with bpftool?

i want to dump bpf_prog_982904fb4a4dfbdb_tracepoint_sche at 0x8a0/0x1000

Do you mean dumping the JITed instructions for the tracepoint_sche program? If so, you can do that (provided your bpftool binary supports disassembling JIT-ed instructions) with:

# bpftool prog dump jited name tracepoint_sche

as can be found in the docs. This will dump the whole program, you won't be able to pass a specific offset.

If instead you want to inspect a specific memory area in the kernel, bpftool won't help, you'll need to find something else.