package org.eclipse.tracecompass.internal.analysis.os.linux.core.latency;
import java.io.Serializable;
-import java.util.Map;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.segmentstore.core.ISegment;
-import com.google.common.collect.ImmutableMap;
-
/**
* A linux kernel system call, represented as an {@link ISegment}.
*
private final long fStartTime;
private final String fName;
- private final Map<String, String> fArgs;
/**
* @param startTime
* Start time of the system call
* @param name
* Name of the system call
- * @param arguments
- * Arguments of the system call
*/
public InitialInfo(
long startTime,
- String name,
- Map<String, String> arguments) {
+ String name) {
fStartTime = startTime;
fName = name;
- fArgs = ImmutableMap.copyOf(arguments);
}
}
private final InitialInfo fInfo;
private final long fEndTime;
- private final int fRet;
/**
* @param info
* Initial information of the system call
* @param endTime
* End time of the system call
- * @param ret
- * Return value of the system call
*/
public SystemCall(
InitialInfo info,
- long endTime,
- int ret) {
+ long endTime) {
fInfo = info;
fEndTime = endTime;
- fRet = ret;
}
@Override
return fInfo.fName;
}
- /**
- * Get the arguments of the system call
- *
- * @return Map of the arguments
- */
- public Map<String, String> getArguments() {
- return fInfo.fArgs;
- }
-
- /**
- * Get the return value of the system call
- *
- * @return Return value
- */
- public int getReturnValue() {
- return fRet;
- }
-
@Override
public int compareTo(@NonNull ISegment o) {
int ret = ISegment.super.compareTo(o);
return "Start Time = " + getStart() + //$NON-NLS-1$
"; End Time = " + getEnd() + //$NON-NLS-1$
"; Duration = " + getLength() + //$NON-NLS-1$
- "; Name = " + getName() + //$NON-NLS-1$
- "; Args = " + getArguments().toString() + //$NON-NLS-1$
- "; Return = " + getReturnValue(); //$NON-NLS-1$
+ "; Name = " + getName(); //$NON-NLS-1$
}
}
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
long startTime = event.getTimestamp().getValue();
String syscallName = eventName.substring(layout.eventSyscallEntryPrefix().length());
- Map<String, String> args = event.getContent().getFieldNames().stream()
- .collect(Collectors.toMap(Function.identity(),
- input -> checkNotNull(event.getContent().getField(input).toString())));
-
- SystemCall.InitialInfo newSysCall = new SystemCall.InitialInfo(startTime, checkNotNull(syscallName), checkNotNull(args));
+ SystemCall.InitialInfo newSysCall = new SystemCall.InitialInfo(startTime, syscallName.intern());
fOngoingSystemCalls.put(tid, newSysCall);
} else if (eventName.startsWith(layout.eventSyscallExitPrefix())) {
}
long endTime = event.getTimestamp().getValue();
- int ret = ((Long) event.getContent().getField("ret").getValue()).intValue(); //$NON-NLS-1$
- ISegment syscall = new SystemCall(info, endTime, ret);
+ ISegment syscall = new SystemCall(info, endTime);
getSegmentStore().add(syscall);
}
}