From: Hekuang <hekuang@huawei.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: <acme@kernel.org>, <peterz@infradead.org>, <mingo@redhat.com>,
<jolsa@redhat.com>, <brendan.d.gregg@gmail.com>, <ast@kernel.org>,
<alexander.shishkin@linux.intel.com>, <wangnan0@huawei.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v2 00/26] perf tools: Support uBPF script
Date: Mon, 27 Jun 2016 10:10:42 +0800 [thread overview]
Message-ID: <57708B22.7030406@huawei.com> (raw)
In-Reply-To: <20160626204806.GA34060@ast-mbp>
hi
在 2016/6/27 4:48, Alexei Starovoitov 写道:
> On Sun, Jun 26, 2016 at 11:20:52AM +0000, He Kuang wrote:
>> This patchset is based on Wang Nan's v1:
>> http://thread.gmane.org/gmane.linux.kernel/2203717/focus=2203707
>>
>> """
>> This patch set allows to perf invoke some user space BPF scripts on
>> some point. uBPF scripts and kernel BPF scripts reside in one BPF
>> object. They communicate with each other with BPF maps. uBPF
>> scripts can invoke helper functions provided by perf.
>>
>> At least following new features can be achieved based on uBPF
>> support:
>>
>> 1) Report statistical result:
>>
>> Like DTrace, perf print statistical report before quit. No need
>> to extract data using 'perf report'. Statistical method is
>> controled by user.
>>
>> 2) Control perf's behavior:
>>
>> Dynamically adjust period of different events. Policy is defined
>> by user.
>> """
>>
>> and modified by following the reviewers' suggestions.
>>
>> v1-v2:
>>
>> - Split bpf vm part out of kernel/bpf/core.c and link to it instead
>> of using ubpf library(Suggested by Alexei Starovoitov). And add
>> runtime bounds check just like ubpf library does.
> hmm. I don't think I suggested to hack bpf/core.c into separate file
> and compile it for userspace...
"""
Also ubpf was written from scratch with apache2, while perf is gpl,
so you can just link kernel/bpf/core.o directly instead of using external
libraries.
"""
This is your comment on ubpf v1 thread.
I thought you was suggesting to use code in kernel/bpf/core.o,
but because there're difference in __bpf_prog_run() between userspace
and kernel, for example the __bpf_call_base is used in kernel,
in userspace we get funcs from ubpf function list, we have to modify
the existing code in kernel/bpf/core.c.
I've got the source code of 'bcc' project, but it seems that bcc does not
involve bpf virtual machine, so if we do not use 'kernel/bpf/core.o' solution,
and can't use 'ubpf' because of the license reason, any other choices?
Thank you.
> Also I think the prior experience taught us that sharing code between
> kernel and user space will have lots of headaches long term.
> I think it makes more sense to use bcc approach. Just have c+py
> or c+lua or c+c. llvm has x86 backend too. If you integrate
> clang/llvm (bcc approach) you can compile different functions with
> different backends... if you don't want to embed the compiler,
> have two .c files. Compile one for bpf target and another for native.
>
>
next prev parent reply other threads:[~2016-06-27 2:12 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-26 11:20 [RFC PATCH v2 00/26] perf tools: Support uBPF script He Kuang
2016-06-26 11:20 ` [RFC PATCH v2 01/26] tools include: Adopt byte ordering macros from byteorder/generic.h He Kuang
2016-06-26 11:20 ` [RFC PATCH v2 02/26] tools include: Fix wrong macro definitions for cpu_to_le* for big endian He Kuang
2016-06-26 11:20 ` [RFC PATCH v2 03/26] bpf: split __bpf_prog_run code into new file He Kuang
2016-06-26 11:20 ` [RFC PATCH v2 04/26] bpf: extract jmp and default handler and introduce UBPF_BUILD flag He Kuang
2016-06-26 11:20 ` [RFC PATCH v2 05/26] tools include: Sync math64.h and div64.h He Kuang
2016-06-26 21:08 ` Nilay Vaish
2016-06-27 2:21 ` Hekuang
2016-06-27 18:13 ` Arnaldo Carvalho de Melo
2016-06-26 11:20 ` [RFC PATCH v2 06/26] tools include: Add (atomic|atomic64)_add implementation from the kernel sources He Kuang
2016-06-26 11:20 ` [RFC PATCH v2 07/26] perf bpf: Add map related BPF helper He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 08/26] perf bpf: Add UBPF flags and makefile options He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 09/26] perf bpf: Implement empty instruction handler and build bpf-vm He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 10/26] perf bpf: Remove unused code in libbpf He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 11/26] perf bpf: Store arbitrary entries instread fd array in bpf_program He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 12/26] perf bpf: Add libbpf-internal.h header file He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 13/26] perf bpf: Add abstraction for bpf program methods He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 14/26] perf bpf: Add -Wextra to cflags for more warnings and fix them He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 15/26] perf bpf: Introduce the entity and engine for userspace bpf He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 16/26] perf bpf: Add method for fetching nth ubpf vm He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 17/26] perf bpf: Add methods to set/check ubpf engine for bpf programs He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 18/26] perf bpf: Add ubpf helper function slots and set/get methods He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 19/26] perf tools: Register basic uBPF helpers He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 20/26] perf bpf: Accept uBPF programs He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 21/26] bpf: Support bpf load/store boundary check for ubpf He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 22/26] perf bpf: Implement boundary check code in ubpf He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 23/26] perf record: Add uBPF hooks at beginning and end of perf record He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 24/26] perf bpf: Fillup bpf jmp_call handler He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 25/26] perf bpf: Implement run_ubpf_program He Kuang
2016-06-26 11:21 ` [RFC PATCH v2 26/26] perf tests: Add uBPF test case He Kuang
2016-06-26 20:48 ` [RFC PATCH v2 00/26] perf tools: Support uBPF script Alexei Starovoitov
2016-06-27 2:10 ` Hekuang [this message]
2016-06-28 11:47 ` Hekuang
2016-06-28 14:57 ` Alexei Starovoitov
2016-06-29 10:15 ` Hekuang
2016-06-29 10:35 ` Wangnan (F)
2016-06-29 12:37 ` Alexei Starovoitov
2016-06-29 13:03 ` pi3orama
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57708B22.7030406@huawei.com \
--to=hekuang@huawei.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=brendan.d.gregg@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).