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

emit btf debug info for loading with libbpf-rs #1

Closed
dvc94ch opened this issue Jan 17, 2021 · 5 comments
Closed

emit btf debug info for loading with libbpf-rs #1

dvc94ch opened this issue Jan 17, 2021 · 5 comments

Comments

@dvc94ch
Copy link

dvc94ch commented Jan 17, 2021

No description provided.

@vlad9486
Copy link

Remove this line, and use the linker with debug build.

But there is another problem: libbpf expect the structure has field type, but it is keyword in rust, and escaping does not help, debug info anyway containing r#type instead of type.

The simple solution is bithack of the bpf elf sed -i 's/r#type/type\x0\x0/g' path/to/bpf.elf.

@vlad9486
Copy link

vlad9486 commented Apr 23, 2021

Hello, @alessandrod thanks for the linker, it is great. I think create a pr to remove few lines is overkill. Please, consider to remove this line, or add a command line option.

@alessandrod
Copy link
Collaborator

I'll put the strip behind a command line flag, but I'm curious has anyone been getting segfaults generating BTF debug info? I know there's something that triggers a segfault in the BTF emitter in llvm, but haven't had time to look into it.

@vlad9486
Copy link

I have a bpf binary containing ring buffer, map, dozen of tracepoints and some non-trivial logic, I never saw a segfault during developing. But I saw some segfault when use release mode bpf binary, maybe it is how to reproduce the issue. Anyway it makes no sense to use release mode bpf with libbpf.

@vadorovsky
Copy link
Member

Done in #182

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

Successfully merging a pull request may close this issue.

4 participants