Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2714591ybk; Mon, 18 May 2020 06:19:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqvGT/Y7Yo1d0PzrVmj9IbTCT/LE1kph0tRscBPYOVLMY9VAs2u6F9JJ5HFHTrdon2BgG5 X-Received: by 2002:a50:d619:: with SMTP id x25mr13832115edi.200.1589807942556; Mon, 18 May 2020 06:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589807942; cv=none; d=google.com; s=arc-20160816; b=0s47anz9if3uOczkGPlkZvB3l/VTXtJt/I4BXqBX1CQYMnBTcrJsFNThsnlt+W9Met e+RYQ+d9syINWzqepANSbqXSUzAHJL2EeEH39l3KQPO2Imb6N8JnbLpAdrSbzAAK+7Eu obaDEu6875I7vhrC4Wq7fxKazWO3vO6qnrQa8bWz+c1XYK28Qv+RrugIxvpIDlLUdIXn Bajft9ZrhwJu4Ypb4IiYMKnXu0Ij7IF69hHySHQwTN6TCoJpZTFIns0pnjzuGsYClNeg RMs1xx6kPBHxu3G+FZ6SqML4QV81GSnkQ+w88nPlKXVzrt8PpFh/p9efsYIW4RX6bAex +aKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FKHbsIfyCJLyUMyZT6FfjzSiIMM/EcK3lBtDoys7PGs=; b=hS+mcBNtofZkieXI8p/c3iZHNJh9Sq8AWidwjk/zyBpdC+FAC6yEFNR0Vyn+7ff2nD hYvIabfiXvquzUB5k23B3FgT++PqvcYOEyyXqj4sspyR8AzNH/0NpYqCkPg3O8TTVsdA H+oG4qbeh9b8gXc3b9MdgvGHgsHGOuPNaOY1qllh0PCe5+43xOE2DFJSAB6IMuXYvUrS 8P3I5VJqXJ7XBOynJX84ak9PAcv08QV2+2ia/9KP4S13qpbDRERag06EK/7YF3ck975n LkqbVC172hUgWoYRny5CWpEmj3wJcb2X6b0IFGqncenmWJmRtuADZTR6aoVkONPEqzt3 qQxw== ARC-Authentication-Results: i=1; mx.google.com; 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 ly17si6344157ejb.148.2020.05.18.06.18.37; Mon, 18 May 2020 06:19:02 -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; 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 S1726940AbgERNO5 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 18 May 2020 09:14:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26552 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726726AbgERNO5 (ORCPT ); Mon, 18 May 2020 09:14:57 -0400 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-391-gq5wpV5ePDuOeX6TD6W-eQ-1; Mon, 18 May 2020 09:14:51 -0400 X-MC-Unique: gq5wpV5ePDuOeX6TD6W-eQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D0F78015CF; Mon, 18 May 2020 13:14:49 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.196.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BDCF2E162; Mon, 18 May 2020 13:14:46 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Joakim Zhang , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH] perf stat: Fix duration_time value for higher intervals Date: Mon, 18 May 2020 15:14:45 +0200 Message-Id: <20200518131445.3745083-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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