Hacker News new | past | comments | ask | show | jobs | submit login
Some early praise for using drgn for poking into Linux kernel internals (utcc.utoronto.ca)
73 points by ingve on May 7, 2023 | hide | past | favorite | 4 comments



oh this is very cool, tldr it's an alternative for `crash`.

https://drgn.readthedocs.io/en/latest/index.html

> drgn (pronounced “dragon”) is a debugger with an emphasis on programmability. drgn exposes the types and variables in a program for easy, expressive scripting in Python. For example, you can debug the Linux kernel:

  from drgn.helpers.linux import list_for_each_entry

  for mod in list_for_each_entry('struct module', prog['modules'].address_of_(),'list'):
   if mod.refcnt.counter > 10:
       print(mod.name)


  > (char [56])"snd"
  > (char [56])"evdev"
  > (char [56])"i915"


I remember looking at some internals on Solaris with dtrace, I think eBPF would be an equally good tool for doing that on Linux, it's mentionned at the end of the article but I fail to see why would drgn be better.


You are looking for bpftrace

Drgn is closer solaris’ mdb debugger.


It sounds pretty similar to dtrace as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: