f8f2fa85fb90c93aa59cdec2ca74594df793f7f9
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core.tests / stubs / org / eclipse / tracecompass / analysis / os / linux / core / tests / stubs / trace / TmfXmlKernelTraceStub.java
1 /*******************************************************************************
2 * Copyright (c) 2016 É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.analysis.os.linux.core.tests.stubs.trace;
11
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
14 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
15 import org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub;
16
17 /**
18 * A trace stub that implements a kernel trace. It can add an event layout to
19 * the trace.
20 *
21 * @author Geneviève Bastien
22 */
23 public class TmfXmlKernelTraceStub extends TmfXmlTraceStub implements IKernelTrace {
24
25 private @Nullable IKernelAnalysisEventLayout fLayout;
26
27 @Override
28 public IKernelAnalysisEventLayout getKernelEventLayout() {
29 IKernelAnalysisEventLayout layout = fLayout;
30 if (layout == null) {
31 return KernelEventLayoutStub.getInstance();
32 }
33 return layout;
34 }
35
36 /**
37 * Set the kernel event layout to use with this trace
38 *
39 * @param layout
40 * The event layout to use with this trace
41 */
42 public void setKernelEventLayout(IKernelAnalysisEventLayout layout) {
43 fLayout = layout;
44 }
45
46 }
This page took 0.031901 seconds and 4 git commands to generate.