lkml.org 
[lkml]   [2015]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL 0/6] perf/core improvements and fixes
On 6/4/15 7:04 AM, Ingo Molnar wrote:
>> > # perf record -e bpf_source.c cmdline
>> >
>> > to create a eBPF filter from source,
>> >
>> >Use
>> >
>> ># perf record -e bpf_object.o cmdline
>> >
>> >to create a eBPF filter from object intermedia.
>> >
>> >Use
>> >
>> ># perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
>> >
>> >to create the .o
>> >
>> >I think this should be enough. Currently only the second case has been implemented.
> So if users cannot actually generate .o files then it's premature to merge this in
> such an incomplete form!
>
> It should be possible to use a feature that we are merging.

of course it's usable :) There is some confusion here.
To compile .c into .o one can easily use
clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
any version of clang is ok,
llc needs to be fresh with bpf backend.

For a lot of cases kernel headers are not needed, so above
will work fine.
For our TC examples we recommend to use 'bcc' alias:
bcc() {
clang -O2 -emit-llvm -c $1 -o - | llc -march=bpf -filetype=obj -o
"`basename $1 .c`.o"
}
then compiling as easy as 'bcc file.c'

What Wang mentioned that we're working on is fully integrated 'bcc'.
It will use clang/llvm as libraries, so no intermediate steps will
be needed, but some folks will always have concerns about
ultra-embedded environments where even 20Mb of libllvm.so is too much.

So I think we need to support both 'perf record -e file.[co]'



\
 
 \ /
  Last update: 2015-06-04 18:41    [W:0.079 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site