Commit | Line | Data |
---|---|---|
ce8319b6 BH |
1 | /******************************************************************************* |
2 | * Copyright (c) 2015 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are made | |
5 | * 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 | * Contributors: | |
10 | * Bernd Hufmann - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | package org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.statistics; | |
13 | ||
abda4cb0 | 14 | import org.eclipse.jdt.annotation.NonNull; |
ce8319b6 | 15 | import org.eclipse.jdt.annotation.Nullable; |
ce8319b6 | 16 | import org.eclipse.tracecompass.analysis.os.linux.core.latency.SystemCall; |
53f46dc0 | 17 | import org.eclipse.tracecompass.analysis.os.linux.core.latency.SystemCallLatencyAnalysis; |
abda4cb0 | 18 | import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider; |
5b901f94 | 19 | import org.eclipse.tracecompass.analysis.timing.core.segmentstore.statistics.AbstractSegmentStatisticsAnalysis; |
ce8319b6 | 20 | import org.eclipse.tracecompass.segmentstore.core.ISegment; |
ce8319b6 BH |
21 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; |
22 | import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; | |
23 | ||
ce8319b6 BH |
24 | /** |
25 | * Analysis module to calculate statistics of a latency analysis | |
26 | * | |
27 | * @author Bernd Hufmann | |
28 | */ | |
abda4cb0 | 29 | public class SystemCallLatencyStatisticsAnalysisModule extends AbstractSegmentStatisticsAnalysis { |
ce8319b6 BH |
30 | |
31 | /** The analysis module ID */ | |
5ea53577 | 32 | public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.core.latency.statistics.syscall"; //$NON-NLS-1$ |
ce8319b6 | 33 | |
ce8319b6 | 34 | @Override |
abda4cb0 JCK |
35 | protected @Nullable String getSegmentType(@NonNull ISegment segment) { |
36 | if (segment instanceof SystemCall) { | |
37 | SystemCall syscall = (SystemCall) segment; | |
38 | return syscall.getName(); | |
ce8319b6 | 39 | } |
abda4cb0 | 40 | return null; |
ce8319b6 BH |
41 | } |
42 | ||
43 | @Override | |
abda4cb0 JCK |
44 | protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(@NonNull ITmfTrace trace) { |
45 | return TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, SystemCallLatencyAnalysis.ID); | |
ce8319b6 BH |
46 | } |
47 | ||
abda4cb0 | 48 | } |