tmf : Add latency statistics view for the pattern analysis
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / internal / analysis / os / linux / core / latency / statistics / SystemCallLatencyStatisticsAnalysisModule.java
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
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.eclipse.jdt.annotation.Nullable;
16 import org.eclipse.tracecompass.analysis.os.linux.core.latency.SystemCall;
17 import org.eclipse.tracecompass.analysis.os.linux.core.latency.SystemCallLatencyAnalysis;
18 import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider;
19 import org.eclipse.tracecompass.analysis.timing.core.segmentstore.statistics.AbstractSegmentStatisticsAnalysis;
20 import org.eclipse.tracecompass.segmentstore.core.ISegment;
21 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
22 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
23
24 /**
25 * Analysis module to calculate statistics of a latency analysis
26 *
27 * @author Bernd Hufmann
28 */
29 public class SystemCallLatencyStatisticsAnalysisModule extends AbstractSegmentStatisticsAnalysis {
30
31 /** The analysis module ID */
32 public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.core.latency.statistics.syscall"; //$NON-NLS-1$
33
34 @Override
35 protected @Nullable String getSegmentType(@NonNull ISegment segment) {
36 if (segment instanceof SystemCall) {
37 SystemCall syscall = (SystemCall) segment;
38 return syscall.getName();
39 }
40 return null;
41 }
42
43 @Override
44 protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(@NonNull ITmfTrace trace) {
45 return TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, SystemCallLatencyAnalysis.ID);
46 }
47
48 }
This page took 0.034599 seconds and 5 git commands to generate.