From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762401AbcALOOq (ORCPT ); Tue, 12 Jan 2016 09:14:46 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:35927 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762085AbcALOOi (ORCPT ); Tue, 12 Jan 2016 09:14:38 -0500 Date: Tue, 12 Jan 2016 15:14:30 +0100 From: Peter Zijlstra To: Wang Nan Cc: acme@kernel.org, linux-kernel@vger.kernel.org, pi3orama@163.com, lizefan@huawei.com, netdev@vger.kernel.org, davem@davemloft.net, Adrian Hunter , Arnaldo Carvalho de Melo , David Ahern , Ingo Molnar , Yunlong Song Subject: Re: [PATCH 27/53] perf/core: Put size of a sample at the end of it by PERF_SAMPLE_TAILSIZE Message-ID: <20160112141430.GH6357@twins.programming.kicks-ass.net> References: <1452520124-2073-1-git-send-email-wangnan0@huawei.com> <1452520124-2073-28-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452520124-2073-28-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2016 at 01:48:18PM +0000, Wang Nan wrote: > Before reading such ring buffer, perf must ensure all events which may > output to it is already stopped, so the 'head' pointer it get is the > end of the last record. We could add an extra ioctl() to pause/resume ring-buffer output to make this more convenient to achieve. Say replace the !rb->nr_pages test in perf_output_begin() with a control variable load and ensure its set to pause/fail when !nr_pages. That way we only have to issue a single ioctl to freeze the buffer, without adding extra instructions/loads to the fast path.