Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933366AbbFJGtD (ORCPT ); Wed, 10 Jun 2015 02:49:03 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:63545 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932533AbbFJGsy (ORCPT ); Wed, 10 Jun 2015 02:48:54 -0400 Message-ID: <5577DDAE.5090307@huawei.com> Date: Wed, 10 Jun 2015 14:48:14 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Alexei Starovoitov , Ingo Molnar , Arnaldo Carvalho de Melo CC: , Adrian Hunter , Brendan Gregg , Daniel Borkmann , David Ahern , He Kuang , Jiri Olsa , Kaixu Xia , Madhavan Srinivasan , Masami Hiramatsu , Michael Ellerman , Namhyung Kim , Peter Zijlstra , , Sukadev Bhattiprolu , Zefan Li , "Arnaldo Carvalho de Melo" Subject: Re: [EXPERIENCE] My experience on using perf record BPF filter on a real usecase References: <1433371238-14572-1-git-send-email-acme@kernel.org> <20150604054854.GA10969@gmail.com> <556FEB32.8040909@huawei.com> <557025A2.6090903@huawei.com> <5577DC40.9020801@plumgrid.com> In-Reply-To: <5577DC40.9020801@plumgrid.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1508 Lines: 40 On 2015/6/10 14:42, Alexei Starovoitov wrote: > On 6/4/15 3:17 AM, Wangnan (F) wrote: >> Hi all, >> >> I'd like to share my exprience on using 'perf record' BPF filter in a >> real usecase to show the power and shortcome in my patch series: > > thanks for sharing! > >> Here is another inconvenience. Currently I only concern on write >> syscall issued by iozone. However, without '-a' I'm unable to collect >> information of the locker. If I want to filter sys_{enter,exit}_write >> belong to iozone out using eBPF, I need to implement another function >> like BPF_FUNC_git_comm. Another method is to use perf '--filter' after >> the two events. However it looks strange to use two filter mechanisms >> together. This time I choose to do filtering offline using perf script. > > that doesn't sound clean. > btw, I've been playing for a while with > bpf_get_current_task_info() helper: > https://git.kernel.org/cgit/linux/kernel/git/ast/bpf.git/commit/?id=c5453ffa107ddf95a91920cc947bb8bf9eab16d6 > > I think it's a better mechanism. > The user can get pid only via: > u32 pid = 0; > bpf_get_current_task_info(&pid, sizeof(pid)); > or full pid + comm + future fields via full 'struct bpf_task_info' > Thoughts? > Looks good. Thank you for your information! -- 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/