From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754231Ab3KNOpA (ORCPT ); Thu, 14 Nov 2013 09:45:00 -0500 Received: from merlin.infradead.org ([205.233.59.134]:56165 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754030Ab3KNOox (ORCPT ); Thu, 14 Nov 2013 09:44:53 -0500 Date: Thu, 14 Nov 2013 15:44:44 +0100 From: Peter Zijlstra To: David Ahern Cc: Ingo Molnar , Joseph Schuchart , Fr??d??ric Weisbecker , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , thomas.ilsche@tu-dresden.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Perf: Correct Assumptions about Sample Timestamps in Passes Message-ID: <20131114144444.GK16796@laptop.programming.kicks-ass.net> References: <528484CB.7@tu-dresden.de> <20131114083930.GC16543@gmail.com> <528490DE.4080204@tu-dresden.de> <20131114100552.GA5064@gmail.com> <5284DD7E.30604@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5284DD7E.30604@gmail.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 Thu, Nov 14, 2013 at 07:26:06AM -0700, David Ahern wrote: > On 11/14/13, 3:05 AM, Ingo Molnar wrote: > > >What am I missing? > > I have spent quite a bit of time on this problem on this well. I think the > flush time needs to be based on the start time of each round, not the > minimum time observed across mmaps. I have tried the minimum time stamp > route and it still fails often enough to be annoying. > > See builtin-kvm.c, perf_kvm__mmap_read(). The problem is that it takes time > to move from mmap to mmap and sample can come in behind you - an mmap that > has already be scanned with a timestamp less than what is determined to be > the lowest minimum for the samples actually read. 'perf kvm stat live' in a > nested environment is a stress test for the problem. In which case you need the sliding sort window to be n*buf_size, where n is the number of buffers flushed into the one file. Or move to one file per buffer and merge sort the lot, buffers should be monotonic.