Patch "perf stat: Fix duration_time value for higher intervals" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf stat: Fix duration_time value for higher intervals

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-stat-fix-duration_time-value-for-higher-interva.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 307aa1fa27618214259c3e35a1a29c1913cdc66f
Author: Jiri Olsa <jolsa@xxxxxxxxxx>
Date:   Mon May 18 15:14:45 2020 +0200

    perf stat: Fix duration_time value for higher intervals
    
    [ 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 <qiangqing.zhang@xxxxxxx>
    Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
    Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
    Cc: Michael Petlan <mpetlan@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Link: http://lore.kernel.org/lkml/20200518131445.3745083-1-jolsa@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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);
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux