Commit | Line | Data |
---|---|---|
5d10d135 | 1 | /******************************************************************************* |
3f2b9283 | 2 | * Copyright (c) 2009, 2010 Ericsson |
5d10d135 ASL |
3 | * |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation | |
3f2b9283 | 11 | * Marc Dumais (marc.dumais@ericsson.com) - Fix for 316455 (second part) |
5d10d135 ASL |
12 | *******************************************************************************/ |
13 | package org.eclipse.linuxtools.lttng.state.experiment; | |
14 | ||
550d787e FC |
15 | import java.util.HashMap; |
16 | import java.util.Map; | |
17 | ||
8016d660 | 18 | import org.eclipse.linuxtools.lttng.LttngConstants; |
8827c197 FC |
19 | import org.eclipse.linuxtools.lttng.TraceDebug; |
20 | import org.eclipse.linuxtools.lttng.control.LttngCoreProviderFactory; | |
e31e01e8 | 21 | import org.eclipse.linuxtools.lttng.event.LttngEvent; |
550d787e FC |
22 | import org.eclipse.linuxtools.lttng.event.LttngSyntheticEvent; |
23 | import org.eclipse.linuxtools.lttng.event.LttngSyntheticEvent.SequenceInd; | |
8827c197 | 24 | import org.eclipse.linuxtools.lttng.model.LTTngTreeNode; |
8827c197 FC |
25 | import org.eclipse.linuxtools.lttng.signal.ILttExperimentSelectedListener; |
26 | import org.eclipse.linuxtools.lttng.signal.StateExperimentListener; | |
c1c69938 | 27 | import org.eclipse.linuxtools.lttng.state.model.LttngTraceState; |
8827c197 | 28 | import org.eclipse.linuxtools.lttng.state.trace.IStateTraceManager; |
5d10d135 | 29 | import org.eclipse.linuxtools.tmf.event.TmfTimeRange; |
e31e01e8 | 30 | import org.eclipse.linuxtools.tmf.experiment.TmfExperiment; |
550d787e FC |
31 | import org.eclipse.linuxtools.tmf.request.ITmfDataRequest; |
32 | import org.eclipse.linuxtools.tmf.request.ITmfEventRequest; | |
550d787e | 33 | import org.eclipse.linuxtools.tmf.request.TmfEventRequest; |
a79913eb | 34 | import org.eclipse.linuxtools.tmf.signal.TmfExperimentRangeUpdatedSignal; |
12c155f5 FC |
35 | import org.eclipse.linuxtools.tmf.signal.TmfExperimentSelectedSignal; |
36 | import org.eclipse.linuxtools.tmf.signal.TmfSignalHandler; | |
37 | import org.eclipse.linuxtools.tmf.signal.TmfSignalManager; | |
8827c197 | 38 | import org.eclipse.linuxtools.tmf.trace.ITmfTrace; |
5d10d135 ASL |
39 | |
40 | /** | |
41 | * @author alvaro | |
42 | * | |
43 | */ | |
12c155f5 FC |
44 | public class StateExperimentManager extends LTTngTreeNode implements ILttExperimentSelectedListener, |
45 | IStateExperimentManager { | |
46 | ||
47 | // ======================================================================== | |
48 | // Data | |
49 | // ======================================================================= | |
50 | private LTTngTreeNode fSelectedExperiment = null; // one selected experiment | |
51 | // supported | |
52 | private final StateExperimentListener fexperimentListener; | |
53 | private boolean fwaitForCompletion = false; | |
54 | /** | |
55 | * Used to route incoming events to proper trace manager, during check point building | |
56 | */ | |
57 | private final Map<ITmfTrace, StateTraceHelper> ftraceToManagerMap = new HashMap<ITmfTrace, StateTraceHelper>(); | |
58 | ||
59 | private LttngSyntheticEvent syntheticEvent = null; | |
60 | private ITmfDataRequest<LttngEvent> fStateCheckPointRequest = null; | |
a79913eb FC |
61 | private boolean fCheckPointUpdateBusy = false; |
62 | private boolean fCheckPointUpdatePending = false; | |
63 | private int fCheckPointUpdateIndex = 0; | |
64 | private TmfTimeRange fCheckPointUpdateRange = null; | |
65 | private long fCheckPointNbEventsHandled = 0; | |
66 | private final Object fCheckPointUpdateSyncObj = new Object(); | |
8827c197 | 67 | |
12c155f5 FC |
68 | // ======================================================================== |
69 | // Constructors | |
70 | // ======================================================================= | |
71 | public StateExperimentManager(Long id, String name) { | |
72 | super(id, null, name, null); | |
73 | fexperimentListener = new StateExperimentListener("Experiment Manager", this); //$NON-NLS-1$ | |
74 | TmfSignalManager.register(this); | |
75 | } | |
5d10d135 | 76 | |
12c155f5 FC |
77 | @TmfSignalHandler |
78 | @SuppressWarnings({ "unchecked", "rawtypes" }) | |
79 | public void experimentSelected(TmfExperimentSelectedSignal signal) { | |
80 | experimentSelected_prep(signal.getExperiment()); | |
81 | } | |
8827c197 | 82 | |
12c155f5 FC |
83 | // ======================================================================== |
84 | // Methods | |
85 | // ======================================================================= | |
5d10d135 | 86 | |
550d787e FC |
87 | // /* (non-Javadoc) |
88 | // * @see org.eclipse.linuxtools.lttng.state.experiment.IStateExperimentManager#readExperimentTimeWindow(org.eclipse.linuxtools.tmf.event.TmfTimeRange, java.lang.String, org.eclipse.linuxtools.lttng.state.IStateDataRequestListener) | |
89 | // */ | |
90 | // public ILttngSyntEventRequest readExperimentTimeWindow(TmfTimeRange trange, | |
91 | // Object source, IRequestStatusListener listener, | |
92 | // ITransEventProcessor processor) { | |
93 | // | |
94 | // ILttngSyntEventRequest request = null; | |
95 | // | |
96 | // // validate | |
97 | // if (fSelectedExperiment != null) { | |
98 | // // Get all trace manager nodes | |
99 | // LTTngTreeNode[] traceMgrs = fSelectedExperiment.getChildren(); | |
100 | // | |
101 | // if (traceMgrs != null && traceMgrs.length > 0) { | |
102 | // IStateTraceManager traceManager; | |
103 | // // Trigger one request per trace | |
104 | // for (LTTngTreeNode traceNode : traceMgrs) { | |
105 | // traceManager = (IStateTraceManager) traceNode; | |
106 | // request = traceManager.executeDataRequest(trange, source, | |
107 | // listener, | |
108 | // processor); | |
109 | // } | |
110 | // } | |
111 | // } else { | |
112 | // if (fSelectedExperiment == null) { | |
113 | // TraceDebug.debug("No experiment selected"); | |
114 | // } | |
115 | // } | |
116 | // | |
117 | // return request; | |
118 | // } | |
5d10d135 | 119 | |
550d787e FC |
120 | // /* (non-Javadoc) |
121 | // * @see org.eclipse.linuxtools.lttng.state.experiment.IStateExperimentManager#readExperiment(java.lang.String, org.eclipse.linuxtools.lttng.state.IStateDataRequestListener) | |
122 | // */ | |
123 | // @SuppressWarnings("unchecked") | |
124 | // public void readExperiment(Object source, IRequestStatusListener listener, | |
125 | // ITransEventProcessor processor) { | |
126 | // // validate | |
127 | // if (fSelectedExperiment != null) { | |
128 | // TmfExperiment<LttngEvent> experiment = (TmfExperiment<LttngEvent>) fSelectedExperiment | |
129 | // .getValue(); | |
130 | // TmfTimeRange trange = experiment.getTimeRange(); | |
131 | // readExperimentTimeWindow(trange, source, listener, processor); | |
132 | // } else { | |
133 | // TraceDebug.debug("No selected experiment available"); | |
134 | // } | |
135 | // } | |
5d10d135 | 136 | |
12c155f5 FC |
137 | /* |
138 | * (non-Javadoc) | |
139 | * | |
140 | * @see org.eclipse.linuxtools.lttng.state.experiment.IStateExperimentManager #experimentSelected_prep | |
141 | * (org.eclipse.linuxtools.tmf.experiment.TmfExperiment) | |
142 | */ | |
143 | @Override | |
144 | public void experimentSelected_prep(TmfExperiment<LttngEvent> experiment) { | |
145 | ||
146 | if (fSelectedExperiment != null) { | |
147 | clearExperimentNode(fSelectedExperiment); | |
148 | fSelectedExperiment = null; | |
149 | } | |
150 | ||
151 | LTTngTreeNode experimentNode = null; | |
152 | if (experiment != null) { | |
153 | experimentNode = getChildByName(experiment.getName()); | |
154 | // keep experiment if already loaded with the same value | |
155 | if (experimentNode != null && experimentNode.getValue() != experiment) { | |
156 | clearExperimentNode(experimentNode); | |
157 | experimentNode = null; | |
158 | } | |
159 | ||
160 | // Make sure all traces involved have a corresponding state manager | |
161 | // and | |
162 | // state system to request its initial data | |
163 | if (experimentNode == null) { | |
164 | // Create the new experiment tree node | |
165 | experimentNode = new LTTngTreeNode(getNextUniqueId(), this, experiment.getName(), experiment); | |
166 | // add the new experiment to this children list | |
167 | addChild(experimentNode); | |
168 | } | |
169 | ||
170 | // Make sure the traces exists in the tree | |
171 | ITmfTrace[] rtraces = experiment.getTraces(); | |
172 | String traceName; | |
173 | LTTngTreeNode traceStateManagerNode; | |
174 | // StateStacksHandler | |
175 | for (ITmfTrace rtrace : rtraces) { | |
176 | traceName = rtrace.getName(); | |
177 | traceStateManagerNode = experimentNode.getChildByName(traceName); | |
178 | // Node does not exist for this experiment, so needs to be | |
179 | // created | |
180 | if (traceStateManagerNode == null) { | |
181 | traceStateManagerNode = StateManagerFactory.getManager(rtrace, experimentNode); | |
182 | experimentNode.addChild(traceStateManagerNode); | |
183 | } | |
184 | } | |
185 | ||
186 | // Reset event provider to handle requests for the new experiment | |
187 | LttngCoreProviderFactory.reset(experimentNode); | |
188 | ||
189 | // preserve the selected experiment | |
190 | fSelectedExperiment = experimentNode; | |
191 | } | |
192 | } | |
6b4cd5bf FC |
193 | |
194 | private void clearExperimentNode(LTTngTreeNode experimentNode) { | |
195 | // Remove checkpoints | |
196 | LTTngTreeNode[] traceNodes = experimentNode.getChildren(); | |
12c155f5 | 197 | |
6b4cd5bf FC |
198 | for (LTTngTreeNode traceStateManagerNode : traceNodes) { |
199 | IStateTraceManager traceManager = null; | |
200 | try { | |
201 | traceManager = (IStateTraceManager) traceStateManagerNode; | |
202 | // Clear all previously created check points as preparation to | |
203 | // re-build | |
204 | traceManager.clearCheckPoints(); | |
205 | experimentNode.removeChild(traceStateManagerNode); | |
206 | } catch (ClassCastException e) { | |
12c155f5 | 207 | // Nothing to do |
6b4cd5bf FC |
208 | } |
209 | ||
210 | // rebuild the experiment nodes from scratch | |
211 | removeChild(experimentNode); | |
212 | } | |
213 | } | |
214 | ||
12c155f5 FC |
215 | /* |
216 | * (non-Javadoc) | |
217 | * | |
218 | * @see org.eclipse.linuxtools.lttng.signal.ILttExperimentSelectedListener# experimentSelected(java.lang.Object, | |
219 | * org.eclipse.linuxtools.tmf.experiment.TmfExperiment) | |
220 | */ | |
221 | @Override | |
222 | public void experimentSelected(Object source, TmfExperiment<LttngEvent> experiment) { | |
223 | // validate | |
224 | if (experiment == null) { | |
225 | TraceDebug.debug("Received experiment is null"); //$NON-NLS-1$ | |
226 | return; | |
227 | } | |
228 | ||
229 | // If previous request is ongoing, cancel it before requesting a new | |
230 | // one. | |
231 | if (fStateCheckPointRequest != null && !fStateCheckPointRequest.isCompleted()) { | |
232 | fStateCheckPointRequest.cancel(); | |
233 | } | |
234 | ||
235 | synchronized (fCheckPointUpdateSyncObj) { | |
236 | fCheckPointUpdateBusy = true; | |
237 | fCheckPointUpdatePending = false; | |
238 | fCheckPointUpdateIndex = 0; | |
239 | } | |
240 | ||
241 | // trigger data request to build the state system check points | |
242 | fStateCheckPointRequest = buildCheckPoints(experiment, experiment.getTimeRange(), true); | |
243 | ||
244 | if (fStateCheckPointRequest == null) { | |
245 | synchronized (fCheckPointUpdateSyncObj) { | |
246 | fCheckPointUpdateBusy = false; | |
247 | } | |
248 | } | |
249 | } | |
250 | ||
251 | /* | |
252 | * (non-Javadoc) | |
253 | * | |
254 | * @see org.eclipse.linuxtools.lttng.signal.ILttExperimentSelectedListener# experimentUpdated | |
255 | * (org.eclipse.linuxtools.tmf.signal.TmfExperimentUpdatedSignal, boolean) | |
256 | */ | |
257 | @SuppressWarnings("unchecked") | |
258 | @Override | |
259 | public void experimentRangeUpdated(TmfExperimentRangeUpdatedSignal signal) { | |
260 | TmfExperiment<LttngEvent> experiment = (TmfExperiment<LttngEvent>) signal.getExperiment(); | |
261 | // validate | |
262 | if (experiment != fSelectedExperiment.getValue()) { | |
263 | return; | |
264 | } | |
265 | ||
266 | synchronized (fCheckPointUpdateSyncObj) { | |
267 | if (fCheckPointUpdateBusy) { | |
268 | fCheckPointUpdatePending = true; | |
269 | fCheckPointUpdateRange = signal.getRange(); | |
270 | return; | |
271 | } else { | |
272 | fCheckPointUpdateBusy = true; | |
273 | } | |
274 | } | |
275 | ||
276 | // If previous request is ongoing, cancel it before requesting a new | |
277 | // one. | |
278 | if (fStateCheckPointRequest != null && !fStateCheckPointRequest.isCompleted()) { | |
279 | fStateCheckPointRequest.cancel(); | |
280 | } | |
281 | ||
282 | // trigger data request to build the state system check points | |
283 | fStateCheckPointRequest = buildCheckPoints(experiment, signal.getRange(), false); | |
284 | ||
285 | if (fStateCheckPointRequest == null) { | |
286 | synchronized (fCheckPointUpdateSyncObj) { | |
287 | fCheckPointUpdateBusy = false; | |
288 | } | |
289 | } | |
290 | } | |
291 | ||
292 | /** | |
293 | * @return the SelectedExperiment tree node | |
294 | */ | |
295 | @Override | |
296 | public LTTngTreeNode getSelectedExperiment() { | |
297 | return fSelectedExperiment; | |
298 | } | |
299 | ||
300 | /* | |
301 | * (non-Javadoc) | |
302 | * | |
303 | * @see org.eclipse.linuxtools.lttng.state.experiment.IStateExperimentManager#getExperimentTimeRange() | |
304 | */ | |
305 | @Override | |
306 | @SuppressWarnings("unchecked") | |
307 | public TmfTimeRange getExperimentTimeRange() { | |
308 | TmfTimeRange timeRangeResult = null; | |
309 | if (fSelectedExperiment != null) { | |
310 | timeRangeResult = ((TmfExperiment<LttngEvent>) fSelectedExperiment.getValue()).getTimeRange(); | |
311 | } | |
312 | return timeRangeResult; | |
313 | } | |
314 | ||
315 | /* | |
316 | * (non-Javadoc) | |
317 | * | |
318 | * @see java.lang.Object#finalize() | |
319 | */ | |
320 | @Override | |
321 | protected void finalize() { | |
322 | fexperimentListener.dispose(); | |
323 | } | |
324 | ||
325 | /* | |
326 | * (non-Javadoc) | |
327 | * | |
328 | * @see org.eclipse.linuxtools.lttng.state.experiment.IStateExperimentManager #waitForComplete(boolean) | |
329 | */ | |
330 | @Override | |
331 | public void waitForCompletion(boolean wait) { | |
332 | fwaitForCompletion = wait; | |
333 | } | |
334 | ||
335 | private ITmfDataRequest<LttngEvent> buildCheckPoints(final TmfExperiment<LttngEvent> experiment, | |
336 | final TmfTimeRange range, boolean initial) { | |
337 | // validate | |
338 | if (experiment == null) { | |
339 | TraceDebug.debug("Received experiment is null"); //$NON-NLS-1$ | |
340 | return null; | |
341 | } | |
342 | ||
343 | LTTngTreeNode experimentNode = getChildByName(experiment.getName()); | |
344 | if (experimentNode == null) { | |
345 | TraceDebug.debug("Experiment Node " + experiment.getName() + " does not exist"); //$NON-NLS-1$ //$NON-NLS-2$ | |
346 | return null; | |
347 | } | |
348 | ||
349 | final boolean waitForCompletion = fwaitForCompletion; | |
350 | ||
351 | // get the trace manager nodes associated to the experiment | |
352 | LTTngTreeNode[] traceNodes = experimentNode.getChildren(); | |
353 | ||
354 | if (initial) { | |
355 | synchronized (this) { | |
356 | ftraceToManagerMap.clear(); | |
357 | } | |
358 | ||
359 | ITmfTrace trace; | |
360 | for (LTTngTreeNode traceStateManagerNode : traceNodes) { | |
361 | IStateTraceManager traceManager; | |
362 | try { | |
363 | traceManager = (IStateTraceManager) traceStateManagerNode; | |
364 | } catch (ClassCastException e) { | |
365 | System.out.println(e.getStackTrace().toString()); | |
366 | return null; | |
367 | } | |
368 | ||
369 | // Clear all previously created check points as preparation to | |
370 | // re-build | |
371 | traceManager.clearCheckPoints(); | |
372 | ||
373 | // build the trace to manager mapping for event dispatching | |
374 | trace = traceManager.getTrace(); | |
375 | synchronized (this) { | |
376 | ftraceToManagerMap.put(trace, new StateTraceHelper(traceManager)); | |
377 | } | |
378 | } | |
379 | } | |
380 | ||
381 | // if no trace mapping | |
382 | if (ftraceToManagerMap.size() < 1) { | |
383 | TraceDebug.debug("No traces associated to experiment " + experiment.getName()); //$NON-NLS-1$ | |
384 | return null; | |
385 | } | |
386 | ||
387 | fCheckPointNbEventsHandled = 0; | |
388 | ||
389 | // Prepare event data request to build state model | |
390 | ITmfEventRequest<LttngEvent> request = new TmfEventRequest<LttngEvent>(LttngEvent.class, range, | |
391 | fCheckPointUpdateIndex, TmfEventRequest.ALL_DATA, LttngConstants.DEFAULT_BLOCK_SIZE, | |
392 | ITmfDataRequest.ExecutionType.BACKGROUND) { | |
393 | ||
394 | /* | |
395 | * (non-Javadoc) | |
396 | * | |
397 | * @see org.eclipse.linuxtools.tmf.request.TmfDataRequest#handleData() | |
398 | */ | |
399 | @Override | |
400 | public void handleData(LttngEvent event) { | |
401 | super.handleData(event); | |
402 | if (event != null) { | |
9b635e61 | 403 | // Tracer.trace("Chk: " + event.getTimestamp()); |
12c155f5 FC |
404 | fCheckPointNbEventsHandled++; |
405 | ITmfTrace trace = event.getParentTrace(); | |
406 | ||
407 | StateTraceHelper helper = ftraceToManagerMap.get(trace); | |
408 | ||
409 | if (helper != null) { | |
410 | helper.incrementNumberRead(); | |
411 | ||
412 | // obtain synthetic event | |
413 | LttngSyntheticEvent synEvent = updateSynEvent(event, helper.getTraceModel()); | |
414 | ||
415 | // update state system, and save check points as needed | |
416 | helper.getStateManager().handleEvent(synEvent, helper.getNumberRead()); | |
417 | } else { | |
418 | TraceDebug.debug("StateTraceManager not found for trace" //$NON-NLS-1$ | |
419 | + trace.getName()); | |
420 | } | |
421 | } | |
422 | } | |
423 | ||
424 | /* | |
425 | * (non-Javadoc) | |
426 | * | |
427 | * @see org.eclipse.linuxtools.tmf.request.TmfDataRequest#handleCompleted() | |
428 | */ | |
429 | @Override | |
430 | public void handleCompleted() { | |
431 | super.handleCompleted(); | |
432 | printCompletedMessage(); | |
433 | ||
434 | if (!waitForCompletion) { | |
435 | synchronized (fCheckPointUpdateSyncObj) { | |
436 | fCheckPointUpdateBusy = false; | |
437 | fCheckPointUpdateIndex += fCheckPointNbEventsHandled; | |
438 | if (fCheckPointUpdatePending) { | |
439 | fCheckPointUpdatePending = false; | |
440 | fCheckPointUpdateBusy = true; | |
441 | buildCheckPoints(experiment, fCheckPointUpdateRange, false); | |
442 | } | |
443 | } | |
444 | } | |
445 | } | |
446 | ||
447 | /* | |
448 | * /** | |
449 | * | |
450 | * @param header | |
451 | */ | |
452 | private void printCompletedMessage() { | |
453 | if (TraceDebug.isDEBUG()) { | |
454 | TraceDebug | |
455 | .debug("Trace check point building completed, number of events handled: " + fCheckPointNbEventsHandled + "\n\t\t"); //$NON-NLS-1$ //$NON-NLS-2$ | |
456 | for (StateTraceHelper helper : ftraceToManagerMap.values()) { | |
457 | TraceDebug.debug(helper.getStateManager().toString() + "\n\t\t"); //$NON-NLS-1$ | |
458 | } | |
459 | } | |
460 | } | |
461 | }; | |
462 | ||
463 | // Execute event data request | |
464 | experiment.sendRequest(request); | |
465 | ||
466 | if (waitForCompletion) { | |
467 | try { | |
468 | request.waitForCompletion(); | |
469 | synchronized (fCheckPointUpdateSyncObj) { | |
470 | fCheckPointUpdateBusy = false; | |
471 | fCheckPointUpdateIndex += fCheckPointNbEventsHandled; | |
472 | if (fCheckPointUpdatePending) { | |
473 | fCheckPointUpdatePending = false; | |
474 | fCheckPointUpdateBusy = true; | |
475 | buildCheckPoints(experiment, fCheckPointUpdateRange, false); | |
476 | } | |
477 | } | |
478 | } catch (InterruptedException e) { | |
479 | e.printStackTrace(); | |
480 | } | |
481 | } | |
482 | ||
483 | return request; | |
484 | } | |
485 | ||
486 | private LttngSyntheticEvent updateSynEvent(LttngEvent e, LttngTraceState stateModel) { | |
487 | if (syntheticEvent == null || syntheticEvent.getBaseEvent() != e) { | |
488 | syntheticEvent = new LttngSyntheticEvent(e); | |
489 | } | |
490 | ||
491 | // Trace model needed by application handlers | |
492 | syntheticEvent.setTraceModel(stateModel); | |
493 | syntheticEvent.setSequenceInd(SequenceInd.UPDATE); | |
494 | ||
495 | return syntheticEvent; | |
496 | } | |
497 | ||
498 | /** | |
499 | * Helper class that wraps the StateTraceManager, the current LTTngTraceState and the number of read events | |
500 | * | |
501 | * @author bHufmann | |
502 | * | |
503 | */ | |
504 | private class StateTraceHelper { | |
505 | ||
506 | IStateTraceManager stateTraceManager = null; | |
507 | long numberEventsRead = 0; | |
508 | LttngTraceState stateTraceModel = null; | |
509 | ||
510 | /** | |
511 | * Constructor | |
512 | * | |
513 | * @param stateManager | |
514 | * The StateTraceManager the helper is for | |
515 | */ | |
516 | public StateTraceHelper(IStateTraceManager stateManager) { | |
517 | this.stateTraceManager = stateManager; | |
518 | // Get the TraceState at the beginning of the trace | |
519 | this.stateTraceManager.restoreCheckPointByTimestamp(stateManager.getTrace().getStartTime()); | |
520 | this.stateTraceModel = this.stateTraceManager.getStateModel(); | |
521 | } | |
522 | ||
523 | /** | |
524 | * Returns the StateTraceManager | |
525 | * | |
526 | * @return IStateTraceManager | |
527 | */ | |
528 | public IStateTraceManager getStateManager() { | |
529 | return stateTraceManager; | |
530 | } | |
531 | ||
532 | /** | |
533 | * Returns the number of read events | |
534 | * | |
535 | * @return long | |
536 | */ | |
537 | public long getNumberRead() { | |
538 | return numberEventsRead; | |
539 | } | |
540 | ||
541 | /** | |
542 | * Increments the number of read events | |
543 | */ | |
544 | public void incrementNumberRead() { | |
545 | ++numberEventsRead; | |
546 | } | |
547 | ||
548 | /** | |
549 | * Returns the current LTTngTraceState | |
550 | * | |
551 | * @return LttngTraceState | |
552 | */ | |
553 | public LttngTraceState getTraceModel() { | |
554 | return stateTraceModel; | |
555 | } | |
556 | } | |
e31e01e8 | 557 | } |