Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.analysis.os.linux.core;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.analysis.os.linux.core.Activator
package org.eclipse.tracecompass.analysis.os.linux.core.trace;
import java.util.Collection;
+import java.util.Collections;
import org.eclipse.jdt.annotation.Nullable;
*/
String eventSchedProcessWakeupNew();
-
/**
* Starting the high resolution timer
* <p>
/**
* The kernel just allocated a page of memory.
* <p>
- * In Linux, this typically means a user space application just got a page of
- * ram.
+ * In Linux, this typically means a user space application just got a page
+ * of ram.
*
* @return the event name
* @since 2.0
*/
String eventKmemPageFree();
+ /**
+ * <em>Interprocessor interrupts</em> (IPIs) are special types of interrupts by which
+ * one processor will interrupt another in a multi-core and multi-cpu system. They are
+ * typically used for
+ * <ol>
+ * <li>cache flushes</li>
+ * <li>shutdowns</li>
+ * <ol>
+ * They are not logged with standard events, but rather events looking like
+ * "x86_irq_vectors_thermal_apic_exit".
+ * <p>
+ * This event describes the entries into IPIs.
+ *
+ * @return the IPI list
+ * @since 2.1
+ */
+ default Collection<String> getIPIIrqVectorsEntries() {
+ return Collections.emptyList();
+ }
+
+ /**
+ * <em>Interprocessor interrupts</em> (IPIs) are special types of interrupts by which
+ * one processor will interrupt another in a multi-core and multi-cpu system. They are
+ * typically used for
+ * <ol>
+ * <li>cache flushes</li>
+ * <li>shutdowns</li>
+ * <ol>
+ * They are not logged with standard events, but rather events looking like
+ * "x86_irq_vectors_thermal_apic_exit".
+ * <p>
+ * This event describes the exits into IPIs.
+ *
+ * @return the IPI list
+ * @since 2.1
+ */
+ default Collection<String> getIPIIrqVectorsExits() {
+ return Collections.emptyList();
+ }
+
// ------------------------------------------------------------------------
// Event field names
// ------------------------------------------------------------------------
String fieldHRtimer();
/**
- * The field with the expires value. The expires field holds the expiry time.
- * of the hrtimer.
+ * The field with the expires value. The expires field holds the expiry
+ * time. of the hrtimer.
*
* @return the name of the expires field
* @since 2.0
String fieldHRtimerExpires();
/**
- * Gets the field name with the softexpires value. The softexpire value is the
- * absolute earliest expiry time of the hrtimer.
+ * Gets the field name with the softexpires value. The softexpire value is
+ * the absolute earliest expiry time of the hrtimer.
*
* @return the name of the softexpires field
* @since 2.0
return "diskname"; //$NON-NLS-1$
}
+ /**
+ * The field with the IRQ number. This is used in IPI handlers (entry and
+ * exit).
+ *
+ * @return the name of the field with the IRQ number
+ * @since 2.1
+ */
+ default String fieldIPIVector() {
+ return "vector"; //$NON-NLS-1$
+ }
+
}
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.internal.analysis.os.linux.core.Activator;
+import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers.IPIEntryHandler;
+import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers.IPIExitHandler;
import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers.IrqEntryHandler;
import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers.IrqExitHandler;
import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers.KernelEventHandler;
* 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 = 17;
+ private static final int VERSION = 18;
// ------------------------------------------------------------------------
// Fields
builder.put(layout.eventSchedProcessFork(), new ProcessForkHandler(layout));
builder.put(layout.eventSchedProcessExit(), new ProcessExitHandler(layout));
builder.put(layout.eventSchedProcessFree(), new ProcessFreeHandler(layout));
+ for( String s : layout.getIPIIrqVectorsEntries()) {
+ builder.put(s, new IPIEntryHandler(layout));
+ }
+ for( String s : layout.getIPIIrqVectorsExits()) {
+ builder.put(s, new IPIExitHandler(layout));
+ }
final String eventStatedumpProcessState = layout.eventStatedumpProcessState();
if (eventStatedumpProcessState != null) {
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers;
+
+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;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+
+/**
+ * IPI Entry Handler
+ *
+ * @author Matthew Khouzam
+ */
+public class IPIEntryHandler extends KernelEventHandler {
+
+ /**
+ * Constructor
+ *
+ * @param layout
+ * event layout
+ */
+ public IPIEntryHandler(IKernelAnalysisEventLayout layout) {
+ super(layout);
+ }
+
+ @Override
+ public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException {
+
+ Integer cpu = KernelEventHandlerUtils.getCpu(event);
+ if (cpu == null) {
+ return;
+ }
+ Integer irqId = ((Long) event.getContent().getField(getLayout().fieldIPIVector()).getValue()).intValue();
+
+ /*
+ * Mark this IRQ as active in the resource tree. The state value = the
+ * CPU on which this IRQ is sitting
+ */
+ int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeIRQs(cpu, ss), irqId.toString());
+
+ ITmfStateValue value = TmfStateValue.newValueInt(cpu.intValue());
+ long timestamp = KernelEventHandlerUtils.getTimestamp(event);
+ ss.modifyAttribute(timestamp, value, quark);
+
+ /* Change the status of the running process to interrupted */
+ quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss), Attributes.STATUS);
+ 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);
+ value = StateValues.CPU_STATUS_IRQ_VALUE;
+ ss.modifyAttribute(timestamp, value, quark);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers;
+
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+
+/**
+ * IPI Exit Handler
+ *
+ * @author Matthew Khouzam
+ */
+public class IPIExitHandler extends KernelEventHandler {
+
+ /**
+ * Constructor
+ *
+ * @param layout
+ * event layout
+ */
+ public IPIExitHandler(IKernelAnalysisEventLayout layout) {
+ super(layout);
+ }
+
+ @Override
+ public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException {
+ Integer cpu = KernelEventHandlerUtils.getCpu(event);
+ if (cpu == null) {
+ return;
+ }
+ int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss);
+ Integer irqId = ((Long) event.getContent().getField(getLayout().fieldIPIVector()).getValue()).intValue();
+ /* Put this IRQ back to inactive in the resource tree */
+ int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeIRQs(cpu, ss), irqId.toString());
+ TmfStateValue value = TmfStateValue.nullValue();
+ long timestamp = KernelEventHandlerUtils.getTimestamp(event);
+ ss.modifyAttribute(timestamp, value, quark);
+
+ /* Set the previous process back to running */
+ KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss);
+
+ /* Set the CPU status back to running or "idle" */
+ KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss);
+ }
+}
import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
+
import com.google.common.collect.ImmutableSet;
/**
return IPI_EXIT_SET;
}
+ @Override
+ public @NonNull Collection<@NonNull String> getIPIIrqVectorsEntries() {
+ return getX86IrqVectorsEntry();
+ }
+
+ @Override
+ public @NonNull Collection<@NonNull String> getIPIIrqVectorsExits() {
+ return getX86IrqVectorsExit();
+ }
+
// ------------------------------------------------------------------------
// New field definitions in LTTng 2.7
// ------------------------------------------------------------------------