Commit | Line | Data |
---|---|---|
f9ff7d40 | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2014, 2015 Ericsson |
f9ff7d40 AM |
3 | * |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Alexandre Montplaisir - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.tracecompass.tmf.ctf.core.event.aspect; | |
14 | ||
f9ff7d40 AM |
15 | import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; |
16 | import org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect; | |
17 | import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent; | |
18 | ||
19 | /** | |
20 | * "CPU" event aspect for CTF traces. | |
21 | * | |
22 | * @author Alexandre Montplaisir | |
23 | */ | |
24 | public class CtfCpuAspect extends TmfCpuAspect { | |
25 | ||
26 | @Override | |
52293ccd | 27 | public Integer resolve(ITmfEvent event) { |
f9ff7d40 | 28 | if (!(event instanceof CtfTmfEvent)) { |
2a28075c | 29 | return null; |
f9ff7d40 AM |
30 | } |
31 | int cpu = ((CtfTmfEvent) event).getCPU(); | |
52293ccd | 32 | return cpu; |
f9ff7d40 | 33 | } |
f9ff7d40 | 34 | } |