Source:
private static void createCpuInterruptEntryWithQuark(@NonNull ITmfTrace trace, final ITmfStateSystem ssq, Map<Integer, ResourcesEntry> entryMap, long startTime, long endTime, TimeGraphEntry traceEntry, ResourcesEntry cpuEntry, List<Integer> childrenQuarks, Type type) { for (Integer quark : childrenQuarks) { final @NonNull String resourceName = ssq.getAttributeName(quark); int resourceId = Integer.parseInt(resourceName); ResourcesEntry interruptEntry = entryMap.get(quark); if (interruptEntry == null) { interruptEntry = new ResourcesEntry(quark, trace, startTime, endTime, type, resourceId); entryMap.put(quark, interruptEntry); cpuEntry.addChild(interruptEntry); boolean found = false; for (ITimeGraphEntry rootElem : traceEntry.getChildren()) { if (rootElem instanceof AggregateResourcesEntry) { AggregateResourcesEntry aggregateInterruptEntry = (AggregateResourcesEntry) rootElem; if (aggregateInterruptEntry.getId() == resourceId && aggregateInterruptEntry.getType().equals(type)) { found = true; aggregateInterruptEntry.addContributor(interruptEntry); if( !aggregateInterruptEntry.hasChild(cpuEntry.getId())){ final AggregateResourcesEntry irqCpuEntry = new AggregateResourcesEntry(trace, cpuEntry.getName(), startTime, endTime, type, cpuEntry.getId()); irqCpuEntry.addContributor(interruptEntry); aggregateInterruptEntry.addChild(irqCpuEntry); } break; } } } if (!found) { AggregateResourcesEntry aggregateInterruptEntry = new AggregateResourcesEntry(trace, startTime, endTime, type, resourceId); aggregateInterruptEntry.addContributor(interruptEntry); traceEntry.addChild(aggregateInterruptEntry); final AggregateResourcesEntry irqCpuEntry = new AggregateResourcesEntry(trace, cpuEntry.getName(), startTime, endTime, type, cpuEntry.getId()); irqCpuEntry.addContributor(interruptEntry); aggregateInterruptEntry.addChild(irqCpuEntry); traceEntry.addChild(aggregateInterruptEntry); } } else { interruptEntry.updateEndTime(endTime); } } }

Target:
private static void createCpuInterruptEntryWithQuark(@NonNull ITmfTrace trace, final ITmfStateSystem ssq, Map<Integer, ResourcesEntry> entryMap, long startTime, long endTime, TimeGraphEntry traceEntry, ResourcesEntry cpuEntry, List<Integer> childrenQuarks, Type type) { for (Integer quark : childrenQuarks) { final @NonNull String resourceName = ssq.getAttributeName(quark); int resourceId = Integer.parseInt(resourceName); ResourcesEntry interruptEntry = entryMap.get(quark); if (interruptEntry == null) { interruptEntry = new ResourcesEntry(quark, trace, startTime, endTime, type, resourceId); entryMap.put(quark, interruptEntry); cpuEntry.addChild(interruptEntry); boolean found = false; for (ITimeGraphEntry rootElem : traceEntry.getChildren()) { if (rootElem instanceof AggregateResourcesEntry) { AggregateResourcesEntry aggregateInterruptEntry = (AggregateResourcesEntry) rootElem; if (aggregateInterruptEntry.getId() == resourceId && aggregateInterruptEntry.getType().equals(type)) { found = true; aggregateInterruptEntry.addContributor(interruptEntry); final AggregateResourcesEntry irqCpuEntry = new AggregateResourcesEntry(trace, cpuEntry.getName(), startTime, endTime, type, cpuEntry.getId()); irqCpuEntry.addContributor(interruptEntry); aggregateInterruptEntry.addChild(irqCpuEntry); break; } } } if (!found) { AggregateResourcesEntry aggregateInterruptEntry = new AggregateResourcesEntry(trace, startTime, endTime, type, resourceId); aggregateInterruptEntry.addContributor(interruptEntry); final AggregateResourcesEntry irqCpuEntry = new AggregateResourcesEntry(trace, cpuEntry.getName(), startTime, endTime, type, cpuEntry.getId()); irqCpuEntry.addContributor(interruptEntry); aggregateInterruptEntry.addChild(irqCpuEntry); traceEntry.addChild(aggregateInterruptEntry); } } else { interruptEntry.updateEndTime(endTime); } } }