From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755524AbdKBNZS (ORCPT ); Thu, 2 Nov 2017 09:25:18 -0400 Received: from mga02.intel.com ([134.134.136.20]:54694 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbdKBNZQ (ORCPT ); Thu, 2 Nov 2017 09:25:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,334,1505804400"; d="scan'208";a="916690030" From: "Liang, Kan" To: Namhyung Kim CC: "Wangnan (F)" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "jolsa@redhat.com" , "kernel-team@lge.com" Subject: RE: [PATCH 1/2] perf mmap: Fix perf backward recording Thread-Topic: [PATCH 1/2] perf mmap: Fix perf backward recording Thread-Index: AQHTUtXZD2mToCc3eE2DfG6L0BK9oqL+waOAgAAMHQCAABhjgIAAAv2AgACe3VD//6SfgIAAhoEggABZf4CAAPqusA== Date: Thu, 2 Nov 2017 13:25:08 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537DC909@SHSMSX103.ccr.corp.intel.com> References: <20171101055327.141281-1-wangnan0@huawei.com> <20171101055327.141281-2-wangnan0@huawei.com> <20171101094929.GB25146@danjae.aot.lge.com> <20171101120007.GA26623@danjae.aot.lge.com> <109f02ef-5dc2-94f9-e850-572c498781ee@huawei.com> <37D7C6CF3E00A74B8858931C1DB2F077537DC1FA@SHSMSX103.ccr.corp.intel.com> <226626ec-4f96-d3f4-a6d5-62c17c897f32@huawei.com> <37D7C6CF3E00A74B8858931C1DB2F077537DC3EF@SHSMSX103.ccr.corp.intel.com> <20171102053405.GA23303@sejong> In-Reply-To: <20171102053405.GA23303@sejong> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWM4MDJmMjctOWU5YS00NTIyLThhN2UtNmY4YjEwMmViODc2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IklGQU9UdVJ6bG5DUDVPUno4b0lxUkQ2TUJ3VjVSejRsM3ZGeG5Pc0pObXM9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vA2DPLgc002385 Hi Namhyung, > On Wed, Nov 01, 2017 at 04:22:53PM +0000, Liang, Kan wrote: > > > On 2017/11/1 21:57, Liang, Kan wrote: > > > >> On 2017/11/1 20:00, Namhyung Kim wrote: > > > >>> On Wed, Nov 01, 2017 at 06:32:50PM +0800, Wangnan (F) wrote: > > > > There are only four test cases which set overwrite, > > > > sw-clock,task-exit, mmap-basic, backward-ring-buffer. > > > > Only backward-ring-buffer is 'backward overwrite'. > > > > The rest three are all 'forward overwrite'. We just need to set > > > > write_backward to convert them to 'backward overwrite'. > > > > I think it's not hard to clean up. > > > > > > If we add a new rule that overwrite ring buffers are always backward > > > then it is not hard to cleanup. However, the support of forward > > > overwrite ring buffer has a long history and the code is not written > > > by me. I'd like to check if there is some reason to keep support this > configuration? > > > > > > > As my observation, currently, there are no perf tools which support > > 'forward overwrite'. > > There are only three test cases (sw-clock, task-exit, mmap-basic) > > which is set to 'forward overwrite'. I don’t see any reason it cannot > > be changed to 'backward overwrite' > > > > Arnaldo? Jirka? Kim? > > > > What do you think? > > I think sw-clock, task-exit and mmap-basic test cases can be changed to use > the forward non-overwrite mode. > > The forward overwrite might be used by externel applications accessing the > ring buffer directly but not needed for perf tools IMHO. The proposal is only for perf tool, not kernel. So external applications can still use forward overwrite to access the ring buffer. > Let's keep the code simpler as much as possible. Agree. Now, there are too many options to access the ring buffer. Not all of them are supported. I think we should only keep the crucial options (overwrite/non-overwrite), clearly define them in the document and cleanup the code. Also, perf record doesn't use the generic interface (e.g. perf_evlist__mmap*) as other tools to access ring buffer. Because the generic interface is hardcoded to only support forward non-overwrite. We should cleanup it as well. But that could be done later separately. Thanks, Kan