*
* Contributors:
* Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
+ * Michel Dagenais (michel.dagenais@polymtl.ca) - Reference C implementation, used with permission
*******************************************************************************/
package org.eclipse.linuxtools.lttng.ui.views.controlflow.evProcessor;
-import org.eclipse.linuxtools.lttng.event.LttngEvent;
-import org.eclipse.linuxtools.lttng.state.StateStrings.Fields;
-import org.eclipse.linuxtools.lttng.state.evProcessor.ILttngEventProcessor;
-import org.eclipse.linuxtools.lttng.state.model.LttngProcessState;
-import org.eclipse.linuxtools.lttng.state.model.LttngTraceState;
+import org.eclipse.linuxtools.lttng.core.event.LttngEvent;
+import org.eclipse.linuxtools.lttng.core.state.StateStrings.Fields;
+import org.eclipse.linuxtools.lttng.core.state.evProcessor.ILttngEventProcessor;
+import org.eclipse.linuxtools.lttng.core.state.model.LttngProcessState;
+import org.eclipse.linuxtools.lttng.core.state.model.LttngTraceState;
import org.eclipse.linuxtools.lttng.ui.TraceDebug;
import org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeEventProcess;
-import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
/**
* Creates instances of specific after state update handlers, per corresponding
AbsFlowTRangeUpdate handler = new AbsFlowTRangeUpdate() {
// @Override
+ @Override
public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {
// get event time, cpu, trace_number, process, pid
Long pid_in = getAFieldLong(trcEvent, traceSt, Fields.LTT_FIELD_NEXT_PID);
if ( !(pid_in.equals(process_in.getPid())) ) {
- TraceDebug.debug("pid_in != PID! (getSchedChangeHandler)");
+ TraceDebug.debug("pid_in != PID! (getSchedChangeHandler)"); //$NON-NLS-1$
}
//hashed_process_data = processlist_get_process_data(process_list,pid_out,process->cpu,&birth,trace_num);
- TimeRangeEventProcess localProcess = procContainer.findProcess(process_in.getPid(), process_in.getCpu(), traceSt.getTraceId(),process_in.getCreation_time() );
+ TimeRangeEventProcess localProcess = procContainer.findProcess(pid_in, process_in.getCpu(), traceSt
+ .getTraceId(), process_in.getCreation_time());
if ( localProcess == null ) {
if ( (pid_in == 0) || (pid_in != process_in.getPpid()) ) {
}
else {
TraceDebug
- .debug("pid_in is not 0 or pid_in == PPID! (getSchedChangeHandler)");
+ .debug("pid_in is not 0 or pid_in == PPID! (getSchedChangeHandler)"); //$NON-NLS-1$
}
}
AbsFlowTRangeUpdate handler = new AbsFlowTRangeUpdate() {
// @Override
+ @Override
public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {
Long child_pid = getAFieldLong(trcEvent, traceSt, Fields.LTT_FIELD_CHILD_PID);
localProcess = addLocalProcess(process_child, timeRange.getStartTime().getValue(), timeRange.getEndTime().getValue(), traceSt.getTraceId());
}
else {
- TraceDebug.debug("localProcess is null with child_pid not 0 or child_pid equals PPID (getProcessForkHandler)");
+ TraceDebug.debug("localProcess is null with child_pid not 0 or child_pid equals PPID (getProcessForkHandler)"); //$NON-NLS-1$
}
} else {
// If we found the process, the Ppid and the Tgid might
}
}
else {
- TraceDebug.debug("process_child is null! (getProcessForkHandler)");
+ TraceDebug.debug("process_child is null! (getProcessForkHandler)"); //$NON-NLS-1$
}
return false;
AbsFlowTRangeUpdate handler = new AbsFlowTRangeUpdate() {
// @Override
+ @Override
public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {
LttngProcessState process = traceSt.getRunning_process().get(trcEvent.getCpuId());
localProcess = addLocalProcess(process, timeRange.getStartTime().getValue(), timeRange.getEndTime().getValue(), traceSt.getTraceId());
}
else {
- TraceDebug.debug("process pid is not 0 or pid equals ppid! (getProcessExitHandler)");
+ TraceDebug.debug("process pid is not 0 or pid equals ppid! (getProcessExitHandler)"); //$NON-NLS-1$
}
}
}
else {
- TraceDebug.debug("process is null! (getProcessExitHandler)");
+ TraceDebug.debug("process is null! (getProcessExitHandler)"); //$NON-NLS-1$
}
return false;
AbsFlowTRangeUpdate handler = new AbsFlowTRangeUpdate() {
// @Override
+ @Override
public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {
LttngProcessState process = traceSt.getRunning_process().get(trcEvent.getCpuId());
localProcess = addLocalProcess(process, timeRange.getStartTime().getValue(), timeRange.getEndTime().getValue(), traceSt.getTraceId());
}
else {
- TraceDebug.debug("process pid is not 0 or pid equals ppid! (getProcessExecHandler)");
+ TraceDebug.debug("process pid is not 0 or pid equals ppid! (getProcessExecHandler)"); //$NON-NLS-1$
}
}
else {
}
}
else {
- TraceDebug.debug("process is null! (getProcessExecHandler)");
+ TraceDebug.debug("process is null! (getProcessExecHandler)"); //$NON-NLS-1$
}
return false;
AbsFlowTRangeUpdate handler = new AbsFlowTRangeUpdate() {
// @Override
+ @Override
public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {
LttngProcessState process = traceSt.getRunning_process().get(trcEvent.getCpuId());
localProcess = addLocalProcess(process, timeRange.getStartTime().getValue(), timeRange.getEndTime().getValue(), traceSt.getTraceId());
}
else {
- TraceDebug.debug("process pid is not 0 or pid equals ppid! (GetThreadBrandHandler)");
+ TraceDebug.debug("process pid is not 0 or pid equals ppid! (GetThreadBrandHandler)"); //$NON-NLS-1$
}
}
else {
}
}
else {
- TraceDebug.debug("process is null! (GetThreadBrandHandler)");
+ TraceDebug.debug("process is null! (GetThreadBrandHandler)"); //$NON-NLS-1$
}
return false;
AbsFlowTRangeUpdate handler = new AbsFlowTRangeUpdate() {
// @Override
+ @Override
public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {
int first_cpu;
Long pid_in = getAFieldLong(trcEvent, traceSt,
Fields.LTT_FIELD_PID);
- // Lttv assume that pid_in will NEVER be null or incoherent
- // What if ... ? (let's add some debug)
if ( pid_in != null ) {
if(pid_in == 0L) {
first_cpu = 0;
}
for (int cpu = first_cpu; cpu < nb_cpus; cpu++) {
- LttngProcessState process_in = lttv_state_find_process(traceSt, trcEvent.getCpuId(), pid_in );
+ LttngProcessState process_in = lttv_state_find_process(traceSt, Long.valueOf(cpu), pid_in);
if ( process_in != null ) {
TimeRangeEventProcess localProcess = procContainer.findProcess(process_in.getPid(), process_in.getCpu(), traceSt.getTraceId(), process_in.getCreation_time());
localProcess = addLocalProcess(process_in, timeRange.getStartTime().getValue(), timeRange.getEndTime().getValue(), traceSt.getTraceId());
}
else {
- TraceDebug.debug("process pid is not 0 or pid equals ppid! (getEnumProcessStateHandler)");
+ TraceDebug.debug("process pid is not 0 or pid equals ppid! (getEnumProcessStateHandler)"); //$NON-NLS-1$
}
}
- else {
- // If the process was found, it might be missing informations, add it here
- localProcess.setName(process_in.getName());
- localProcess.setPpid(process_in.getPpid());
- localProcess.setTgid(process_in.getTgid());
- }
+
+ // If the process was found, it might be missing
+ // informations, add it here
+ localProcess.setName(process_in.getName());
+ localProcess.setPpid(process_in.getPpid());
+ localProcess.setTgid(process_in.getTgid());
}
else {
- TraceDebug.debug("process_in is null! This should never happen. (getEnumProcessStateHandler)");
+ TraceDebug.debug("process_in is null! This should never happen. (getEnumProcessStateHandler)"); //$NON-NLS-1$
}
}
}
else {
- TraceDebug.debug("pid_in is null! This should never happen, really... (getEnumProcessStateHandler)");
+ TraceDebug.debug("pid_in is null! This should never happen, really... (getEnumProcessStateHandler)"); //$NON-NLS-1$
}
return false;