2 * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
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
10 package org
.lttng
.scope
.lttng
.kernel
.core
.views
.timegraph
.resources
.elements
;
12 import java
.util
.List
;
13 import java
.util
.function
.Predicate
;
15 import org
.eclipse
.jdt
.annotation
.NonNull
;
16 import org
.eclipse
.tracecompass
.ctf
.tmf
.core
.event
.CtfTmfEvent
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
18 import org
.lttng
.scope
.tmf2
.views
.core
.timegraph
.model
.provider
.statesystem
.StateSystemTimeGraphTreeElement
;
19 import org
.lttng
.scope
.tmf2
.views
.core
.timegraph
.model
.render
.tree
.TimeGraphTreeElement
;
22 * Element of the Resources time graph which represents a CPU.
24 * @author Alexandre Montplaisir
26 public class ResourcesCpuTreeElement
extends StateSystemTimeGraphTreeElement
{
28 private final int fCpu
;
34 * The CPU of this CPU tree element
38 * The corresponding quark (under the "CPUs" sub-tree) in the
41 public ResourcesCpuTreeElement(int cpu
,
42 List
<TimeGraphTreeElement
> children
, int sourceQuark
) {
43 super(Messages
.treeElementPrefixCpu
+ ' ' + String
.valueOf(cpu
),
51 * Get the CPU represented by this tree element
53 * @return The CPU number
60 public @NonNull Predicate
<ITmfEvent
> getEventMatching() {
62 // FIXME The notion of CPU should be in the base framework.
63 if (!(event
instanceof CtfTmfEvent
)) {
66 CtfTmfEvent ctfEvent
= (CtfTmfEvent
) event
;
67 return (fCpu
== ctfEvent
.getCPU());