Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754389AbcDNKZM (ORCPT ); Thu, 14 Apr 2016 06:25:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:6036 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754353AbcDNKZJ (ORCPT ); Thu, 14 Apr 2016 06:25:09 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,484,1455004800"; d="scan'208";a="945011311" Subject: Re: [PATCH 03/10] perf record: Turns auxtrace_snapshot_enable into 3 states To: "Wangnan (F)" , 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> <570F5DDA.5010808@huawei.com> Cc: linux-kernel@vger.kernel.org, pi3orama@163.com, He Kuang , Arnaldo Carvalho de Melo , Masami Hiramatsu , Namhyung Kim , Zefan Li From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <570F6F1E.4080801@intel.com> Date: Thu, 14 Apr 2016 13:21:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <570F5DDA.5010808@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2087 Lines: 54 On 14/04/16 12:07, Wangnan (F) wrote: > > > 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. OK, I see. > > 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 > Thanks for the information. Auxtrace really needs complete MMAP information, so I would probably need to look at other options as well. Anyway for this patch: Acked-by: Adrian Hunter