-
Notifications
You must be signed in to change notification settings - Fork 279
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
Support multiple languages / platforms #19
Comments
I have some small questions.
|
I like it overall, but I'd leave libbpf submodule at the top level still. It is not used from Rust, but I feel like it's a good idea to keep it at top level, because some other language might come up that will build libbpf from sources (e.g., Go + Cgo). In in general, it's libbpf-bootstrap, so libbpf should be more apparent ;) As for Makefile in each example subdir. It's trivial to have a simlar makefile that will delegate to upper level Makefile for build and clean up, so yeah, |
Yeah, we could. Or we could just have
libbpf-rs depends on libbpf-sys. libbpf-sys vendors (submodule) a specific libbpf version and builds/links to it at compile time: https://github.com/alexforster/libbpf-sys/blob/3c1c21e45c7ea74f6d0fe18ab99624d9ee14fc96/build.rs#L13-L23 |
Sure, sounds good.
Ok, I'll look into that I'll update the issue summary |
The kprobe program depends on vmlinux.h. If I want to compile the android bpf program, do I need to generate the vmlinux.h file corresponding to the android system? How should I organize them?
Or this?
|
Maybe:
and then depending on if you use |
This reorganizes the examples to make room for other languages and platforms as described in libbpf#19 . There are now Makefiles for each individual example that delegate to the parent Makefile. This makes it possible to type `make` anywhere and get what you expect.
This reorganizes the examples to make room for other languages and platforms as described in libbpf#19 . There are now Makefiles for each individual example that delegate to the parent Makefile. This makes it possible to type `make` anywhere and get what you expect.
No overwriting, please. See iovisor/bcc#3265 for how we dealt with it in libbpf-tools. Do you think that's feasible here as well? |
So only one vmlinux.h can support linux and android at same time? It seems great! |
Yes, it's just a source of type definitions, nothing more. And you don't even need vmlinux.h, you can define all the types on your own and mark them with |
This reorganizes the examples to make room for other languages and platforms as described in libbpf#19 . There are now Makefiles for each individual example that delegate to the parent Makefile. This makes it possible to type `make` anywhere and get what you expect.
This reorganizes the examples to make room for other languages and platforms as described in libbpf#19 . There are now Makefiles for each individual example that delegate to the parent Makefile. This makes it possible to type `make` anywhere and get what you expect.
This reorganizes the examples to make room for other languages and platforms as described in libbpf#19 .
This reorganizes the examples to make room for other languages and platforms as described in libbpf#19 .
This reorganizes the examples to make room for other languages and platforms as described in #19 .
Creating this issue to decide directory structure and code layout.
Current structure:
Proposed structure:
Basic idea is top level entries (
tools/
,vmlinux/
, etc.) are shared between all examples. Anything language / platform specific must be completely contained to theexamples/*
directory. Each language/platform has a makefile that does the right thing.Not sure if each individual example should have its own makefile. Maybe it'd be nice to be able to
cd
into any example and just typemake
.The text was updated successfully, but these errors were encountered: