From: Ingo Molnar <mingo@kernel.org>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: pi3orama <pi3orama@163.com>, "Wangnan (F)" <wangnan0@huawei.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Brendan Gregg <brendan.d.gregg@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
David Ahern <dsahern@gmail.com>, He Kuang <hekuang@huawei.com>,
Jiri Olsa <jolsa@redhat.com>, Kaixu Xia <xiakaixu@huawei.com>,
Madhavan Srinivasan <maddy@linux.vnet.ibm.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
Zefan Li <lizefan@huawei.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: [GIT PULL 0/6] perf/core improvements and fixes
Date: Fri, 5 Jun 2015 08:41:14 +0200 [thread overview]
Message-ID: <20150605064114.GA18341@gmail.com> (raw)
In-Reply-To: <55707B3F.2070704@plumgrid.com>
* Alexei Starovoitov <ast@plumgrid.com> wrote:
> 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
There's no confusion here: you guys are trying to sell me what at this stage is
incomplete and hard to use, and I'm resisting it as I should! :-)
We also have different definitions of 'easily'. It might be 'easy' to type:
clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
... for some tooling developer intimate with eBPF, but to the first time user who
found an interesting looking eBPF scriptlet on the net or in the documentation and
wants to try his luck? It's absolutely non-obvious!
The current usage to get a _minimal_ eBPF script running is non-obvious and
obscure to the level of being a show stopper.
I don't understand why you guys are even wasting time arguing about it: it's not
that hard to auto-build from source code. It's one of the basic features of
tooling. If you ever built perf you'll know that typing 'make install' will type
in all those quirky build lines automatically for you, without requiring you to
perform any other step, no matter how trivial.
Doubly annoying, you seem to have the UI principles wrong, you seem to think that
a .o is a proper user interface. It absolutely is _not_ okay.
The Linux kernel project and as an extension the perf project deals with source
code, and I'm 100% suspicious of approaches that somehow think that .o objects are
the right UI for _anything_ except temporary files that sometimes show up in
object directories...
Fix the 'newbie user' UI flow as a _first_ priority, not as a second thought!
Every single quirky line or nonsensical option you require a first time user to
type halves the number of new users we'll get. You need to understand why dtrace
is so popular:
- it's bloody easy to use
- it's a safe environment you can deploy in critical environments
- it's flexible
- instrumentation hacks are very easy to share
eBPF based scripting got 3 out of those 4 right, but please don't forget item 1
either, because without that we have nothing but a bunch of unusable functionality
in the kernel and in tooling that benefits only very few people. Okay?
> So I think we need to support both 'perf record -e file.[co]'
Why do you even need to ask? Of course!
Think through how users will meet eBPF scripts and how they will interact with
them:
- they'll see or download an eBPF scriptlet somewhere and will have a .c file.
- ideally there will be built-in eBPF scriptlets just like we have tracing
plugins, and there's a good UI to query them and see their description and
source code.
- then they will want to use it all with the minimum amount of fuss
- they don't care how the eBPF scriptlet gets to the kernel: whether the kernel
can read and build the .c files, or whether there's some user tooling that
turns it into bytecode. Most humans don't read bytecode!
- they will absolutely not download random .o's and we should not encourage that
in any case - these things should be source code based.
These things compile in an eye blink, there's very little reason to ever deal with
a .o, except some weird and rare usecases...
In fact I'm NAK-ing the whole .o based interface until the .c interface is made
the _primary_ one and works well and until I see that you have thought through
basic usability questions...
Thanks,
Ingo
next prev parent reply other threads:[~2015-06-05 6:41 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 22:40 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-06-03 22:40 ` [PATCH 1/6] perf probe: Fix segfault when glob matching function without debuginfo Arnaldo Carvalho de Melo
2015-06-03 22:40 ` [PATCH 2/6] perf tools: Remove newline char when reading event scale and unit Arnaldo Carvalho de Melo
2015-06-03 22:40 ` [PATCH 3/6] perf machine: Fix the search for the kernel DSO on the unified list Arnaldo Carvalho de Melo
2015-06-03 22:40 ` [PATCH 4/6] perf tools: Move linux/kernel.h to tools/include Arnaldo Carvalho de Melo
2015-06-03 22:40 ` [PATCH 5/6] tools: Move tools/perf/util/include/linux/{list.h,poison.h} " Arnaldo Carvalho de Melo
2015-06-03 22:40 ` [PATCH 6/6] perf tools: Deal with kernel module names in '[]' correctly Arnaldo Carvalho de Melo
2015-06-04 5:48 ` [GIT PULL 0/6] perf/core improvements and fixes Ingo Molnar
2015-06-04 6:07 ` Wangnan (F)
2015-06-04 7:21 ` Ingo Molnar
2015-06-04 10:00 ` Wangnan (F)
2015-06-04 12:40 ` Ingo Molnar
2015-06-04 12:58 ` pi3orama
2015-06-04 14:04 ` Ingo Molnar
2015-06-04 16:22 ` Alexei Starovoitov
2015-06-04 21:48 ` Masami Hiramatsu
2015-06-04 22:07 ` Alexei Starovoitov
2015-06-05 6:41 ` Ingo Molnar [this message]
2015-06-05 8:53 ` Wangnan (F)
2015-06-05 12:05 ` Ingo Molnar
2015-06-05 14:06 ` Arnaldo Carvalho de Melo
2015-06-07 13:11 ` Ingo Molnar
2015-06-05 13:59 ` Arnaldo Carvalho de Melo
2015-06-04 10:17 ` [EXPERIENCE] My experience on using perf record BPF filter on a real usecase Wangnan (F)
2015-06-10 6:42 ` Alexei Starovoitov
2015-06-10 6:48 ` Wangnan (F)
-- strict thread matches above, loose matches on Subject: below --
2017-03-16 16:09 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-03-16 16:30 ` Ingo Molnar
2015-08-31 21:36 Arnaldo Carvalho de Melo
2015-09-01 8:26 ` Ingo Molnar
2015-03-31 20:59 Arnaldo Carvalho de Melo
2015-04-01 7:56 ` Ingo Molnar
2015-03-26 15:40 Arnaldo Carvalho de Melo
2015-03-27 7:37 ` Ingo Molnar
2014-05-12 9:27 Jiri Olsa
2014-05-12 15:59 ` Ingo Molnar
2014-04-30 10:11 Jiri Olsa
2014-05-01 6:26 ` Ingo Molnar
2012-10-31 14:48 Arnaldo Carvalho de Melo
2011-04-20 16:23 Arnaldo Carvalho de Melo
2011-04-21 8:58 ` Ingo Molnar
2011-02-16 22:54 Arnaldo Carvalho de Melo
2011-02-17 13:50 ` Ingo Molnar
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=20150605064114.GA18341@gmail.com \
--to=mingo@kernel.org \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@plumgrid.com \
--cc=brendan.d.gregg@gmail.com \
--cc=daniel@iogearbox.net \
--cc=dsahern@gmail.com \
--cc=hekuang@huawei.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=maddy@linux.vnet.ibm.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mpe@ellerman.id.au \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=pi3orama@163.com \
--cc=sukadev@linux.vnet.ibm.com \
--cc=wangnan0@huawei.com \
--cc=xiakaixu@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).