1 /*******************************************************************************
2 * Copyright (c) 2015, 2016 EfficiOS Inc., Alexandre Montplaisir and others
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
.IOException
;
13 import java
.io
.ObjectInputStream
;
14 import java
.io
.ObjectOutputStream
;
16 import org
.eclipse
.jdt
.annotation
.NonNull
;
17 import org
.eclipse
.tracecompass
.segmentstore
.core
.ISegment
;
20 * A linux kernel system call, represented as an {@link ISegment}.
22 * @author Alexandre Montplaisir
25 public final class SystemCall
implements ISegment
{
27 private static final long serialVersionUID
= 1554494342105208730L;
30 * The subset of information that is available from the syscall entry event.
32 public static class InitialInfo
{
34 private long fStartTime
;
39 * Start time of the system call
41 * Name of the system call
46 fStartTime
= startTime
;
47 fName
= name
.intern();
51 private long fStartTime
;
52 private long fEndTime
;
57 * Initial information of the system call
59 * End time of the system call
64 fStartTime
= info
.fStartTime
;
69 private void writeObject(ObjectOutputStream out
) throws IOException
{
70 out
.writeLong(fStartTime
);
71 out
.writeLong(fEndTime
);
75 private void readObject(ObjectInputStream in
) throws IOException
{
76 fStartTime
= in
.readLong();
77 fEndTime
= in
.readLong();
78 fName
= in
.readUTF().intern();
82 public long getStart() {
87 public long getEnd() {
92 * Get the name of the system call
96 public String
getName() {
101 public int compareTo(@NonNull ISegment o
) {
102 int ret
= ISegment
.super.compareTo(o
);
106 return toString().compareTo(o
.toString());
110 public String
toString() {
111 return "Start Time = " + getStart() + //$NON-NLS-1$
112 "; End Time = " + getEnd() + //$NON-NLS-1$
113 "; Duration = " + getLength() + //$NON-NLS-1$
114 "; Name = " + getName(); //$NON-NLS-1$
This page took 0.034061 seconds and 5 git commands to generate.