1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
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 * Bernd Hufmann - Initial API and implementation
11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
12 **********************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
;
15 import java
.util
.Iterator
;
16 import java
.util
.List
;
18 import org
.eclipse
.core
.commands
.ExecutionException
;
19 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
20 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceDomainType
;
21 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IBaseEventInfo
;
22 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.IUstProviderInfo
;
23 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.messages
.Messages
;
24 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.ITraceControlComponent
;
28 * Implementation of the trace provider group.
31 * @author Bernd Hufmann
33 public class TraceProviderGroup
extends TraceControlComponent
{
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
38 * Path to icon file for this component.
40 public static final String TRACE_PROVIDERS_ICON_FILE
= "icons/obj16/providers.gif"; //$NON-NLS-1$
42 // ------------------------------------------------------------------------
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
48 // ------------------------------------------------------------------------
51 * @param name - the name of the component.
52 * @param parent - the parent of this component.
54 public TraceProviderGroup(String name
, ITraceControlComponent parent
) {
56 setImage(TRACE_PROVIDERS_ICON_FILE
);
59 // ------------------------------------------------------------------------
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
65 // ------------------------------------------------------------------------
68 * Gets the provider information from the target node.
69 * @param monitor - a progress monitor
70 * @throws ExecutionException If the command fails
72 public void getProviderFromNode(IProgressMonitor monitor
) throws ExecutionException
{
74 List
<IBaseEventInfo
> eventInfos
= getControlService().getKernelProvider(monitor
);
76 if (!eventInfos
.isEmpty()) {
77 KernelProviderComponent component
= new KernelProviderComponent(Messages
.TraceControl_KernelProviderDisplayName
, this);
79 component
.setEventInfo(eventInfos
);
82 List
<IUstProviderInfo
> allProviders
= getControlService().getUstProvider(monitor
);
84 for (Iterator
<IUstProviderInfo
> iterator
= allProviders
.iterator(); iterator
.hasNext();) {
85 IUstProviderInfo ustProviderInfo
= iterator
.next();
86 UstProviderComponent ustComponent
= new UstProviderComponent(ustProviderInfo
.getName(), this);
87 addChild(ustComponent
);
88 ustComponent
.setUstProvider(ustProviderInfo
);
93 * Returns whether the kernel provider is available or not
94 * @return <code>true</code> if kernel provide is available or <code>false</code>
96 public boolean hasKernelProvider() {
97 List
<ITraceControlComponent
> kernelList
= getChildren(KernelProviderComponent
.class);
98 return !kernelList
.isEmpty();
102 * Returns if node supports filtering of events
103 * @param domain - the domain type ({@link TraceDomainType})
104 * @return <code>true</code> if node supports filtering else <code>false</code>
106 public boolean isEventFilteringSupported(TraceDomainType domain
) {
107 return ((TargetNodeComponent
)getParent()).isEventFilteringSupported(domain
);
111 * Checks if enabling of per syscall event is supported
113 * @return <code>true</code> if enabling of per syscall event is supported else <code>false</code>
115 public boolean isPerSyscallEventsSupported() {
116 return ((TargetNodeComponent
) getParent()).isPerSyscallEventsSupported();
120 * Returns if node supports JUL logging or not
121 * @return <code>true</code> if it supports JUL logging else <code>false</code>
124 public boolean isJulLoggingSupported() {
125 return ((TargetNodeComponent
) getParent()).isJulLoggingSupported();
128 * Returns if node supports LOG4J logging or not
129 * @return <code>true</code> if it supports LOG4J logging else <code>false</code>
132 public boolean isLog4jLoggingSupported() {
133 return ((TargetNodeComponent
) getParent()).isLog4jLoggingSupported();
136 * Returns if node supports Python logging or not
137 * @return <code>true</code> if it supports Python logging else <code>false</code>
140 public boolean isPythonLoggingSupported() {
141 return ((TargetNodeComponent
) getParent()).isPythonLoggingSupported();