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
.latency
;
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
.tests
.stubs
.trace
.KernelEventLayoutStub
;
17 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
18 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelTrace
;
19 import org
.eclipse
.tracecompass
.testtraces
.ctf
.CtfTestTrace
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.exceptions
.TmfTraceException
;
21 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.event
.CtfTmfEvent
;
22 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.trace
.CtfTmfTrace
;
24 class KernelCtfTraceStub
extends CtfTmfTrace
implements IKernelTrace
{
25 public KernelCtfTraceStub() {
29 public static synchronized KernelCtfTraceStub
getTrace(CtfTestTrace ctfTrace
) {
32 tracePath
= FileLocator
.toFileURL(ctfTrace
.getTraceURL()).getPath();
33 } catch (IOException e
) {
34 throw new IllegalStateException();
37 KernelCtfTraceStub trace
= new KernelCtfTraceStub();
39 trace
.initTrace(null, tracePath
, CtfTmfEvent
.class);
40 } catch (TmfTraceException e
) {
41 /* Should not happen if tracesExist() passed */
42 throw new RuntimeException(e
);
48 public @NonNull IKernelAnalysisEventLayout
getKernelEventLayout() {
49 return KernelEventLayoutStub
.getInstance();