Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp376562pxv; Thu, 24 Jun 2021 09:48:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzeWFVCd7p0HmTMWP0iLg9UPps6jrcGnP02ThnYT/RFVJ0WIk6qpEmblHpzI28BnzfzhI9 X-Received: by 2002:a05:6402:50c6:: with SMTP id h6mr2297507edb.296.1624553295009; Thu, 24 Jun 2021 09:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624553295; cv=none; d=google.com; s=arc-20160816; b=WNCrliuPK0UH2qx8dfHrnZq6fJqq4QV+XPMpEx9tGEbGGlOiwxaamihDZleFf0WzAR dEdXXavkYPMjUzTKSpJZCgnatrxu+gBJ/gLlcesPGoX/SF8hcAZty3qCFpeqDQKvT5VB fmcgGM1zppUHquOR+CbsoaRzZBIoT1aNFQDEf7Z/QopXQihr2EE0DZcPHliOjzFvVAHi NkGT8NCV18399HXPc6kCbLAhD3V9gcTYH548tjxN9fz7UNoMA50pdJ7SHCUD7oDBHOes BfKSJCdIjE2oyYWzp8y0PK3PpKwZD5TFhKVLoyAKLBNOYoAeBYzhfwUs5Y5PCkD9SZOz f3kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=W1wXJGQFtx3bAOHxHuIjT8AIDJtWTFlifrDIOfBzdWg=; b=O6T9H0kwYCJKYZEHh9Df8FpEt65U5myA2V96V0nSHry/lLkisBS0TnRfTg0+sTN0OW MKCkg/nW+qEUYfwrbVU8aaG0HiBLFnzNT1RMh4SnMVLZ2gxNvbXfWRExpYSddm5qFBZQ gX584/tAuYOcLb+4r+mr9l7FQmXgaT7wTx85gg/x+MUoGDKTz2SLU0zP3Kd/xqjJbwHB ygwG4IpB+PMG+VhGske6ePrRmjmRA8SFgIwm5FJEnZ1vfFeJrygWDxPhc35RdMVgZVkY EADS3OqItwOZf584chgRYjNW2yu1OLotv2HPfKtrc9aqO6SpMkBUXc0GwSpxht3Q2bzX 5Q1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si3299845ejt.588.2021.06.24.09.47.50; Thu, 24 Jun 2021 09:48:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231878AbhFXQs6 (ORCPT + 99 others); Thu, 24 Jun 2021 12:48:58 -0400 Received: from foss.arm.com ([217.140.110.172]:34092 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbhFXQsz (ORCPT ); Thu, 24 Jun 2021 12:48:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 23092ED1; Thu, 24 Jun 2021 09:46:36 -0700 (PDT) Received: from [10.57.13.86] (unknown [10.57.13.86]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B88E03F719; Thu, 24 Jun 2021 09:46:33 -0700 (PDT) Subject: Re: [PATCH v1 3/3] perf cs-etm: Remove callback cs_etm_find_snapshot() To: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org References: <20210528161552.654907-1-leo.yan@linaro.org> <20210528161552.654907-4-leo.yan@linaro.org> From: James Clark Message-ID: <4aa2cfcc-0dc2-4884-2ae4-7e977d3c60ad@arm.com> Date: Thu, 24 Jun 2021 17:46:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210528161552.654907-4-leo.yan@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/05/2021 17:15, Leo Yan wrote: > The callback cs_etm_find_snapshot() is invoked for snapshot mode, its > main purpose is to find the correct AUX trace data and returns "head" > and "old" (we can call "old" as "old head") to the caller, the caller > __auxtrace_mmap__read() uses these two pointers to decide the AUX trace > data size. > > cs_etm_find_snapshot() should be removed with below reasons: > > - The first thing in cs_etm_find_snapshot() is to check if the head has > wrapped around, if it is not, directly bails out. The checking is > pointless, this is because the "head" and "old" pointers both are > monotonical increasing so they never wrap around. > For patch 3: Reviewed-by: James Clark Tested-by: James Clark I think it's a good simplification and it also fixes the duplicate buffers issue. And I agree with the reasoning about the pointer increasing monotonically.