tmf: TmfTraceManager improvements
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 16 Feb 2015 22:29:32 +0000 (17:29 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 9 Mar 2015 18:06:28 +0000 (14:06 -0400)
commit21852dfa0810717b45a411cb1b671281a3956f8d
treec70751298b99baf8fa67b0abffd93ff5f6e6c94f
parentd3d01202b13d789862aa18b267b6b66db78ceaba
tmf: TmfTraceManager improvements

Since the #getCurrentContext() can change at any time, but the
trace context object itself is immutable, it's safer to expose
the context rather than individual getters.

Many views gather all available timestamps in the following fashion
(assuming here we "expand" the calls to getCurrentContext()):

  selectionStart = tm.getCurrentContext().getSelectionStart();
  selectionEnd   = tm.getCurrentContext().getSelectionEnd();
  windowStart    = tm.getCurrentContext().getWindowRange().getStart();
  windowEnd      = tm.getCurrentContext().getWindowRange().getEnd();
  ...

If the context changes mid-way during these calls, the gathered time
ranges will be inconsistent. It'd be safer to extract the context
locally first.

Also updated the TmfTraceContext to return a TimeRange for the current
selection (it used to be a single timestamp, now we support a range).
This required updating the tests.

Change-Id: Ia44dc7157a2b98f320dcd92fd3856148dac4f47b
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/41986
Reviewed-by: Hudson CI
18 files changed:
org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/analysis/os/linux/ui/views/cpuusage/CpuUsageView.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceContext.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java
org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerTest.java
org.eclipse.tracecompass.tmf.pcap.ui/src/org/eclipse/tracecompass/internal/tmf/pcap/ui/stream/StreamListView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/commands/ExportToTextCommandHandler.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/TmfTimeViewer.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/statistics/TmfStatisticsViewer.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/TmfChartView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/TmfView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/histogram/HistogramView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemExplorer.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statistics/TmfStatisticsView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timechart/TimeChartView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
This page took 0.048683 seconds and 5 git commands to generate.