/* Sub-attributes of the CPU nodes */
String CURRENT_THREAD = "Current_thread";
- String STATUS = "Status";
String SOFT_IRQS = "Soft_IRQs";
String IRQS = "IRQs";
/* Sub-attributes of the Thread nodes */
String PPID = "PPID";
- // static final String STATUS = "Status"
String EXEC_NAME = "Exec_name";
String PRIO = "Prio";
* Version number of this state provider. Please bump this if you modify the
* contents of the generated state history in some way.
*/
- private static final int VERSION = 19;
+ private static final int VERSION = 20;
// ------------------------------------------------------------------------
// Fields
import org.eclipse.tracecompass.analysis.os.linux.core.kernel.StateValues;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
-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.statevalue.ITmfStateValue;
ss.modifyAttribute(timestamp, value, quark);
/* Change the status of the running process to interrupted */
- quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss), Attributes.STATUS);
+ quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss));
value = StateValues.PROCESS_STATUS_INTERRUPTED_VALUE;
ss.modifyAttribute(timestamp, value, quark);
/* Change the status of the CPU to interrupted */
- quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getCurrentCPUNode(cpu, ss), Attributes.STATUS);
+ quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getCurrentCPUNode(cpu, ss));
value = StateValues.CPU_STATUS_IRQ_VALUE;
ss.modifyAttribute(timestamp, value, quark);
}
import org.eclipse.tracecompass.analysis.os.linux.core.kernel.StateValues;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
-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.statevalue.ITmfStateValue;
ss.modifyAttribute(timestamp, value, quark);
/* Change the status of the CPU to interrupted */
- quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getCurrentCPUNode(cpu, ss), Attributes.STATUS);
+ quark = KernelEventHandlerUtils.getCurrentCPUNode(cpu, ss);
value = StateValues.CPU_STATUS_IRQ_VALUE;
ss.modifyAttribute(timestamp, value, quark);
}
*/
public static void cpuExitInterrupt(long timestamp, Integer cpuNumber, ITmfStateSystemBuilder ssb)
throws StateValueTypeException, TimeRangeException {
- int quark;
int currentCPUNode = getCurrentCPUNode(cpuNumber, ssb);
- quark = ssb.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
ITmfStateValue value = getCpuStatus(ssb, currentCPUNode);
- ssb.modifyAttribute(timestamp, value, quark);
+ ssb.modifyAttribute(timestamp, value, currentCPUNode);
}
/**
} else {
value = StateValues.CPU_STATUS_IDLE_VALUE;
}
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
- ss.modifyAttribute(timestamp, value, quark);
+ ss.modifyAttribute(timestamp, value, currentCPUNode);
}
private static void setCpuProcess(ITmfStateSystemBuilder ss, Integer nextTid, long timestamp, int currentCPUNode) {
import org.eclipse.tracecompass.analysis.os.linux.core.kernel.StateValues;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
-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.statevalue.ITmfStateValue;
ss.modifyAttribute(timestamp, value, currentThreadNode);
/* Change the status of the CPU to interrupted */
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
value = StateValues.CPU_STATUS_SOFTIRQ_VALUE;
- ss.modifyAttribute(timestamp, value, quark);
+ ss.modifyAttribute(timestamp, value, currentCPUNode);
}
}
/* Put the CPU in system call (kernel) mode */
int currentCPUNode = KernelEventHandlerUtils.getCurrentCPUNode(cpu, ss);
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
- ss.modifyAttribute(timestamp, value, quark);
+ ss.modifyAttribute(timestamp, value, currentCPUNode);
}
}
/* Put the CPU in system call (kernel) mode */
int currentCPUNode = KernelEventHandlerUtils.getCurrentCPUNode(cpu, ss);
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
- ss.modifyAttribute(timestamp, value, quark);
+ ss.modifyAttribute(timestamp, value, currentCPUNode);
}
}
import org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions.UnfollowCpuAction;
import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.resources.ResourcesEntry.Type;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
int quark = resourcesEntry.getQuark();
if (resourcesEntry.getType().equals(Type.CPU)) {
- return createCpuEventsList(entry, ssq, fullStates, prevFullState, monitor, quark);
+ return createCpuEventsList(entry, fullStates, prevFullState, monitor, quark);
} else if ((resourcesEntry.getType().equals(Type.IRQ) || resourcesEntry.getType().equals(Type.SOFT_IRQ)) && (quark >= 0)) {
return createIrqEventsList(entry, fullStates, prevFullState, monitor, quark);
}
return null;
}
- private static List<ITimeEvent> createCpuEventsList(ITimeGraphEntry entry, ITmfStateSystem ssq, List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState, IProgressMonitor monitor, int quark) {
+ private static List<ITimeEvent> createCpuEventsList(ITimeGraphEntry entry, List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState, IProgressMonitor monitor, int quark) {
List<ITimeEvent> eventList;
- int statusQuark;
- try {
- statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS);
- } catch (AttributeNotFoundException e) {
- /*
- * The sub-attribute "status" is not available. May happen if the
- * trace does not have sched_switch events enabled.
- */
- return null;
- }
boolean isZoomThread = Thread.currentThread() instanceof ZoomThread;
eventList = new ArrayList<>(fullStates.size());
- ITmfStateInterval lastInterval = prevFullState == null || statusQuark >= prevFullState.size() ? null : prevFullState.get(statusQuark);
+ ITmfStateInterval lastInterval = prevFullState == null || quark >= prevFullState.size() ? null : prevFullState.get(quark);
long lastStartTime = lastInterval == null ? -1 : lastInterval.getStartTime();
long lastEndTime = lastInterval == null ? -1 : lastInterval.getEndTime() + 1;
for (List<ITmfStateInterval> fullState : fullStates) {
if (monitor.isCanceled()) {
return null;
}
- if (statusQuark >= fullState.size()) {
+ if (quark >= fullState.size()) {
/* No information on this CPU (yet?), skip it for now */
continue;
}
- ITmfStateInterval statusInterval = fullState.get(statusQuark);
+ ITmfStateInterval statusInterval = fullState.get(quark);
int status = statusInterval.getStateValue().unboxInt();
long time = statusInterval.getStartTime();
long duration = statusInterval.getEndTime() - time + 1;
*/
interface TestValues {
- int size = 871;
+ int size = 869;
long[] startTimes = {
1331668247314038062L,
1331668247316120937L,
1331668247314038062L,
1331668247314038062L,
- 1331668247314038062L,
- 1331668248014145796L,
1331668248014183954L,
+ 1331668248014145796L,
1331668247314851888L,
1331668247327098502L,
1331668247327098502L,
1331668248013353414L,
1331668247314607227L,
1331668247314607227L,
- 1331668247314038062L,
- 1331668248014184526L,
1331668248014130616L,
+ 1331668248014184526L,
1331668247314038062L,
1331668248011090056L,
1331668247931793142L,
1331668259054285979L,
1331668259054285979L,
1331668259054285979L,
- 1331668259054285979L,
- 1331668248014620024L,
1331668248014185078L,
+ 1331668248014620024L,
1331668259054285979L,
1331668259054285979L,
1331668259054285979L,
1331668248015333196L,
1331668259054285979L,
1331668259054285979L,
- 1331668259054285979L,
- 1331668248014548923L,
1331668248014188534L,
+ 1331668248014548923L,
1331668259054285979L,
1331668248015040151L,
1331668248482983146L,
TmfStateValue.newValueInt(20),
TmfStateValue.nullValue(),
TmfStateValue.nullValue(),
- TmfStateValue.nullValue(),
- TmfStateValue.newValueInt(1397),
TmfStateValue.newValueInt(2),
+ TmfStateValue.newValueInt(1397),
TmfStateValue.nullValue(),
TmfStateValue.nullValue(),
TmfStateValue.nullValue(),
TmfStateValue.newValueInt(5),
TmfStateValue.newValueString("swapper/1"),
TmfStateValue.newValueInt(20),
- TmfStateValue.nullValue(),
- TmfStateValue.newValueInt(1432),
TmfStateValue.newValueInt(4),
+ TmfStateValue.newValueInt(1432),
TmfStateValue.nullValue(),
TmfStateValue.nullValue(),
TmfStateValue.newValueInt(1),