From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752502AbbJSLVd (ORCPT ); Mon, 19 Oct 2015 07:21:33 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34466 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbbJSLVb (ORCPT ); Mon, 19 Oct 2015 07:21:31 -0400 Date: Mon, 19 Oct 2015 13:21:26 +0200 From: Ingo Molnar To: Adrian Hunter Cc: Peter Zijlstra , Arnaldo Carvalho de Melo , Andy Lutomirski , Thomas Gleixner , linux-kernel@vger.kernel.org, Stephane Eranian , Andi Kleen Subject: Re: [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page Message-ID: <20151019112126.GA32722@gmail.com> References: <1445001845-13688-1-git-send-email-adrian.hunter@intel.com> <1445001845-13688-2-git-send-email-adrian.hunter@intel.com> <20151019080852.GA24924@gmail.com> <5624ADF8.3090505@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5624ADF8.3090505@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Adrian Hunter wrote: > On 19/10/15 11:08, Ingo Molnar wrote: > > > > * Adrian Hunter wrote: > > > >> Commit b20112edeadf ("perf/x86: Improve accuracy of perf/sched clock") > >> allowed the time_shift value in perf_event_mmap_page to be as much > >> as 32. Unfortunately the documented algorithms for using time_shift > >> have it shifting an integer, whereas to work correctly with the value > >> 32, the type must be u64. > >> > >> Fix by limiting the shift to 31 and adjusting the multiplier accordingly. > >> > >> Also update the documentation of perf_event_mmap_page so that new code > >> based on it will be more future-proof. > >> > >> Fixes: b20112edeadf ("perf/x86: Improve accuracy of perf/sched clock") > >> Signed-off-by: Adrian Hunter > > > > Would be nice to point out via what symptoms the code misbehaves and how users > > notice. > > In the case of perf tools, Intel PT decodes correctly but the timestamps > that are output (for example by perf script) have lost 32-bits of > granularity so they look like they are not changing at all. Sounds like a nice and very informative paragraph to add to the changelog! :-) Thanks, Ingo