-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Slim down of libbcc.so #2218
Comments
Also if we can get rid of exceptions, that brings down the size of libbcc.so from 55MB to 46MB as |
Maybe you already thought of it, but you should be able to use objcopy(1) to remove the .eh_frame section, and other unnecessary sections (-R .ehframe -R ...). That way you can take the packaged libbcc.so and apply a trimming script. |
Yes, I can use
But I am not sure if it will break something (only build tested cos I'm on a plane :D) related to exceptions. I'll test it more. I thought a cleaner solution was if we could make BCC not use exceptions and build it with |
To compile a tracing program, the llvm needs to support two targets: native host (e.g, arm64) and BPF. The arm64 is needed so all the kernel headers linked into bpf program are properly processed so that bpf program has the same view for the kernel data structures as the kernel itself. In your above, your llvm only builds with BPF backend, which is not sufficiently. llvm majority code is not in target. Maybe adding arm64 target should not increase the its size too big? For exceptions in bcc. yes, currently bcc uses it. I am okay to replace exceptions with proper error output. |
For Android usecases, I am trying to bring down the size of libbcc.so. Currently it is at 55MB.
Disassembling it, I see that there are a lot of references to the x86 LLVM backend. This seems a bit useless since libbcc.so will only generate eBPF backend machine code.
I built my own LLVM without the x86 backend and only with eBPF backend.
Now I am trying to build BCC with that LLVM I just built using:
However that fails because the "clang" I built obviously doesn't have the x86 backend so it cannot compile BCC itself.
What I want is to use the "stock" LLVM in my distro to build BCC, however for libbcc itself, I want it to link to the LLVM I just built with only the eBPF backend. So basically that looks like:
This seems a bit tricky, but I'll keep poking. Any thoughts / guidance on how I can accomplish this @drzaeus77 @yonghong-song ?
The text was updated successfully, but these errors were encountered: