import org.eclipse.tracecompass.analysis.os.linux.core.kernel.StateValues;
import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.Attributes;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
* the state system
*
* @return the current thread node quark
- * @throws AttributeNotFoundException
- * current cpu node not found
*/
- public static int getCurrentThreadNode(Integer cpuNumber, ITmfStateSystemBuilder ss) throws AttributeNotFoundException {
+ public static int getCurrentThreadNode(Integer cpuNumber, ITmfStateSystemBuilder ss) {
/*
* Shortcut for the "current thread" attribute node. It requires
* querying the current CPU's current thread.
* The current thread node
* @param ssb
* the state system
- * @throws AttributeNotFoundException
- * an attribute does not exists yet
* @throws TimeRangeException
* the time is out of range
* @throws StateValueTypeException
* the attribute was not set with int values
*/
public static void setProcessToRunning(long timestamp, int currentThreadNode, ITmfStateSystemBuilder ssb)
- throws AttributeNotFoundException, TimeRangeException,
+ throws TimeRangeException,
StateValueTypeException {
int quark;
ITmfStateValue value;
* State system
* @throws StateValueTypeException
* the attribute is not set as an int
- * @throws AttributeNotFoundException
- * the attribute was not created yet
* @throws TimeRangeException
* the time is out of range
*/
public static void cpuExitInterrupt(long timestamp, Integer cpuNumber, ITmfStateSystemBuilder ssb)
- throws StateValueTypeException, AttributeNotFoundException,
- TimeRangeException {
+ throws StateValueTypeException, TimeRangeException {
int quark;
int currentCPUNode = getCurrentCPUNode(cpuNumber, ssb);
* The *quark* of the CPU we are looking for. Careful, this is
* NOT the CPU number (or attribute name)!
* @return The state value that represents the status of the given CPU
- * @throws AttributeNotFoundException
*/
- private static ITmfStateValue getCpuStatus(ITmfStateSystemBuilder ssb, int cpuQuark)
- throws AttributeNotFoundException {
+ private static ITmfStateValue getCpuStatus(ITmfStateSystemBuilder ssb, int cpuQuark) {
/* Check if there is a IRQ running */
int irqQuarks = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.IRQS);
return StateValues.CPU_STATUS_IDLE_VALUE;
}
int threadSystemCallQuark = ssb.getQuarkAbsoluteAndAdd(Attributes.THREADS, Integer.toString(tid), Attributes.SYSTEM_CALL);
- return (ssb.queryOngoingState(threadSystemCallQuark).isNull() ?
- StateValues.CPU_STATUS_RUN_USERMODE_VALUE :
- StateValues.CPU_STATUS_RUN_SYSCALL_VALUE);
+ return (ssb.queryOngoingState(threadSystemCallQuark).isNull() ? StateValues.CPU_STATUS_RUN_USERMODE_VALUE : StateValues.CPU_STATUS_RUN_SYSCALL_VALUE);
}
}
setCpuStatus(ss, nextTid, newCurrentThreadNode, timestamp, currentCPUNode);
}
- private static void setOldProcessStatus(ITmfStateSystemBuilder ss, Long prevState, Integer formerThreadNode, long timestamp) throws AttributeNotFoundException {
+ private static void setOldProcessStatus(ITmfStateSystemBuilder ss, Long prevState, Integer formerThreadNode, long timestamp) {
ITmfStateValue value;
/*
* Empirical observations and look into the linux code have
return state == 0;
}
- private static void setCpuStatus(ITmfStateSystemBuilder ss, Integer nextTid, Integer newCurrentThreadNode, long timestamp, int currentCPUNode) throws AttributeNotFoundException {
+ private static void setCpuStatus(ITmfStateSystemBuilder ss, Integer nextTid, Integer newCurrentThreadNode, long timestamp, int currentCPUNode) {
int quark;
ITmfStateValue value;
if (nextTid > 0) {
ss.modifyAttribute(timestamp, value, quark);
}
- private static void setCpuProcess(ITmfStateSystemBuilder ss, Integer nextTid, long timestamp, int currentCPUNode) throws AttributeNotFoundException {
+ private static void setCpuProcess(ITmfStateSystemBuilder ss, Integer nextTid, long timestamp, int currentCPUNode) {
int quark;
ITmfStateValue value;
quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.CURRENT_THREAD);
ss.modifyAttribute(timestamp, value, quark);
}
- private static void setProcessPrio(ITmfStateSystemBuilder ss, Integer prio, Integer threadNode, long timestamp) throws AttributeNotFoundException {
+ private static void setProcessPrio(ITmfStateSystemBuilder ss, Integer prio, Integer threadNode, long timestamp) {
int quark;
ITmfStateValue value;
quark = ss.getQuarkRelativeAndAdd(threadNode, Attributes.PRIO);
ss.modifyAttribute(timestamp, value, quark);
}
- private static void setProcessExecName(ITmfStateSystemBuilder ss, String processName, Integer threadNode, long timestamp) throws AttributeNotFoundException {
+ private static void setProcessExecName(ITmfStateSystemBuilder ss, String processName, Integer threadNode, long timestamp) {
int quark;
ITmfStateValue value;
quark = ss.getQuarkRelativeAndAdd(threadNode, Attributes.EXEC_NAME);
setStatus(ss, status, curThreadNode, timestamp);
}
- private static void setStatus(ITmfStateSystemBuilder ss, int status, int curThreadNode, long timestamp) throws AttributeNotFoundException {
+ private static void setStatus(ITmfStateSystemBuilder ss, int status, int curThreadNode, long timestamp) {
ITmfStateValue value;
int quark;
quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.STATUS);
}
}
- private static void setPpid(ITmfStateSystemBuilder ss, int tid, int pid, int ppid, int curThreadNode, long timestamp) throws AttributeNotFoundException {
+ private static void setPpid(ITmfStateSystemBuilder ss, int tid, int pid, int ppid, int curThreadNode, long timestamp) {
ITmfStateValue value;
int quark;
quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.PPID);
}
}
- private static void setProcessName(ITmfStateSystemBuilder ss, String name, int curThreadNode, long timestamp) throws AttributeNotFoundException {
+ private static void setProcessName(ITmfStateSystemBuilder ss, String name, int curThreadNode, long timestamp) {
ITmfStateValue value;
int quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.EXEC_NAME);
if (ss.queryOngoingState(quark).isNull()) {