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
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.kernel
.handlers
;
12 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.kernel
.StateValues
;
13 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
14 import org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.kernel
.Attributes
;
15 import org
.eclipse
.tracecompass
.statesystem
.core
.ITmfStateSystemBuilder
;
16 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.AttributeNotFoundException
;
17 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
18 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.TmfStateValue
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
24 * @author Matthew Khouzam
26 public class IPIEntryHandler
extends KernelEventHandler
{
34 public IPIEntryHandler(IKernelAnalysisEventLayout layout
) {
39 public void handleEvent(ITmfStateSystemBuilder ss
, ITmfEvent event
) throws AttributeNotFoundException
{
41 Integer cpu
= KernelEventHandlerUtils
.getCpu(event
);
45 Integer irqId
= ((Long
) event
.getContent().getField(getLayout().fieldIPIVector()).getValue()).intValue();
48 * Mark this IRQ as active in the resource tree. The state value = the
49 * CPU on which this IRQ is sitting
51 int quark
= ss
.getQuarkRelativeAndAdd(KernelEventHandlerUtils
.getNodeIRQs(cpu
, ss
), irqId
.toString());
53 ITmfStateValue value
= TmfStateValue
.newValueInt(cpu
.intValue());
54 long timestamp
= KernelEventHandlerUtils
.getTimestamp(event
);
55 ss
.modifyAttribute(timestamp
, value
, quark
);
57 /* Change the status of the running process to interrupted */
58 quark
= ss
.getQuarkRelativeAndAdd(KernelEventHandlerUtils
.getCurrentThreadNode(cpu
, ss
), Attributes
.STATUS
);
59 value
= StateValues
.PROCESS_STATUS_INTERRUPTED_VALUE
;
60 ss
.modifyAttribute(timestamp
, value
, quark
);
62 /* Change the status of the CPU to interrupted */
63 quark
= ss
.getQuarkRelativeAndAdd(KernelEventHandlerUtils
.getCurrentCPUNode(cpu
, ss
), Attributes
.STATUS
);
64 value
= StateValues
.CPU_STATUS_IRQ_VALUE
;
65 ss
.modifyAttribute(timestamp
, value
, quark
);