Skip to contentSkip to conversation

drgn, a scriptable debugger

LSF/MM TOPIC Omar Sandoval 1 participant 1 message Feb 22, 2019 BPF

lore
Share & tools
lore
#0 lore raw

Hello,

I've already sent in an attend request for the I/O track, but I'd also like to propose my project, drgn [1], as a topic for the BPF/tracing track.

Basically, drgn is a more intuitive replacement for crash(8) which exposes kernel types and variables to Python. For example, one can trivially access common kernel structures:

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

init = find_task(prog, 1)
fd = fget(init, 3)
fd.f_inode.i_sb.s_type.name

(const char *)0xffffffff862bf29c = "devtmpfs"

Since it's just Python, it's also easy to do more complex analysis:

Quoted 1 line
Quoted 1 line
Quoted 1 line

sum(1 for _ in list_for_each(fd.f_inode.i_sb.s_inodes.address_of_()))

491

I've been using this to debug issues in production at Facebook. Since the project is relatively new, some of it is still in flux. I'm currently rewriting the core components in C for performance reasons. Next after that is improved documentation as well as stack trace support, which is the biggest missing feature. Regardless, it's already proven quite useful, so I'd love a chance to talk about it and gather feedback.

Thanks!

1: https://github.com/osandov/drgn