From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754268AbcEYNsA (ORCPT ); Wed, 25 May 2016 09:48:00 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:29155 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbcEYNr7 (ORCPT ); Wed, 25 May 2016 09:47:59 -0400 Subject: Re: [PATCH v5 4/8] perf record: Introduce rec->overwrite_evlist for overwritable events To: References: <1464152623-171824-1-git-send-email-wangnan0@huawei.com> <1464152623-171824-5-git-send-email-wangnan0@huawei.com> <57457B67.1040501@huawei.com> CC: , , He Kuang , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Zefan Li From: "Wangnan (F)" Message-ID: <5745ACF9.7020000@huawei.com> Date: Wed, 25 May 2016 21:47:37 +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: <57457B67.1040501@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.0A090202.5745AD0B.01A5,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: a25b0dadf027afa9385004184c6855d7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/5/25 18:16, Wangnan (F) wrote: > > > On 2016/5/25 13:03, Wang Nan wrote: >> Create an auxiliary evlist for overwritable events. >> >> Before mmap, build this evlist and set 'overwrite' and 'backward' >> attribute. Since perf_evlist__mmap_ex() only maps events when >> evsel->overwrite matches evlist's corresponding attributes, with >> these two evlists an event goes to either rec->evlist or >> rec->overwrite_evlist. >> >> Signed-off-by: Wang Nan >> Cc: He Kuang >> Cc: Arnaldo Carvalho de Melo >> Cc: Jiri Olsa >> Cc: Masami Hiramatsu >> Cc: Namhyung Kim >> Cc: Zefan Li >> Cc: pi3orama@163.com >> --- >> tools/perf/builtin-record.c | 138 >> ++++++++++++++++++++++++++++++++++++-------- >> 1 file changed, 114 insertions(+), 24 deletions(-) >> > > [SNIP] > >> @@ -941,7 +1026,10 @@ static int __cmd_record(struct record *rec, int >> argc, const char **argv) >> err = 0; >> waking++; >> - if (perf_evlist__filter_pollfd(rec->evlist, POLLERR | >> POLLHUP) == 0) >> + active_evts = perf_evlist__filter_pollfd(rec->evlist, >> POLLERR | POLLHUP); >> + active_evts += >> perf_evlist__filter_pollfd(rec->overwrite_evlist, POLLERR | POLLHUP); > > Sorry, before calling filter here should check if > rec->overwrite_evlist is not NULL. > I'll resend this patch with this problem fixed soon. Please ignore the full v5 series and see v6 instead. The final two patches (9/10 and 10/10) in v6 solve the problem. Thank you.