From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755881AbcEYCVY (ORCPT ); Tue, 24 May 2016 22:21:24 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:51136 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753648AbcEYCVW (ORCPT ); Tue, 24 May 2016 22:21:22 -0400 Subject: Re: [PATCH v4 3/7] perf tools: Enable overwrite settings To: Arnaldo Carvalho de Melo References: <1464056944-166978-1-git-send-email-wangnan0@huawei.com> <1464056944-166978-4-git-send-email-wangnan0@huawei.com> <20160524184030.GX8897@kernel.org> CC: , , He Kuang , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Zefan Li From: "Wangnan (F)" Message-ID: <57450A75.3010403@huawei.com> Date: Wed, 25 May 2016 10:14:13 +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: <20160524184030.GX8897@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.0A020201.57450A92.0093,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b8c7d868ff78d61c3fd64bf02ddce34f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/5/25 2:40, Arnaldo Carvalho de Melo wrote: > Em Tue, May 24, 2016 at 02:29:00AM +0000, Wang Nan escreveu: >> This patch allows following config terms and option: >> >> Globally setting events to overwrite; >> >> # perf record --overwrite ... >> >> Set specific events to be overwrite or no-overwrite. >> >> # perf record --event cycles/overwrite/ ... >> # perf record --event cycles/no-overwrite/ ... > So, based on this chunk of documentation in this patch: > > > Perf dumps data from overwritable ring buffer when switching output (see > --switch-output) and before terminate. > > > I tried: > > No --overwrite: > > # perf record -e syscalls:*enter_nanosleep* usleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.019 MB perf.data (1 samples) ] > # perf evlist -v > syscalls:sys_enter_nanosleep: type: 2, size: 112, config: 0x132, { sample_period, sample_freq }: 1, sample_type: IP|TID|TIME|CPU|PERIOD|RAW, disabled: 1, inherit: 1, mmap: 1, comm: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1 > # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events > # perf script > usleep 29416 [002] 220099.782982: syscalls:sys_enter_nanosleep: rqtp: 0x7ffc21f73cc0, rmtp: 0x00000000 > > Now I went on to try this new --overwrite thing: > > # perf record --overwrite -e syscalls:*enter_nanosleep* usleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.019 MB perf.data ] > # perf evlist -v > syscalls:sys_enter_nanosleep: type: 2, size: 112, config: 0x132, { sample_period, sample_freq }: 1, sample_type: IP|TID|TIME|CPU|PERIOD|RAW, disabled: 1, inherit: 1, mmap: 1, comm: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, write_backward: 1 > # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events > # perf script > # > > So it hasn't recorded anything at anytime, i.e. I expected, based on the > documentation provided, that it would get what was in its buffer, to be written, > i.e. the single "syscalls:sys_enter_nanosleep" event that took place in that > workload. > > So I'm now trying it together with --switch-output, but I just get one > timestamp suffixed perf.data file, empty, without that event that I know took > place. > > Care to ellaborate here? Sorry, you need to apply patch 3/7 - 5/7 to enable operations described here. I'll reorder these patches and send again, but some important patch would become untestable until patch 3/7 get applied. I'll try to add a test case for them. Thank you.