On Wed, 11 Mar 2020 10:36:47 -0700
"Andrii Nakryiko" <[email protected]> wrote:

> On Wed, Mar 11, 2020 at 10:33 AM <[email protected]> wrote:
> >
> > Hi all,
> >
> > Finally found the BPF blog and it's been nice to get more
> > information on using libbpf directly since I don't have a lot of
> > systems or kernel experience.  
> 
> Thanks! Glad it was useful.

I assume this is the blog post[1]:
 [1] 
https://facebookmicrosites.github.io/bpf/blog/2020/02/20/bcc-to-libbpf-howto-guide.html
Thanks for writing that Andrii!

For using libbpf directly from C, we also have the XDP-tutorial[2], but
doesn't contain BPF CO-RE examples.  And it uses the old style map
defines.  We are planning to update/fix that, once LLVM 10 gets more
widely available in distros.

 [2] https://github.com/xdp-project/xdp-tutorial

> >
> > Scanning through the "BCC to libbpf" post, I noticed Andrii calls
> > for using clang 10. I went to look at llvm releases and only saw
> > clang/llvm 9 (as of September 2019). Is clang 10 just built from
> > source?  
> 
> For kernel/libbpf development we do build Clang from sources, but you
> can install it from packages as well. See https://apt.llvm.org/, there
> are packages for Clang 10 and even Clang 11 and they are updated
> frequently.

Let me give you the manual compile recipe (that I got from Eelco):

 git clone https://github.com/llvm/llvm-project.git
 cd llvm-project
 mkdir -p llvm/build/install
 cd llvm/build
 cmake -G "Ninja" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
    -DLLVM_ENABLE_PROJECTS="clang" \
    -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
 ninja && ninja install
 export PATH=$PWD/install/bin:$PATH

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#1822): https://lists.iovisor.org/g/iovisor-dev/message/1822
Mute This Topic: https://lists.iovisor.org/mt/71884353/21656
Group Owner: [email protected]
Unsubscribe: https://lists.iovisor.org/g/iovisor-dev/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to