d89ff4e46dffe8c22f2a8f339c13e85272717d89
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
.analysis
.os
.linux
.core
.latency
;
12 import java
.io
.Serializable
;
15 import org
.eclipse
.jdt
.annotation
.NonNull
;
16 import org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
;
17 import org
.eclipse
.tracecompass
.segmentstore
.core
.ISegment
;
19 import com
.google
.common
.collect
.ImmutableMap
;
22 * A linux kernel system call, represented as an {@link ISegment}.
24 * @author Alexandre Montplaisir
27 public class SystemCall
implements ISegment
{
29 private static final long serialVersionUID
= 1554494342105208730L;
32 * The subset of information that is available from the syscall entry event.
34 public static class InitialInfo
implements Serializable
{
36 private static final long serialVersionUID
= -5009710718804983721L;
38 private final long fStartTime
;
39 private final String fName
;
40 private final Map
<String
, String
> fArgs
;
44 * Start time of the system call
46 * Name of the system call
48 * Arguments of the system call
53 Map
<String
, String
> arguments
) {
54 fStartTime
= startTime
;
56 fArgs
= NonNullUtils
.checkNotNull(ImmutableMap
.copyOf(arguments
));
60 private final InitialInfo fInfo
;
61 private final long fEndTime
;
62 private final int fRet
;
66 * Initial information of the system call
68 * End time of the system call
70 * Return value of the system call
82 public long getStart() {
83 return fInfo
.fStartTime
;
87 public long getEnd() {
92 * Get the name of the system call
96 public String
getName() {
101 * Get the arguments of the system call
103 * @return Map of the arguments
105 public Map
<String
, String
> getArguments() {
110 * Get the return value of the system call
112 * @return Return value
114 public int getReturnValue() {
119 public int compareTo(@NonNull ISegment o
) {
120 int ret
= ISegment
.super.compareTo(o
);
124 return toString().compareTo(o
.toString());
128 public String
toString() {
129 return "Start Time = " + getStart() + //$NON-NLS-1$
130 "; End Time = " + getEnd() + //$NON-NLS-1$
131 "; Duration = " + getLength() + //$NON-NLS-1$
132 "; Name = " + getName() + //$NON-NLS-1$
133 "; Args = " + getArguments().toString() + //$NON-NLS-1$
134 "; Return = " + getReturnValue(); //$NON-NLS-1$
This page took 0.034681 seconds and 5 git commands to generate.