Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754678AbcDNJIT (ORCPT ); Thu, 14 Apr 2016 05:08:19 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:21021 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754525AbcDNJIH (ORCPT ); Thu, 14 Apr 2016 05:08:07 -0400 Subject: Re: [PATCH 03/10] perf record: Turns auxtrace_snapshot_enable into 3 states To: Adrian Hunter , Arnaldo Carvalho de Melo References: <1460535673-159866-1-git-send-email-wangnan0@huawei.com> <1460535673-159866-4-git-send-email-wangnan0@huawei.com> <20160413155533.GG9056@kernel.org> <570F4393.6080908@intel.com> <570F4BAE.7090808@huawei.com> <570F5541.50407@intel.com> CC: , , He Kuang , Arnaldo Carvalho de Melo , "Masami Hiramatsu" , Namhyung Kim , Zefan Li From: "Wangnan (F)" Message-ID: <570F5DDA.5010808@huawei.com> Date: Thu, 14 Apr 2016 17:07:38 +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: <570F5541.50407@intel.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.570F5DED.0041,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: f95258d79397c217f781b041866c707b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1761 Lines: 43 On 2016/4/14 16:30, Adrian Hunter wrote: > On 14/04/16 10:50, Wangnan (F) wrote: >> >> On 2016/4/14 15:15, Adrian Hunter wrote: >>> On 13/04/16 18:55, Arnaldo Carvalho de Melo wrote: >>>> Em Wed, Apr 13, 2016 at 08:21:06AM +0000, Wang Nan escreveu: >>>>> auxtrace_snapshot_enable has only two states (0/1). Turns it into a >>>>> triple states enum so SIGUSR2 handler can safely do other works without >>>>> triggering auxtrace snapshot. >>>> Adrian, can you take a look at this? Is it ok with you? >>> Please forgive me if these are stupid questions: >>> >>> First I am wondering why we wouldn't want to snapshot auxtrace data at the >>> same time as the perf buffer? >> This patch doesn't prevent taking snapshot when receiving SIGUSR2. > So it was a stupid question ;-) Still thank you for pointing this. I suddenly realized the 'switch_output_started' in patch 5/10 is also need to be turned to a 3 state enum. If not, a SIGUSR2 incorrectly triggers output switching even '--switch-output' is not provided when '--snapshot' exist. > >> If both --snapshot and --switch-outupt is provided, when SIGUSR2 received, >> perf takes auxtrace snapshot and other perf buffer together. > How do you keep from losing tracking information like MMAP events? Are they > is a different buffer? Please see patch 8/10 and 9/10. MMAP events are resynthesized each time when output file switched, so at the *head* of each 'perf.data' you can find many MMAP/COMM/FORK... events. After overwritable ring buffer is supported, there is a more aggresive patch [1] resynthesize tracking events and put them at the *end* of perf.data. [1] https://git.kernel.org/cgit/linux/kernel/git/pi3orama/linux.git/commit/?h=perf/overwrite&id=747e10300397b9c28b01bca5bfad943c8cf2dcce