Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754634AbbERTir (ORCPT ); Mon, 18 May 2015 15:38:47 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:33171 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754495AbbERTip (ORCPT ); Mon, 18 May 2015 15:38:45 -0400 Message-ID: <555A3FC2.8060805@plumgrid.com> Date: Mon, 18 May 2015 12:38:42 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Wang Nan , paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, jolsa@kernel.org, dsahern@gmail.com, daniel@iogearbox.net, brendan.d.gregg@gmail.com, masami.hiramatsu.pt@hitachi.com CC: lizefan@huawei.com, linux-kernel@vger.kernel.org, pi3orama@163.com Subject: Re: [RFC PATCH v3 00/37] perf tools: introduce 'perf bpf' command to load eBPF programs. References: <1431860222-61636-1-git-send-email-wangnan0@huawei.com> In-Reply-To: <1431860222-61636-1-git-send-email-wangnan0@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2027 Lines: 50 On 5/17/15 3:56 AM, Wang Nan wrote: > This is the 3rd version of 'perf bpf' patch series, based on > v4.1-rc3. > > The goal of this series of patches is to integrate eBPF with perf. > After applying these patches, users are allowed to use following > command to load eBPF program compiled by LLVM into kernel then start > recording with filters on: > > # perf bpf record --object sample_bpf.o -- -a sleep 4 I think using programs are sophisticated filters is a good start and are useful already. Let's focus on that at the moment. I wouldn't grow the patchset any bigger. > Other than the previous change, v3 patch series drops the '|' event > syntax introduced in v2, because I realized that in v2 users are > allowed to pass any bpf fd by using it, like: > > # perf bpf record -- -e sched:sched_switch|100| sleep 1 > > which may become trouble maker. passing fd number as a string is an odd interface anyway. So I think that was the right call. We can improve it later. > Are we actually need a 'perf bpf' command? We can get similar result by > modifying 'perf record' to make it load eBPF program before recording. > > I suggest to keep 'perf bpf', group all eBPF stuffs together using a > uniform entry. Also, eBPF programs can act not only as filters but also > data aggregator. It is possible to make something link 'perf bpf run' > to simply make it run, and dump result after user hit 'C-c' or timeout. Though it's tempting to group under 'perf bpf'. I think it's cleaner to add --object flag to 'perf record' Since it will avoid unnecessary '--'. Unless we can drop it? Like perf bpf record --object sample_bpf.o -a sleep 4 should work? If not, then the following is better: perf record --object sample_bpf.o -a sleep 4 Thank you for the hard work! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/