List<ITmfStateInterval> list;
ITmfStateInterval interval;
- int quark, quark2, valueInt;
+ int quark, valueInt;
String valueStr;
list = ssb.loadStateAtTime(interestingTimestamp1);
valueStr = interval.getStateValue().unboxStr();
assertEquals("gdbus", valueStr);
- /* Query a stack attribute, has to be done in two passes */
- quark = ssb.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_MODE_STACK);
+ quark = ssb.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.SYSTEM_CALL);
interval = list.get(quark);
- valueInt = interval.getStateValue().unboxInt(); /* The stack depth */
- quark2 = ssb.getQuarkRelative(quark, Integer.toString(valueInt));
- interval = list.get(quark2);
valueStr = interval.getStateValue().unboxStr();
assertTrue(valueStr.equals("sys_poll"));
}
case 1: // "exit_syscall":
/* Fields: int64 ret */
{
- /* Pop "syscall" from the Exec_mode_stack */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.EXEC_MODE_STACK);
- try {
- ss.popAttribute(ts, quark);
- } catch (AttributeNotFoundException e1) {
- /*
- * meh, can happen if we're missing events, we'll just
- * silently ignore it.
- */
- System.err.println(event.getTimestamp()
- + " Popping empty attribute: " + e1.getMessage()); //$NON-NLS-1$
- }
+ /* Clear the current system call on the process */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
+ value = TmfStateValue.nullValue();
+ ss.modifyAttribute(ts, value, quark);
}
break;
* syscall names are listed into the event type
*/
- /*
- * Push the syscall name on the Exec_mode_stack of the
- * relevant PID
- */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.EXEC_MODE_STACK);
+ /* Assign the new system call to the process */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
value = TmfStateValue.newValueString(eventName);
- ss.pushAttribute(ts, value, quark);
+ ss.modifyAttribute(ts, value, quark);
}
}
break;
private void initThreadNode(int currentThreadNode) {
ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.PPID);
ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.EXEC_NAME);
- ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.EXEC_MODE_STACK);
+ ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
}