aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ftrace.py
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-12-21 15:41:01 +0000
committerJavi Merino <javi.merino@arm.com>2015-12-22 15:50:37 +0000
commit4c0e5505be736c393a47880583ea053addf035d8 (patch)
tree547d155978ca1161eab610e05dca6f00fb62cd06 /tests/test_ftrace.py
parent886c03e14e88478cb199cef643bd56059ffdc1ca (diff)
downloadtrappy-4c0e5505be736c393a47880583ea053addf035d8.tar.gz
ftrace: Learn again to normalize the time against an arbitrary basetime
In the past ftrace.normalize_time() accepted an arbitrary basetime parameter. This was lost in c79eccd5370e ("run: drop get_basetime() method") but the documentation of normalize_time() still talks about the basetime parameter. Recover it.
Diffstat (limited to 'tests/test_ftrace.py')
-rw-r--r--tests/test_ftrace.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_ftrace.py b/tests/test_ftrace.py
index e5e94c7..9f9dd2d 100644
--- a/tests/test_ftrace.py
+++ b/tests/test_ftrace.py
@@ -216,6 +216,21 @@ class TestFTrace(BaseTestThermal):
exp_inpower_last = prev_inpower_last - trace.basetime
self.assertEquals(round(trace.cpu_in_power.data_frame.index[-1] - exp_inpower_last, 7), 0)
+ def test_ftrace_normalize_time_accepts_basetime(self):
+ """FTrace().normalize_time() accepts an arbitrary basetime"""
+
+ trace = trappy.FTrace(normalize_time=False)
+
+ prev_inpower_first = trace.cpu_in_power.data_frame.index[0]
+ basetime = 3
+
+ trace.normalize_time(basetime)
+
+ self.assertEquals(trace.basetime, 3)
+
+ exp_inpower_first = prev_inpower_first - 3
+ self.assertEquals(round(trace.cpu_in_power.data_frame.index[0] - exp_inpower_first, 7), 0)
+
def test_ftrace_accepts_events(self):
"""The FTrace class accepts an events parameter with only the parameters interesting for a trace"""