1 /*******************************************************************************
2 * Copyright (c) 2015 EfficiOS Inc., Alexandre Montplaisir
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.latency
;
12 import java
.io
.Serializable
;
15 import org
.eclipse
.jdt
.annotation
.NonNull
;
16 import org
.eclipse
.tracecompass
.segmentstore
.core
.ISegment
;
18 import com
.google
.common
.collect
.ImmutableMap
;
21 * A linux kernel system call, represented as an {@link ISegment}.
23 * @author Alexandre Montplaisir
26 public class SystemCall
implements ISegment
{
28 private static final long serialVersionUID
= 1554494342105208730L;
31 * The subset of information that is available from the syscall entry event.
33 public static class InitialInfo
implements Serializable
{
35 private static final long serialVersionUID
= -5009710718804983721L;
37 private final long fStartTime
;
38 private final String fName
;
39 private final Map
<String
, String
> fArgs
;
43 * Start time of the system call
45 * Name of the system call
47 * Arguments of the system call
52 Map
<String
, String
> arguments
) {
53 fStartTime
= startTime
;
55 fArgs
= ImmutableMap
.copyOf(arguments
);
59 private final InitialInfo fInfo
;
60 private final long fEndTime
;
61 private final int fRet
;
65 * Initial information of the system call
67 * End time of the system call
69 * Return value of the system call
81 public long getStart() {
82 return fInfo
.fStartTime
;
86 public long getEnd() {
91 * Get the name of the system call
95 public String
getName() {
100 * Get the arguments of the system call
102 * @return Map of the arguments
104 public Map
<String
, String
> getArguments() {
109 * Get the return value of the system call
111 * @return Return value
113 public int getReturnValue() {
118 public int compareTo(@NonNull ISegment o
) {
119 int ret
= ISegment
.super.compareTo(o
);
123 return toString().compareTo(o
.toString());
127 public String
toString() {
128 return "Start Time = " + getStart() + //$NON-NLS-1$
129 "; End Time = " + getEnd() + //$NON-NLS-1$
130 "; Duration = " + getLength() + //$NON-NLS-1$
131 "; Name = " + getName() + //$NON-NLS-1$
132 "; Args = " + getArguments().toString() + //$NON-NLS-1$
133 "; Return = " + getReturnValue(); //$NON-NLS-1$
This page took 0.034883 seconds and 5 git commands to generate.