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

Load eBPF from a file (and not embedded in the YAML) #58

Closed
amitn opened this issue Jun 25, 2019 · 4 comments
Closed

Load eBPF from a file (and not embedded in the YAML) #58

amitn opened this issue Jun 25, 2019 · 4 comments

Comments

@amitn
Copy link

amitn commented Jun 25, 2019

Would like to have the option to load eBPF program from a file and not embedded in the YAML.

I found it useful when having the same eBPF shared with a Python bcc then you can have something like:

#!/usr/bin/python3
from bcc import BPF
b = BPF(src_file="my_ebpf_program.c")

And:
config.yaml:

programs:
    - name: my_program
        file: my_ebpf_program.c

ebpf_exporter --config.file=config.yaml

I have created the change amitn/ebpf_exporter@f99ac6f

What I'm not sure about, from usability point of view, is how to handle relative path, from execution or from configuration

@bobrik
Copy link
Contributor

bobrik commented Jun 25, 2019

Do you have a sample program that you use in this manner (from exporter and somewhere else)?

@bwplotka
Copy link
Contributor

This is great, but I think this is could be much more useful if we would be able to add multiple file's projects. E.g I have couple of headers with extra helpers that I would love to load and import with the program.

@bwplotka
Copy link
Contributor

Actually ignore, me I can import just fine using cflags: e.g

    cflags:
      - -I/shared/data/ebpf_exporter/include

@bwplotka
Copy link
Contributor

I guess this will work for @amitn case too (:

@bobrik bobrik closed this as completed Sep 15, 2021
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

No branches or pull requests

3 participants