lkml.org 
[lkml]   [2017]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] tools: bpf_jit_disasm: Add option to dump JIT image to a file.
From
Date
On 04/11/2017 02:54 PM, Daniel Borkmann wrote:
> On 04/11/2017 11:30 PM, David Daney wrote:
>> When debugging the JIT on an embedded platform or cross build
>> environment, libbfd may not be available, making it impossible to run
>> bpf_jit_disasm natively.
>>
>> Add an option to emit a binary image of the JIT code to a file. This
>> file can then be disassembled off line. Typical usage in this case
>> might be (pasting mips64 dmesg output to cat command):
>>
>> $ cat > jit.raw
>> $ bpf_jit_disasm -f jit.raw -O jit.bin
>> $ mips64-linux-gnu-objdump -D -b binary -m mips:isa64r2 -EB jit.bin
>>
>> Signed-off-by: David Daney <david.daney@cavium.com>
>
> Seems good, we could at some point also add an -I jit.bin option
> if needed for offline analysis/comparison instead of using -f
> plain text.
>

FWIW: The objdump incantation in the changelog does just about the same
disassembly as the bpf_jit_disasm internal implementation.

> Thanks!
>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>

\
 
 \ /
  Last update: 2017-04-12 01:11    [W:0.069 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site