1

I want to use bcc just to compile my BPF program. All the examples I have seen use BCC to compile code on the fly, but I want to use it instead to compile my BPF program to an ELF file ahead of time which I can then load via gobpf separately.

Does BCC expose this functionality?

EDIT:

The reason I want to do this is due to a previous question I posted. In that question I described a situation where I could only get my code to work using bcc's Python bindings, but which failed when I tried to compile the BPF program directly using clang and load it using gobpf - I now want to try to use bcc to compile my BPF program to an ELF file instead of doing it directly using clang in the hope that it can be loaded using gobpf and work as expected.

Qeole
  • 8,284
  • 1
  • 24
  • 52
dippynark
  • 2,743
  • 20
  • 58
  • 1
    There's no such functionality in bcc but you can patch it to do so. I'll post the patch. – pchaigno Feb 22 '18 at 22:17
  • @pchaigno awesome, I've been trying to work out how BCC actually compiles stuff, but finding it difficult to follow it through - going to keep reading random BPF docs until it makes more sense – dippynark Feb 22 '18 at 22:21

0 Answers0