Closed valschneider closed 6 years ago
@bjackman Woops, I relied on the tests I wrote for LISA's internal trace class... I'll add one here.
@bjackman I added window tests for ftrace and also "fixed" a test for baretrace. Even without windows, the problem was visible from that test: we were checking that the returned duration was simply the latest timestamp - which was wrong.
Assuming the 2nd commit is needed to make the 1st commit pass, can you squash those two? Nice to avoid having a commit where the tests fail.
@bjackman Done
The previous implementation only looked at the maximum timestamp of the traces. However, if trace windows are used to analyse a subset of the full trace, get_duration() would return an erroneous value:
(times are normalized) trace = <trace built with window=[5, 10]> print trace.get_duration()
This commit adds a lower-bound lookup to fix this issue.