From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757879AbcBXFGL (ORCPT ); Wed, 24 Feb 2016 00:06:11 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:6407 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbcBXFGH (ORCPT ); Wed, 24 Feb 2016 00:06:07 -0500 Subject: Re: [PATCH 10/48] perf tools: Introduce bpf-output event To: Arnaldo Carvalho de Melo , Peter Zijlstra References: <1456132275-98875-1-git-send-email-wangnan0@huawei.com> <1456132275-98875-11-git-send-email-wangnan0@huawei.com> <20160223174539.GG15284@kernel.org> <56CD0E4A.9080804@huawei.com> <56CD0FC4.3070305@huawei.com> <56CD2B98.4040009@huawei.com> CC: Alexei Starovoitov , Arnaldo Carvalho de Melo , Brendan Gregg , Adrian Hunter , Cody P Schafer , "David S. Miller" , He Kuang , =?UTF-8?Q?J=c3=a9r=c3=a9mie_Galarneau?= , Jiri Olsa , Kirill Smelkov , Li Zefan , Masami Hiramatsu , Namhyung Kim , , From: "Wangnan (F)" Message-ID: <56CD39AC.5020909@huawei.com> Date: Wed, 24 Feb 2016 13:03:40 +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: <56CD2B98.4040009@huawei.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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56CD39CA.00EE,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: fcbe50eb9f0463160382b82d460d6ed0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/2/24 12:03, Wangnan (F) wrote: > > > On 2016/2/24 10:04, Wangnan (F) wrote: >> >> >> On 2016/2/24 9:58, Wangnan (F) wrote: >>> [SNIP] >>> So, there is something strange here: >>>> >>>> if (unlikely(event->oncpu != smp_processor_id())) >>>> return -EOPNOTSUPP; >>>> >>> >> >> All failures have 'event->oncpu == -1' here. I guess we should >> suppress warning in >> this case. But why event->oncpu becomes -1? >> > > For this specific test it is not surprising to see these error > messages. In this test > we create bpf-output channel on 'ls' process only, but the BPF script > is triggered > on all procs (BPF triggering is not related to perf event scheduling). > Trying to > output data through 'ls' specific bpf-output channel should fail if > this 'sys_write' > is not issued by 'ls' or its children. So it is a correct behavior. > > However, I also see them in system wide channel: > > # echo "" > /sys/kernel/debug/tracing/trace > # ./perf record -a -e bpf-output/no-inherit,name=evt/ \ > -e ./test_bpf_output.c/map:channel.event=evt/ > -a > ^C[ perf record: Woken up 0 times to write data ] > [ perf record: Captured and wrote 17.534 MB perf.data (264326 samples) ] > # cat /sys/kernel/debug/tracing/trace | tail > rs:main Q:Reg-582 [000] d..2 4858.711225: : Error: failed to > output: -95 > rs:main Q:Reg-582 [000] d..2 4858.711241: : Error: failed to > output: -95 > gmain-1858 [003] d..2 4858.711436: : Error: failed to > output: -95 > gmain-1858 [003] d..2 4858.711441: : Error: failed to > output: -95 > gmain-1858 [003] d..2 4858.711473: : Error: failed to > output: -95 > rs:main Q:Reg-582 [002] d..2 4858.712215: : Error: failed to > output: -95 > rs:main Q:Reg-582 [002] d..2 4858.712224: : Error: failed to > output: -95 > gmain-1858 [003] d..2 4858.712230: : Error: failed to > output: -95 > rs:main Q:Reg-582 [002] d..2 4858.712235: : Error: failed to > output: -95 > rs:main Q:Reg-582 [002] d..2 4858.712239: : Error: failed to > output: -95 > > System wide events can also be scheduled in and out. If the bpf-output > events > are scheduled out, trying to output data through it causes the above > failure. > I don't think it is a problem. > > Peter, Could you please give some infomation? In which case a system wide > bpf output channel would be scheduled out? > Sorry, I think my brain is not quite well. Actually this is a easy question: all ENOTSUPP results are generated before PERF_EVENT_IOC_ENABLE or after PERF_EVENT_IOC_DISABLE. You saw so many failure messages because it is sys_write, and perf itself needs it. So you can simply ignore these messages. Thank you.