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

Create a tool to generate BTF data from a PDB file #159

Closed
dthaler opened this issue Nov 11, 2024 · 1 comment
Closed

Create a tool to generate BTF data from a PDB file #159

dthaler opened this issue Nov 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dthaler
Copy link

dthaler commented Nov 11, 2024

Describe the feature you'd like supported

Linux has pahole but we don't yet have an equivalent tool for eBPF for Windows.

Such a tool would read a .pdb file and generate BTF data to be added to an ELF file. Bing copilot explains:

The pahole tool is part of the DWARF project and is used in the context of BPF (Berkeley Packet Filter) to generate BTF (BPF Type Format) information from non-stripped ELF files that contain DWARF debug data. Here's a brief overview of what it does:

Input: pahole takes an ELF file as input, which can be either the kernel or a standard eBPF ELF object.

Processing: It processes the DWARF debug data within the ELF file to extract type information.

Output: The tool appends two additional ELF sections with BTF encoding to the input ELF file. This BTF information can then be used by BPF tools to provide better type information and improve debugging and profiling[1].

[1] https://github.com/aquasecurity/btfhub/blob/main/docs/how-to-use-pahole.md

For Windows, the input would be the PDB file but otherwise would work similarly.
BTF info in the ELF file would allow calling helpers by BTF ID instead of by static ID, thus solving the problem of coordinating static IDs across extensions including third party extensions.

In the future it might (needs investigation) even be possible to have a BTF ID for a prog type and/or attach type, to avoid having to coordinate those as well.

Proposed solution

Create a tool for windows.

Additional context

No response

@dthaler dthaler added the enhancement New feature or request label Nov 11, 2024
@dthaler
Copy link
Author

dthaler commented Nov 11, 2024

Wrong repo. This is microsoft/ebpf-for-windows#3945

@dthaler dthaler closed this as completed Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant