From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933200AbbFJGmT (ORCPT ); Wed, 10 Jun 2015 02:42:19 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34377 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116AbbFJGmL (ORCPT ); Wed, 10 Jun 2015 02:42:11 -0400 Message-ID: <5577DC40.9020801@plumgrid.com> Date: Tue, 09 Jun 2015 23:42:08 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Wangnan (F)" , Ingo Molnar , Arnaldo Carvalho de Melo CC: linux-kernel@vger.kernel.org, Adrian Hunter , Brendan Gregg , Daniel Borkmann , David Ahern , He Kuang , Jiri Olsa , Kaixu Xia , Madhavan Srinivasan , Masami Hiramatsu , Michael Ellerman , Namhyung Kim , Peter Zijlstra , pi3orama@163.com, 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> In-Reply-To: <557025A2.6090903@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?