aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Perot2014-07-17 15:48:54 (EDT)
committerMatthew Khouzam2014-07-18 13:33:06 (EDT)
commitc2badc1e8ee39c07a21e908c7ca7129e0d095ea0 (patch)
tree46602dcf6af4464622b33cf8cc4feab0ef8e7607
parentd5e453b7b97e498bc2f7ce970d9572d8b8b870c9 (diff)
downloadorg.eclipse.linuxtools-c2badc1e8ee39c07a21e908c7ca7129e0d095ea0.zip
org.eclipse.linuxtools-c2badc1e8ee39c07a21e908c7ca7129e0d095ea0.tar.gz
org.eclipse.linuxtools-c2badc1e8ee39c07a21e908c7ca7129e0d095ea0.tar.bz2
tmf: fix the ctf parser benchmarkrefs/changes/85/30085/2
Change-Id: Ieabefd01a81608ffee475bd114160b1e50df34ed Signed-off-by: Vincent Perot <vincent.perot@ericsson.com> Reviewed-on: https://git.eclipse.org/r/30085 Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/perf/org/eclipse/linuxtools/ctf/core/tests/perf/trace/TraceSeekBenchmark.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/perf/org/eclipse/linuxtools/ctf/core/tests/perf/trace/TraceSeekBenchmark.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/perf/org/eclipse/linuxtools/ctf/core/tests/perf/trace/TraceSeekBenchmark.java
index 91f890e..be8fc82 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/perf/org/eclipse/linuxtools/ctf/core/tests/perf/trace/TraceSeekBenchmark.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/perf/org/eclipse/linuxtools/ctf/core/tests/perf/trace/TraceSeekBenchmark.java
@@ -91,7 +91,11 @@ public class TraceSeekBenchmark {
List<Long> seekTimestamps = new LinkedList<>();
final long range = endTime - startTime;
for (int i = 0; i < NB_SEEKS; i++) {
- seekTimestamps.add(startTime + (RND.nextLong() % range));
+ long delta = (RND.nextLong() % range);
+ if (delta < 0) {
+ delta += range;
+ }
+ seekTimestamps.add(startTime + delta);
}
/* Benchmark seeking to the generated timestamps */