From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758763AbcBYEMI (ORCPT ); Wed, 24 Feb 2016 23:12:08 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:37988 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758126AbcBYEMG (ORCPT ); Wed, 24 Feb 2016 23:12:06 -0500 Subject: Re: [RFC PATCH 2/2] perf script: Print bpf-output events in 'perf script' To: Arnaldo Carvalho de Melo References: <1456312845-111583-1-git-send-email-wangnan0@huawei.com> <1456312845-111583-3-git-send-email-wangnan0@huawei.com> <20160224151918.GC8720@kernel.org> CC: , , "Arnaldo Carvalho de Melo" , Brendan Gregg , "Masami Hiramatsu" , Namhyung Kim , Li Zefan , From: "Wangnan (F)" Message-ID: <56CE7EDF.7030808@huawei.com> Date: Thu, 25 Feb 2016 12:11:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160224151918.GC8720@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.56CE7F09.00AC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 36da6a244fdcebe556d4f303a0bb3ceb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/2/24 23:19, Arnaldo Carvalho de Melo wrote: > Em Wed, Feb 24, 2016 at 11:20:45AM +0000, Wang Nan escreveu: >> This patch allows 'perf script' output messages from BPF program. >> For example, use test_bpf_output_3.c at the end of this commit >> message, >> >> # ./perf record -e bpf-output/no-inherit,name=evt/ \ >> -e ./test_bpf_output_3.c/map:channel.event=evt/ \ >> usleep 100000 > Trying to test this with 'perf trace', i.e. to shortcircuit record + > analysis: > > [root@jouet bpf]# perf trace -a --ev bpf-output/no-inherit,name=evt/ --ev ./test_bpf_output_3.c/map:channel.event=evt/ --ev 'perf_bpf_probe:*' usleep 100000 > Failed to set filter "common_pid != 23954" on event evt with 22 (Invalid argument) > > Can't we set tracepoint filters on these events? No we can't. filters can only be set to tracepoint events, but bpf-output is a software event. In addition, you don't need ... --ev 'perf_bpf_probe:*' ... because they should be already collected by '--ev ./test_bpf_output_3.c'. You don't see them because the two kprobe events are filtered out by BPF program. See 'return 0' in func. Thank you.