1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
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
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.resources
.evProcessor
;
14 import org
.eclipse
.linuxtools
.lttng
.event
.LttngEvent
;
15 import org
.eclipse
.linuxtools
.lttng
.state
.StateStrings
.Events
;
16 import org
.eclipse
.linuxtools
.lttng
.state
.evProcessor
.ILttngEventProcessor
;
17 import org
.eclipse
.linuxtools
.lttng
.state
.model
.LttngTraceState
;
18 import org
.eclipse
.linuxtools
.lttng
.ui
.TraceDebug
;
19 import org
.eclipse
.linuxtools
.lttng
.ui
.model
.trange
.TimeRangeEventResource
;
20 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimestamp
;
23 * Creates specific finish state data request
28 public class ResourcesFinishUpdateHandler
extends
29 AbsResourcesTRangeUpdate
30 implements ILttngEventProcessor
{
32 public Events
getEventHandleType() {
37 public boolean process(LttngEvent trcEvent
, LttngTraceState traceSt
) {
38 // Draw a last known state to the end of the trace
39 TmfTimestamp endReqTime
= traceSt
.getContext()
40 .getTraceTimeWindow().getEndTime();
42 TraceDebug
.debug("Number of localResources: "
43 + resContainer
.readItems().length
);
45 // for each existing resource
46 for (TimeRangeEventResource localResource
: resContainer
50 long stime
= localResource
.getNext_good_time();
52 // Get the resource state mode
53 String stateMode
= localResource
.getStateMode(traceSt
);
55 // Insert an instance from previous time to end request time with
57 makeDraw(traceSt
, stime
, endReqTime
.getValue(),
58 localResource
, params
, stateMode
);