1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
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 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.tests
.stubs
.trace
;
12 import org
.eclipse
.jdt
.annotation
.Nullable
;
13 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.kernelanalysis
.KernelTidAspect
;
14 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.kernelanalysis
.ThreadPriorityAspect
;
15 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
16 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelTrace
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.aspect
.ITmfEventAspect
;
18 import org
.eclipse
.tracecompass
.tmf
.tests
.stubs
.trace
.xml
.TmfXmlTraceStub
;
20 import com
.google
.common
.collect
.ImmutableSet
;
23 * A trace stub that implements a kernel trace. It can add an event layout to
26 * @author Geneviève Bastien
28 public class TmfXmlKernelTraceStub
extends TmfXmlTraceStub
implements IKernelTrace
{
30 private @Nullable IKernelAnalysisEventLayout fLayout
;
33 public IKernelAnalysisEventLayout
getKernelEventLayout() {
34 IKernelAnalysisEventLayout layout
= fLayout
;
36 return KernelEventLayoutStub
.getInstance();
42 * Set the kernel event layout to use with this trace
45 * The event layout to use with this trace
47 public void setKernelEventLayout(IKernelAnalysisEventLayout layout
) {
52 public Iterable
<ITmfEventAspect
> getEventAspects() {
54 * This method needs to fill the aspects dynamically because aspects in
55 * the parent class are not all present at the beginning of the trace
57 ImmutableSet
.Builder
<ITmfEventAspect
> builder
= ImmutableSet
.builder();
58 builder
.addAll(super.getEventAspects());
59 builder
.add(KernelTidAspect
.INSTANCE
);
60 builder
.add(ThreadPriorityAspect
.INSTANCE
);
61 return builder
.build();