Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2809462ybk; Mon, 18 May 2020 08:25:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyYVjlgRuethY7WS5XzZGJb5ILA/BTy6I51cJqxSdI5WCML5Akqkj4eJzTvcfxcjF4Vjqt X-Received: by 2002:aa7:dc49:: with SMTP id g9mr14357195edu.167.1589815542944; Mon, 18 May 2020 08:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589815542; cv=none; d=google.com; s=arc-20160816; b=JhwflLoOYXUypmyXVMsqERnpsWQID0u+SaA3O/19g+EgfYspDfkXllKpj01ekRJmWH o+hNZEuf2f6MHnvipUeB3tMtisLwGqD0vSPInSnep5iKuprCM1SqLC8A8mI+kYs68Cjo g8tqCvmjFfOz8A3G5wlTny5p6lr+gkp63INkNWGTJ7nIjC8Ci62AL9eyo0iR6A1tJ5DV BEGKT8LkHTbr0wsI8tDzSZN99NE7Tzvv8BajJ7B9LwT17s3hRJMtRlImO2aQrHG/GRm4 dHEtY3wIJzPPpyUTPOMvd9suaNHaTap9lxt8CVDEWTe8r6IfPzGnqG8guGj2y5DbFzDC Y20w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=/HaS0VGvwKKZo+c1KgVtIA1x0dYcpqRG0Gw5Sc4Ij8I=; b=UZkNLZ3z+uGn+H/fBblOjtuY52lL1qNzre6WvC79pqfkGnXKCeeirMZ8Ixo+6j9jVF QNo0dZ/0I1s8XR9g0S72Oy37JCGbc5BRJem0rshVPoP4UksZmqyGD4CqZDYaOb01rC7F +fxHE326UrPGtQztjO4609+UsV68rLMQO5iR06UxDhVgPkElxl/0lvdFNSXmOEraUeU1 HKmMXbnLfTsrmgFVQXz7w44OTX3uWVtCAppmDjx5SuFYh9AZH1DBrYd5t7/JAWkAt4mP tPTaImr4kXYri9ljJ9S1xaeOkaEHwP8HFLQhO3ShJ6eZHgqdbJnelwempQiSszmMkKGJ yJhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ALbu9AKM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si6847089ejj.92.2020.05.18.08.25.18; Mon, 18 May 2020 08:25:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ALbu9AKM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728298AbgERPXz (ORCPT + 99 others); Mon, 18 May 2020 11:23:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbgERPXz (ORCPT ); Mon, 18 May 2020 11:23:55 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C96C061A0C for ; Mon, 18 May 2020 08:23:55 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id fb16so4841559qvb.5 for ; Mon, 18 May 2020 08:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/HaS0VGvwKKZo+c1KgVtIA1x0dYcpqRG0Gw5Sc4Ij8I=; b=ALbu9AKM9aD2Et0awLVWZ7YlF1bR0sagosp8l49E4A1HqakAGlNXhkID6Y0PSlGfmc 64zPOLjdI+IroAOHc78MfQmJf+9976TvBq9m4KworNNxGaz35grRGIK0OIGFyDBw8m// lXAnFxj+/6fWlZo/N527HM9OGQ0DUbA4m8t3r9PLee8feaX7koPcRD5KYi4zUa487tFo Hjtjoxxjw+FwGk6GO6lVk5Lwr+TuR/sQJ8m3rniQZi4ITXNgZMLjsYWGA//zWPtI9zMK m0wM09PLiOvNcwRrlCTHSXFwSweL+uwigBnu5Su6woVU/JD4EPjdV2pdTP2F3S1/H2uT rztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/HaS0VGvwKKZo+c1KgVtIA1x0dYcpqRG0Gw5Sc4Ij8I=; b=LugKD1Ntm4htXncvqypCONNH+2YL/p8767W82RBvWr8gGQUf5GunAZr6KcOzXGr8Wh 4RLKoB+sw+TlVt//k+ITh9LggGHAzoW5pWsBV34I2vVQxJPiNLqqlPdE9BuX70FjRyBt 5AbQ3e/MWpIxIET5JFJ4r1kL6FMK/x2CX4E5xoqrkDfcpdrHq+jsaKKw2xOBzfGOLsWt +R5zInli1WJnF8ZKEBLqaIH7OyYY2tOTRN8Uo3Lko3DX8HeAP/UWHTH+S3Lesvx51juu TCgE2kFplYtR5cgZlQNhISdKLVm/FcFm3CU5GLTF+9tOY2CDP0sfFZ3rQo09OWfJL4Z9 GGmA== X-Gm-Message-State: AOAM532IcH85OYdP+eZ7olpeorGBP1rCklne9DfDBGdfGwcG9rdW2HNV eYHCXEJyd9mRqYuB68cjLLsw3tdOmE4= X-Received: by 2002:a0c:aed7:: with SMTP id n23mr10402724qvd.179.1589815434540; Mon, 18 May 2020 08:23:54 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id d82sm8430176qke.81.2020.05.18.08.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 08:23:53 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id F14C940AFD; Mon, 18 May 2020 12:23:51 -0300 (-03) Date: Mon, 18 May 2020 12:23:51 -0300 To: Jiri Olsa Cc: Joakim Zhang , Andi Kleen , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: Re: [PATCH] perf stat: Fix duration_time value for higher intervals Message-ID: <20200518152351.GD24211@kernel.org> References: <20200518131445.3745083-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200518131445.3745083-1-jolsa@kernel.org> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, May 18, 2020 at 03:14:45PM +0200, Jiri Olsa escreveu: > Joakim reported wrong duration_time value for interval bigger > than 4000 [1]. > > The problem is in the interval value we pass to update_stats > function, which is typed as 'unsigned int' and overflows when > we get over 2^32 (happens between intervals 4000 and 5000). > > Retyping the passed value to unsigned long long. Thanks, applied and added this: Fixes: b90f1333ef08 ("perf stat: Update walltime_nsecs_stats in interval mode") Ok? - Arnaldo > [1] https://www.spinics.net/lists/linux-perf-users/msg11777.html > > Reported-by: Joakim Zhang > Signed-off-by: Jiri Olsa > --- > tools/perf/builtin-stat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index e0c1ad23c768..4deb2d46a343 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -367,7 +367,7 @@ static void process_interval(void) > } > > init_stats(&walltime_nsecs_stats); > - update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000); > + update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL); > print_counters(&rs, 0, NULL); > } > > -- > 2.25.4 > -- - Arnaldo