Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp873735pxk; Thu, 17 Sep 2020 19:57:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ8ETS3ksSs518fsd5Bt0hd+S/9LWEW+2ySSXJowwwUn/kLw/u49fKbXsSCipd8HPst+cA X-Received: by 2002:a17:906:3aca:: with SMTP id z10mr21727461ejd.419.1600397836353; Thu, 17 Sep 2020 19:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397836; cv=none; d=google.com; s=arc-20160816; b=a45P0Iuc0gqOJZxBmz0kZ0k5r/FnEYuLRDQe8nng9xcd4frUnTMI67iDxb2IubDJKB hZtr4x1BMSEsikNBFY0CUlcFbOL2JP/9d4VZCmlUkp5jprNC0QnDU6ArEavP+h0O2Dd7 LSP8EhdVC0EuQC5cly+XTGj18mgPVd6xTDnKRy1slfAKY5VLjZmegI7Oz/lWBqPKLq7y FRvolwUb00ZHWQ0bEYpqmVQ5ERctiTy7z1xOgoxwavfnCe06zOGu2bCWfwmVeS8yWS0O pPtE60YzomjMG7tkyndjzPds9yahbDUqnmDa+xA13EfOPZEQ0gTQHewdx80F4hC9ofr4 6hBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8GgQxTeXhOw9Q9zz/IkMMaM5uZL6QTMxsU9W5z1xVIE=; b=PdKash7DjSxnEVP3caDgW80gsi0MDK1jCuN9neQvBJ0JJ4J4Y2UR8xBBNb76RcaIae s3hES52rm0hJQ6GFfCviXesucU3Gw4aFUVhVFkWGWO6QFn1GC4dBK1Ssn6+FEgnXSe3w BkpB3kJJvJPgBo7dhT7b/+zHPzkmCtr2KD+Siqdqn7w2W833jjtaYUEVWjsNKxLaO0eB ecU55ARK5NxBzQ9puIwHU3Jk2P99mfcusB7SxLl9OnXjcDfEi0TTHLxbDEm8z/9exX3+ 4B2qsQej3TjZNVUC4mCgRZR7keIHjHMclCZRTaG3HSOdfAFj8AXe3zxsgNDKypPGbzPk n/NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EuUtszqA; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt15si1229746ejb.22.2020.09.17.19.56.53; Thu, 17 Sep 2020 19:57:16 -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=@kernel.org header.s=default header.b=EuUtszqA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbgIRCzE (ORCPT + 99 others); Thu, 17 Sep 2020 22:55:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:57334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727889AbgIRCHN (ORCPT ); Thu, 17 Sep 2020 22:07:13 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99E0A238E6; Fri, 18 Sep 2020 02:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394832; bh=RuOcHj6Pq7vRFqIp9YPlvoYdwRZ5RcdJnj7QOiZtsFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EuUtszqAycdmRfxftOmObHVi5HYtx2B8nqiJ4FZWi6cdOyPmg82YJqyEtMt2l5N1k jQKFChHoCNaI6thLYKaFyizSGbdLDO5Eo02Yo2+8wVheD3wwd88RlnHyl24kYQ6MXL C/+tmPeZwWx5JhQGdZGBhCYt4z15O5FZD2b6e4AQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiri Olsa , Joakim Zhang , Alexander Shishkin , Andi Kleen , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL 5.4 294/330] perf stat: Fix duration_time value for higher intervals Date: Thu, 17 Sep 2020 22:00:34 -0400 Message-Id: <20200918020110.2063155-294-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa [ Upstream commit ea9eb1f456a08c18feb485894185f7a4e31cc8a4 ] 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. [1] https://www.spinics.net/lists/linux-perf-users/msg11777.html Fixes: b90f1333ef08 ("perf stat: Update walltime_nsecs_stats in interval mode") Reported-by: Joakim Zhang Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200518131445.3745083-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- 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 468fc49420ce1..ac2feddc75fdd 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -351,7 +351,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.1