summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hansen <markhansen@google.com>2021-08-30 01:40:45 +0000
committerMark Hansen <markhansen@google.com>2021-08-30 01:42:34 +0000
commitde92d8f394c49dc13386c1e289cc907c44144129 (patch)
treeae99e99915cda7532fe1f01ae02db2764e553e15
parent55c3b615d6cb879c72e964546006f42a2d6e428b (diff)
downloadextras-de92d8f394c49dc13386c1e289cc907c44144129.tar.gz
Fix: stop rounding off perf times at the second boundary
This broke during the python2 to python3 migration where the definition of division changed. Now / is floating point division and // is flooring division. Change-Id: I769b52ada12bb999c1c5032cd2899abc644a3f0a BUG=198098440
-rwxr-xr-xsimpleperf/scripts/report_sample.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/simpleperf/scripts/report_sample.py b/simpleperf/scripts/report_sample.py
index ae5287d9..fbb52cf4 100755
--- a/simpleperf/scripts/report_sample.py
+++ b/simpleperf/scripts/report_sample.py
@@ -44,8 +44,8 @@ def report_sample(record_file, symfs_dir, kallsyms_file, show_tracing_data):
symbol = lib.GetSymbolOfCurrentSample()
callchain = lib.GetCallChainOfCurrentSample()
- sec = sample.time / 1000000000
- usec = (sample.time - sec * 1000000000) / 1000
+ sec = sample.time // 1000000000
+ usec = (sample.time - sec * 1000000000) // 1000
print('%s\t%d [%03d] %d.%06d:\t\t%d %s:' % (sample.thread_comm,
sample.tid, sample.cpu, sec,
usec, sample.period, event.name))