Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] Inspect a gadget in details #3387

Open
alban opened this issue Aug 22, 2024 · 0 comments
Open

[RFE] Inspect a gadget in details #3387

alban opened this issue Aug 22, 2024 · 0 comments

Comments

@alban
Copy link
Member

alban commented Aug 22, 2024

Current situation

A gadget can be imspected with the ig image inspect command (implemented in #3382). But it does not give all possible details.

See #3382 (review)

Impact

When gadget developers are trying to debug their gadgets, they cannot easily inspect the different layers, decompile, list the ebpf programs and ebpf maps etc.

Ideal future situation

It should be possible to get the following information from a gadget:

  • list of architectures supported by the gadget
  • list of layers
  • information from gadget.yaml:
    • list of ebpf params
    • list of data sources with the list of fields
  • information from the ebpf module
    • list of sections (so I can see kprobe/sys_mount)
    • list of ebpf maps with their types (so I don't have to use readelf and objdump)
    • show bpf bytecode + source (when available in ELF sections) of requested ebpf programs
  • information from the wasm module
    • what gadgetAPIVersion does it use?
    • which wasm upcalls does it make?

Implementation options

Additionally, it would be nice to have an implementation both in ig and in a wasm module to be reusable on websites. For the second case, this probably means we can't use the cilium/ebpf package.

Additional information

I gave it a try with wasm and came up with the following website:

https://github.com/alban/bpfanalyser
https://alban.github.io/bpfanalyser/

image

Useful changes in cilium/ebpf: cilium/ebpf#1552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant