lttng: Add the dependency graph model and handlers for an LTTng kernel
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.kernel.core / src / org / eclipse / tracecompass / internal / lttng2 / kernel / core / analysis / graph / building / LttngKernelExecutionGraph.java
1 /*******************************************************************************
2 * Copyright (c) 2015 École Polytechnique de Montréal
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
10 package org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.graph.building;
11
12 import org.eclipse.tracecompass.analysis.graph.core.building.ITmfGraphProvider;
13 import org.eclipse.tracecompass.analysis.graph.core.building.TmfGraphBuilderModule;
14 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
15
16 /**
17 * Graph building module for the lttng kernel execution graph
18 *
19 * @author Francis Giraldeau
20 * @author Geneviève Bastien
21 */
22 public class LttngKernelExecutionGraph extends TmfGraphBuilderModule {
23
24 /**
25 * Analysis id of this module
26 */
27 public static final String ANALYSIS_ID = "org.eclipse.tracecompass.lttng2.kernel.core.execgraph"; //$NON-NLS-1$
28
29 @Override
30 public boolean canExecute(ITmfTrace trace) {
31 /**
32 * TODO: Trace must have at least sched_switches and sched_wakeups
33 * enabled
34 */
35 return true;
36 }
37
38 @Override
39 protected ITmfGraphProvider getGraphProvider() {
40 ITmfTrace trace = getTrace();
41 if (trace == null) {
42 throw new NullPointerException();
43 }
44 return new LttngKernelExecGraphProvider(trace);
45 }
46
47 @Override
48 protected String getFullHelpText() {
49 return super.getFullHelpText();
50 }
51
52 @Override
53 protected String getShortHelpText(ITmfTrace trace) {
54 return super.getShortHelpText(trace);
55 }
56
57 @Override
58 protected String getTraceCannotExecuteHelpText(ITmfTrace trace) {
59 return "The trace must have events 'sched_switch' and 'sched_wakeup' enabled"; //$NON-NLS-1$
60 }
61
62 }
This page took 0.03177 seconds and 5 git commands to generate.