1 /*******************************************************************************
2 * Copyright (c) 2016 Ericsson
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.lttng
.scope
.lttng
.kernel
.core
.analysis
.os
.handlers
.internal
;
12 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
13 import org
.lttng
.scope
.lttng
.kernel
.core
.trace
.layout
.ILttngKernelEventLayout
;
15 import ca
.polymtl
.dorsal
.libdelorean
.ITmfStateSystemBuilder
;
16 import ca
.polymtl
.dorsal
.libdelorean
.exceptions
.AttributeNotFoundException
;
17 import ca
.polymtl
.dorsal
.libdelorean
.statevalue
.TmfStateValue
;
22 * @author Matthew Khouzam
24 public class IPIExitHandler
extends KernelEventHandler
{
32 public IPIExitHandler(ILttngKernelEventLayout layout
) {
37 public void handleEvent(ITmfStateSystemBuilder ss
, ITmfEvent event
) throws AttributeNotFoundException
{
38 Integer cpu
= KernelEventHandlerUtils
.getCpu(event
);
42 int currentThreadNode
= KernelEventHandlerUtils
.getCurrentThreadNode(cpu
, ss
);
43 Integer irqId
= ((Long
) event
.getContent().getField(getLayout().fieldIPIVector()).getValue()).intValue();
44 /* Put this IRQ back to inactive in the resource tree */
45 int quark
= ss
.getQuarkRelativeAndAdd(KernelEventHandlerUtils
.getNodeIRQs(cpu
, ss
), irqId
.toString());
46 TmfStateValue value
= TmfStateValue
.nullValue();
47 long timestamp
= KernelEventHandlerUtils
.getTimestamp(event
);
48 ss
.modifyAttribute(timestamp
, value
, quark
);
50 /* Set the previous process back to running */
51 KernelEventHandlerUtils
.setProcessToRunning(timestamp
, currentThreadNode
, ss
);
53 /* Set the CPU status back to running or "idle" */
54 KernelEventHandlerUtils
.cpuExitInterrupt(timestamp
, cpu
, ss
);