1 /*******************************************************************************
2 * Copyright (c) 2015 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
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.lttng
.scope
.lttng
.kernel
.core
.analysis
.os
.handlers
.internal
;
15 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
16 import org
.lttng
.scope
.lttng
.kernel
.core
.analysis
.os
.Attributes
;
17 import org
.lttng
.scope
.lttng
.kernel
.core
.trace
.layout
.ILttngKernelEventLayout
;
19 import ca
.polymtl
.dorsal
.libdelorean
.ITmfStateSystemBuilder
;
20 import ca
.polymtl
.dorsal
.libdelorean
.exceptions
.AttributeNotFoundException
;
23 * Process free event handler
25 public class ProcessFreeHandler
extends KernelEventHandler
{
33 public ProcessFreeHandler(ILttngKernelEventLayout layout
) {
38 public void handleEvent(ITmfStateSystemBuilder ss
, ITmfEvent event
) throws AttributeNotFoundException
{
40 Integer cpu
= KernelEventHandlerUtils
.getCpu(event
);
41 Integer tid
= ((Long
) event
.getContent().getField(getLayout().fieldTid()).getValue()).intValue();
43 String threadAttributeName
= Attributes
.buildThreadAttributeName(tid
, cpu
);
44 if (threadAttributeName
== null) {
49 * Remove the process and all its sub-attributes from the current state
51 int quark
= ss
.getQuarkRelativeAndAdd(KernelEventHandlerUtils
.getNodeThreads(ss
), threadAttributeName
);
52 ss
.removeAttribute(KernelEventHandlerUtils
.getTimestamp(event
), quark
);