(no commit message)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / statistics / evProcessor / StatsModeChangeHandler.java
1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
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 * Yann N. Dauphin (dhaemon@gmail.com) - Implementation for stats
11 *******************************************************************************/
12 package org.eclipse.linuxtools.lttng.ui.views.statistics.evProcessor;
13
14 import org.eclipse.linuxtools.lttng.event.LttngEvent;
15 import org.eclipse.linuxtools.lttng.state.StateStrings.Events;
16 import org.eclipse.linuxtools.lttng.state.model.LttngTraceState;
17 import org.eclipse.linuxtools.lttng.ui.views.statistics.model.StatisticsTreeNode;
18
19 class StatsModeChangeHandler extends AbstractStatsEventHandler {
20
21 public StatsModeChangeHandler(Events eventType) {
22 super(eventType);
23 }
24
25 /* (non-Javadoc)
26 * @see org.eclipse.linuxtools.lttng.state.evProcessor.IEventProcessing#process(org.eclipse.linuxtools.lttng.event.LttngEvent, org.eclipse.linuxtools.lttng.state.model.LttngTraceState)
27 */
28 public boolean process(LttngEvent event, LttngTraceState traceState) {
29 StatisticsTreeNode root = getStatisticsTree(traceState);
30
31 String[][] paths = getRelevantPaths(event, traceState);
32
33 for (String[] path : paths) {
34 StatisticsTreeNode node = root.getOrCreateChildFromPath(path);
35
36 increaseCPUTime(node, event, traceState);
37
38 increaseStateCumulativeCPUTime(event, traceState);
39 }
40
41 return false;
42 }
43
44 }
This page took 0.050137 seconds and 5 git commands to generate.