/
ProcessStatusInterval.java
94 lines (83 loc) · 2.58 KB
/
ProcessStatusInterval.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*******************************************************************************
* Copyright (c) 2017 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tracecompass.internal.analysis.profiling.core.model;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.analysis.os.linux.core.model.ProcessStatus;
import org.eclipse.tracecompass.segmentstore.core.ISegment;
/**
* A segment representing the status of a process for a certain duration
*
* @author Geneviève Bastien
*/
public class ProcessStatusInterval implements ISegment {
/**
* Generated serial version
*/
private static final long serialVersionUID = -1304201837498841077L;
private final long fStartTime;
private final long fEndTime;
private final int fThreadId;
private final ProcessStatus fStatus;
private final @Nullable String fSyscallName;
/**
* Constructor
*
* @param start
* The start time of this interval
* @param end
* The end time of this interval
* @param threadId
* The thread id of this interval
* @param status
* The status of this interval
* @param syscallName
* The syscall name if necessary
*/
public ProcessStatusInterval(long start, long end, int threadId, ProcessStatus status, @Nullable String syscallName) {
fStartTime = start;
fEndTime = end;
fThreadId = threadId;
fStatus = status;
fSyscallName = syscallName;
}
@Override
public long getStart() {
return fStartTime;
}
@Override
public long getEnd() {
return fEndTime;
}
/**
* Gets the thread id represented by this interval
*
* @return The thread id
*/
public int getThreadId() {
return fThreadId;
}
/**
* Get the process status represented by this interval
*
* @return The status of this interval
*/
public ProcessStatus getProcessStatus() {
return fStatus;
}
/**
* Get the syscall name represented by this interval
*
* @return The syscall name for this interval
*/
public @Nullable String getSyscallName() {
return fSyscallName;
}
}