From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754686AbdKAOod (ORCPT ); Wed, 1 Nov 2017 10:44:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:44649 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751853AbdKAOob (ORCPT ); Wed, 1 Nov 2017 10:44:31 -0400 Subject: Re: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming To: "Liang, Kan" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "jolsa@redhat.com" , "namhyung@kernel.org" References: <20171101055327.141281-1-wangnan0@huawei.com> <20171101055327.141281-3-wangnan0@huawei.com> <37D7C6CF3E00A74B8858931C1DB2F077537DC1C0@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F077537DC27E@SHSMSX103.ccr.corp.intel.com> From: "Wangnan (F)" Message-ID: <24733178-7c63-2841-13e7-d4c68ae7efe2@huawei.com> Date: Wed, 1 Nov 2017 22:44:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077537DC27E@SHSMSX103.ccr.corp.intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.194.139] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/11/1 22:22, Liang, Kan wrote: >> On 2017/11/1 21:26, Liang, Kan wrote: >>>> The meaning of perf record's "overwrite" option and many "overwrite" >>>> in source code are not clear. In perf's code, the 'overwrite' has 2 meanings: >>>> 1. Make ringbuffer readonly (perf_evlist__mmap_ex's argument). >>>> 2. Set evsel's "backward" attribute (in apply_config_terms). >>>> >>>> perf record doesn't use meaning 1 at all, but have a overwrite >>>> option, its real meaning is setting backward. >>>> >>> I don't understand here. >>> 'overwrite' has 2 meanings. perf record only support 1. >>> It should be a bug, and need to be fixed. >> Not a bug, but ambiguous. >> >> Perf record doesn't need overwrite main channel (we have two channels: >> evlist->mmap is main channel and evlist->backward_mmap is backward >> evlist->channel), >> but some testcases require it, and your new patchset may require it. >> 'perf record --overwrite' doesn't set main channel overwrite. What it does is >> moving all evsels to backward channel, and we can move some evsels back to >> the main channel by /no-overwrite/ setting. This behavior is hard to >> understand. >> > As my understanding, the 'main channel' should depends on what user sets. > If --overwrite is applied, then evlist->backward_mmap should be the > 'main channel'. evlist->overwrite should be set to true as well. Then it introduces a main channel switching mechanism, and we need checking evlist->overwrite and another factor to determine which one is the main channel. Make things more complex. > /no-overwrite/ setting is per-event setting. > Only when we finish the global setting, then the per-event setting will be > considered. You may refer to apply_config_terms. Yes. > Thanks, > Kan > > > >