From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933069AbdKAOWd (ORCPT ); Wed, 1 Nov 2017 10:22:33 -0400 Received: from mga11.intel.com ([192.55.52.93]:37547 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932989AbdKAOWa (ORCPT ); Wed, 1 Nov 2017 10:22:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,329,1505804400"; d="scan'208";a="1212848191" From: "Liang, Kan" To: "Wangnan (F)" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "jolsa@redhat.com" , "namhyung@kernel.org" Subject: RE: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming Thread-Topic: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming Thread-Index: AQHTUtXjmvz/TzQAiEGw/aBsqZxELKL/ejLw//+O7QCAAIbtsA== Date: Wed, 1 Nov 2017 14:22:27 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537DC27E@SHSMSX103.ccr.corp.intel.com> References: <20171101055327.141281-1-wangnan0@huawei.com> <20171101055327.141281-3-wangnan0@huawei.com> <37D7C6CF3E00A74B8858931C1DB2F077537DC1C0@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjJhMDE0NGUtYTkzOS00MGE0LWJiOGQtNWRlOWM1NzIwZDI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlhVeGxxVXNiWWZXVE9JV0Y1KzRJMklmXC9PM1JGOGRYYzdoMDBoMEVOdjVZPSJ9 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 vA1EMa6J003826 > 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. /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. Thanks, Kan