Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2828293ybk; Mon, 18 May 2020 08:53:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn7GNBJlXtovkYcy6INod+amE+4Q+xd4n43E8GqQAN53pBNdDpUXmSzs0zdtVaWEcODi5i X-Received: by 2002:a50:d2d1:: with SMTP id q17mr14665356edg.39.1589817189605; Mon, 18 May 2020 08:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589817189; cv=none; d=google.com; s=arc-20160816; b=f6TsR24wpuWjhNDydTh02TVjPmur65s+tv3isT2k58H52A5zEWN96wSR0nUP0U6Vk+ uAsqgZNWXjbNagNpZt8UkkuLWyWSQtiXp010pQ5XvvC4N/0oowZi+en9j7f5qJLd6UBB zm3S4jGkKGpCkyS6YtpA/I/F/XoF2X+riDQWk2BvL2Mt9uahbLpPYjeuuBSwdZEEqVHp M6JAbb+o3CHGVtnkIoMF6D/KvKsBiJUWN0U2L/3u5sK7iqCWm6VsgzuopY7GI5AGikcQ GUhusFltGdkypSsC9tOfEvP7kwDVJPp7+bEZYEp7Dyume/lEzZq9jYGgZK+pBNOA8t40 j9Og== 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:from:date :dkim-signature; bh=AwzIE0QSZVOtMPCqsUuN0MrPT3Xf0Z1CID8/L7WKrps=; b=JG5FcJvvk9JAkE4rCtbeveQUt2lkKgs0D7Rd+blekllnml7VaWqHwjLwwqemvKXaYf yPdL/iNjHwobrOMrqw6AEhxP72MUgayGhj2z2URDKx7SFFOIwY24rrWDjzOm3bFi3lR+ E3TFLTfkhkIgDoBqgBeUMSq+wbha4Xa88tMZDov13CXJb/9YvwbgpiguToRc7BiFIBsR oIIG4UwuA/brs/P0iQBAdu4VGenGM/8v/4I3Qn6vTJ/Yxj+nVHYDbvkEitw0vAnO17hk zmOHNVZVw6siqUOUc9feLC08CmvZZGbcUi7o6EcLNe/S/8DJmpfkCVRUnpMTDc71ouZl P9bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MWTdxHqQ; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si6181339edr.14.2020.05.18.08.52.46; Mon, 18 May 2020 08:53:09 -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=@redhat.com header.s=mimecast20190719 header.b=MWTdxHqQ; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728213AbgERPtB (ORCPT + 99 others); Mon, 18 May 2020 11:49:01 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:56252 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727007AbgERPtB (ORCPT ); Mon, 18 May 2020 11:49:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589816939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AwzIE0QSZVOtMPCqsUuN0MrPT3Xf0Z1CID8/L7WKrps=; b=MWTdxHqQDi+YjIQHEPIJTHCTbva5HR+2kHj5TAzJ5my7BxHnDNcGEILH8PJGMDCBZfaN5h TDP0M63qhupy10U8HSBoBYtRDGE5mMxlUxNxbhDWtdMmMKC8Yb41+pHR/S5PXk1O0qzifE kvu8k0y3GIOnyX9oALdcds64zkHLgj8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-rr5WJ3aZNH2HZcRDY4usZQ-1; Mon, 18 May 2020 11:48:54 -0400 X-MC-Unique: rr5WJ3aZNH2HZcRDY4usZQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A0A280058A; Mon, 18 May 2020 15:48:52 +0000 (UTC) Received: from krava (unknown [10.40.192.201]) by smtp.corp.redhat.com (Postfix) with SMTP id 5728B60BF3; Mon, 18 May 2020 15:48:49 +0000 (UTC) Date: Mon, 18 May 2020 17:48:48 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , 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: <20200518154848.GA11620@krava> References: <20200518131445.3745083-1-jolsa@kernel.org> <20200518152351.GD24211@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200518152351.GD24211@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 18, 2020 at 12:23:51PM -0300, Arnaldo Carvalho de Melo wrote: > 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? yep, thanks jirka > > - 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 >