Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: tools/perf/metrics/cpu.py

Issue 2560543002: [telemetry] Fix CPU metric jiffie overflow correction. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/cpu.py
diff --git a/tools/perf/metrics/cpu.py b/tools/perf/metrics/cpu.py
index 0709783965d59acb5badafda51a3e278273cf595..a4fd859d332cdb1ca83fc5f6107b766b5cb7f9b1 100644
--- a/tools/perf/metrics/cpu.py
+++ b/tools/perf/metrics/cpu.py
@@ -87,9 +87,9 @@ def _SubtractCpuStats(cpu_stats, start_cpu_stats):
start_cpu_stats[process_type]['TotalTime'])
# Fix overflow for 32-bit jiffie counter, 64-bit counter will not overflow.
# Linux kernel starts with a value close to an overflow, so correction is
- # necessary.
+ # necessary. Assume jiffie counter is at 100 Hz.
if total_time < 0:
- total_time += 2 ** 32
+ total_time += 2 ** 32 / 100.
mikecase (-- gone --) 2016/12/06 19:54:15 do you need to divide by 100 if total_time > 0?
dtu 2016/12/06 20:33:58 No, the log shows that the values in cpu_stats wer
# Assert that the arguments were given in the correct order.
assert total_time > 0 and total_time < 2 ** 31, (
Sami 2016/12/07 17:20:12 Should this upper limit be fixed too?
dtu 2016/12/08 00:55:29 Done.
'Expected total_time > 0, was: %d' % total_time)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698