1 /*******************************************************************************
2 * Copyright (c) 2016 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
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.tests
.stubs
.trace
;
12 import java
.io
.IOException
;
14 import org
.eclipse
.core
.runtime
.FileLocator
;
15 import org
.eclipse
.jdt
.annotation
.NonNull
;
16 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
17 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelTrace
;
18 import org
.eclipse
.tracecompass
.testtraces
.ctf
.CtfTestTrace
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.exceptions
.TmfTraceException
;
20 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.event
.CtfTmfEvent
;
21 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.trace
.CtfTmfTrace
;
24 * Stub for a generic CTF kernel trace.
26 * It's basically an LTTng (2.0/2.1) trace, but without depending on o.e.t.lttng2.kernel!
28 public class KernelCtfTraceStub
extends CtfTmfTrace
implements IKernelTrace
{
33 public KernelCtfTraceStub() {
38 * Get a trace from a CTF test trace.
42 * @return The initialized trace
44 public static synchronized KernelCtfTraceStub
getTrace(CtfTestTrace ctfTrace
) {
47 tracePath
= FileLocator
.toFileURL(ctfTrace
.getTraceURL()).getPath();
48 } catch (IOException e
) {
49 throw new IllegalStateException();
52 KernelCtfTraceStub trace
= new KernelCtfTraceStub();
54 trace
.initTrace(null, tracePath
, CtfTmfEvent
.class);
55 } catch (TmfTraceException e
) {
56 /* Should not happen if tracesExist() passed */
57 throw new RuntimeException(e
);
63 public @NonNull IKernelAnalysisEventLayout
getKernelEventLayout() {
64 return KernelEventLayoutStub
.getInstance();