org.eclipse.tracecompass.ctf.core,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.tmf.ctf.core
-Export-Package: org.eclipse.tracecompass.internal.lttng2.control.core;x-friends:="org.eclipse.tracecompass.lttng2.control.core.tests,org.eclipse.tracecompass.lttng2.control.ui",
+Export-Package: org.eclipse.tracecompass.internal.lttng2.control.core;x-friends:="org.eclipse.tracecompass.lttng2.control.core.tests,org.eclipse.tracecompass.lttng2.control.ui,org.eclipse.tracecompass.lttng2.control.ui.tests",
org.eclipse.tracecompass.internal.lttng2.control.core.model;
x-friends:="org.eclipse.tracecompass.lttng2.control.ui,
org.eclipse.tracecompass.lttng2.control.ui.tests,
void addChannel(IChannelInfo channel);
/**
- * @return true if domain is kernel, false for UST
+ * @return the domain type ({@link TraceDomainType})
*/
- boolean isKernel();
+ TraceDomainType getDomain();
/**
- * Sets whether domain is Kernel domain or UST
- * @param isKernel true for kernel, false for UST
+ * Sets the domain type.
+ * @param domain - the domain type ({@link TraceDomainType})
*/
- void setIsKernel(boolean isKernel);
+ void setDomain(TraceDomainType domain);
/**
* @return Information about the buffer type
/**********************************************************************
- * Copyright (c) 2014 Ericsson
+ * Copyright (c) 2014, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* Contributors:
* Jonathan Rajotte - Initial API and implementation
**********************************************************************/
-
package org.eclipse.tracecompass.internal.lttng2.control.core.model;
/**
* @author Jonathan Rajotte
*/
public enum TraceDomainType {
- /** Domain type : ust */
- UST("ust"), //$NON-NLS-1$
- /** Domain type : kernel */
+ /** Linux kernel domain */
KERNEL("kernel"), //$NON-NLS-1$
- /** Domain type : jul */
- JUL("jul"), //$NON-NLS-1$
- /** Unknown domain type */
+ /** user space domain */
+ UST("ust"), //$NON-NLS-1$
+ /** java.util.logging (JUL) domain */
+ JUL("jul"), //$NON-NLS-1$s
+ /** log4j domain */
+ LOG4J("log4j"), //$NON-NLS-1$
+ /** python domain */
+ PYTHON("python"), //$NON-NLS-1$
+ /** Unknown domain */
UNKNOWN("Unknown domain type"); //$NON-NLS-1$
private final String fInName;
// Unknown domain
return UNKNOWN;
}
-}
\ No newline at end of file
+}
import java.util.Iterator;
import java.util.List;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
* The channels information of the domain.
*/
private final List<IChannelInfo> fChannels = new ArrayList<>();
- private boolean fIsKernel = false;
+ private TraceDomainType fDomain = TraceDomainType.UST;
private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN;
// ------------------------------------------------------------------------
fChannels.add(other.fChannels.get(i));
}
}
- fIsKernel = other.fIsKernel;
+ fDomain = other.getDomain();
fBufferType = other.fBufferType;
}
@Override
- public boolean isKernel() {
- return fIsKernel;
+ public TraceDomainType getDomain() {
+ return fDomain;
}
@Override
- public void setIsKernel(boolean isKernel) {
- fIsKernel = isKernel;
+ public void setDomain(TraceDomainType domain) {
+ fDomain = domain;
}
// ------------------------------------------------------------------------
final int prime = 31;
int result = super.hashCode();
result = prime * result + fChannels.hashCode();
- result = prime * result + (fIsKernel ? 1231 : 1237);
+ result = prime * result + ((fDomain == null) ? 0 : (fDomain.ordinal() + 1));
result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1));
return result;
}
if (!fChannels.equals(other.fChannels)) {
return false;
}
- if (fIsKernel != other.fIsKernel) {
+ if (fDomain == null) {
+ if (other.fDomain != null) {
+ return false;
+ }
+ } else if (!fDomain.equals(other.fDomain)) {
return false;
}
if (fBufferType != other.fBufferType) {
@Override
public BufferType getBufferType() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return BufferType.BUFFER_SHARED;
}
return fBufferType;
}
}
output.append(",isKernel=");
- output.append(String.valueOf(fIsKernel));
+ output.append(String.valueOf(fDomain.equals(TraceDomainType.KERNEL)));
if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) {
output.append(",BufferType=");
output.append(fBufferType);
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tracecompass.internal.lttng2.control.core.Activator;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IEventInfo;
for (IDomainInfo domain : session.getDomains()) {
Element domainElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
- /*
- * Add everything specific to a domain
- *
- * TODO: We suppose here that domain is either kernel or UST. It
- * will have to change if other domains are supported
- */
- String domainType = domain.isKernel() ? SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL : SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST;
+ String domainType = null;
+ switch (domain.getDomain()) {
+ case KERNEL:
+ domainType = SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL;
+ break;
+ case UST:
+ domainType = SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST;
+ break;
+ // TODO: Add the following cases when more domains are supported
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
+
+ }
addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, domainType);
String bufferType = null;
addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE, bufferType);
/* Add the channels */
- domainElement.appendChild(getChannelsElement(document, domain.isKernel(), domain.getChannels()));
+ domainElement.appendChild(getChannelsElement(document, domain.getDomain(), domain.getChannels()));
domainsElement.appendChild(domainElement);
}
*
* @param document
* The document in which the nodes are being added
- * @param isKernel
- * Is it a kernel domain type
+ * @param domain
+ * The domain type ({@link TraceDomainType})
* @param channels
* The channels to be added as elements
* @return The channels element as an XML element
*/
- private static Element getChannelsElement(Document document, boolean isKernel, IChannelInfo[] channels) {
+ private static Element getChannelsElement(Document document, TraceDomainType domain, IChannelInfo[] channels) {
Element channelsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CHANNELS);
for (IChannelInfo channel : channels) {
addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_LIVE_TIMER_INTERVAL, SessionConfigStrings.CONFIG_STRING_ZERO);
/* Add the events */
- channelElement.appendChild(getEventsElement(document, isKernel, channel.getEvents()));
+ channelElement.appendChild(getEventsElement(document, domain, channel.getEvents()));
channelsElement.appendChild(channelElement);
}
*
* @param document
* The document in which the nodes are being added
- * @param isKernel
- * Is the domain type kernel
+ * @param domain
+ * The domain type ({@link TraceDomainType})
* @param events
* The event informations to be added
* @return An element containing all the event informations as XML elements
*/
- private static Element getEventsElement(Document document, boolean isKernel, IEventInfo[] events) {
+ private static Element getEventsElement(Document document, TraceDomainType domain, IEventInfo[] events) {
Element eventsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_EVENTS);
for (IEventInfo event : events) {
}
/* Specific to UST session config: the log level */
- if (!isKernel && !event.getLogLevel().equals(TraceLogLevel.LEVEL_UNKNOWN)) {
+ if (domain.equals(TraceDomainType.UST) && !event.getLogLevel().equals(TraceLogLevel.LEVEL_UNKNOWN)) {
addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_LOGLEVEL, event.getLogLevel().ordinal());
}
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
// Enable channel on session
// ------------------------------------------------------------------------
EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
- channelStub.setIsKernel(true);
+ channelStub.setDomain(TraceDomainType.KERNEL);
TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
fFacility.executeCommand(session, "enableChannelOnSession");
events.add("sched_kthread_stop");
events.add("sched_kthread_stop_ret");
eventsDialogStub.setNames(events);
- eventsDialogStub.setIsKernel(true);
+ eventsDialogStub.setDomain(TraceDomainType.KERNEL);
TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
// ------------------------------------------------------------------------
package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
private static void verifyDomainGettersSetters(TraceDomainComponent domain) {
// save original values
- boolean isKernel = domain.isKernel();
-
- domain.setIsKernel(false);
- assertFalse(domain.isKernel());
- domain.setIsKernel(true);
- assertTrue(domain.isKernel());
+ TraceDomainType tmpDomain = domain.getDomain();
+
+ domain.setDomain(TraceDomainType.KERNEL);
+ assertEquals(domain.getDomain(), TraceDomainType.KERNEL);
+ domain.setDomain(TraceDomainType.UST);
+ assertEquals(domain.getDomain(), TraceDomainType.UST);
+ domain.setDomain(TraceDomainType.JUL);
+ assertEquals(domain.getDomain(), TraceDomainType.JUL);
+ domain.setDomain(TraceDomainType.LOG4J);
+ assertEquals(domain.getDomain(), TraceDomainType.LOG4J);
+ domain.setDomain(TraceDomainType.PYTHON);
+ assertEquals(domain.getDomain(), TraceDomainType.PYTHON);
+ domain.setDomain(TraceDomainType.UNKNOWN);
+ assertEquals(domain.getDomain(), TraceDomainType.UNKNOWN);
ITraceControlComponent[] children = domain.getChildren();
TraceChannelComponent[] channels = domain.getChannels();
assertEquals(TARGET_NODE_NAME, nodeName);
// restore original values
- domain.setIsKernel(isKernel);
+ domain.setDomain(tmpDomain);
}
private static void verifyBaseEventGettersSetters(BaseEventComponent event) {
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
// ------------------------------------------------------------------------
fProxy.setScenario(SCEN_SCENARIO2_TEST);
EnableChannelDialogStub channelDialogStub = new EnableChannelDialogStub();
- channelDialogStub.setIsKernel(false);
+ channelDialogStub.setDomain(TraceDomainType.UST);
channelDialogStub.getChannelInfo().setOverwriteMode(false);
channelDialogStub.getChannelInfo().setSwitchTimer(200);
channelDialogStub.getChannelInfo().setReadTimer(100);
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
// Enable default channel on created session above
// ------------------------------------------------------------------------
EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
- channelStub.setIsKernel(false);
+ channelStub.setDomain(TraceDomainType.UST);
ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
info.setName("mychannel");
info.setOverwriteMode(false);
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
// Enable default channel on created session above
// ------------------------------------------------------------------------
EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
- channelStub.setIsKernel(false);
+ channelStub.setDomain(TraceDomainType.UST);
TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
fFacility.executeCommand(session, "enableChannelOnSession");
List<String> events = new ArrayList<>();
events.add("ust_tests_hello:tptest_sighandler");
eventsDialogStub.setNames(events);
- eventsDialogStub.setIsKernel(false);
+ eventsDialogStub.setDomain(TraceDomainType.UST);
TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
fFacility.executeCommand(session, "enableEventOnSession");
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IUstProviderInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
private static final String SCEN_DESTROY_SESSION_VERBOSE = "DestroySessionVerbose";
private static final String SCEN_CHANNEL_HANDLING = "ChannelHandling";
private static final String SCEN_EVENT_HANDLING = "EventHandling";
- private static final String SCEN_EVENT_EXLUDED = "EventExcluded";
+ private static final String SCEN_EVENT_EXCLUDED = "EventExcluded";
private static final String SCEN_CONTEXT_HANDLING = "ContextHandling";
private static final String SCEN_CONTEXT_ERROR_HANDLING = "ContextErrorHandling";
private static final String SCEN_CREATE_SESSION_2_1 = "CreateSessionLttng2.1";
chanInfo.setNumberOfSubBuffers(2);
chanInfo.setMaxNumberTraceFiles(10);
chanInfo.setMaxSizeTraceFiles(0);
- fService.enableChannels(sessionName, list, true, chanInfo, new NullProgressMonitor());
+ fService.enableChannels(sessionName, list, TraceDomainType.KERNEL, chanInfo, new NullProgressMonitor());
// Create/enable/configure 1 UST channel
list.clear();
chanInfo.setNumberOfSubBuffers(1);
chanInfo.setMaxNumberTraceFiles(20);
chanInfo.setMaxSizeTraceFiles(0);
- fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+ fService.enableChannels(sessionName, list, TraceDomainType.UST, chanInfo, new NullProgressMonitor());
((LTTngControlService)fService).setVersion("2.0.0");
} catch (ExecutionException e) {
chanInfo.setMaxNumberTraceFiles(20);
chanInfo.setMaxSizeTraceFiles(0);
chanInfo.setBufferType(BufferType.BUFFER_PER_UID);
- fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+ fService.enableChannels(sessionName, list, TraceDomainType.UST, chanInfo, new NullProgressMonitor());
((LTTngControlService)fService).setVersion("2.0.0");
} catch (ExecutionException e) {
chanInfo.setMaxSizeTraceFiles(-1);
chanInfo.setBufferType(BufferType.BUFFER_PER_PID);
- fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+ fService.enableChannels(sessionName, list, TraceDomainType.UST, chanInfo, new NullProgressMonitor());
((LTTngControlService)fService).setVersion("2.0.0");
} catch (ExecutionException e) {
list.add(kernelChannel1);
fShell.setScenario(SCEN_CHANNEL_HANDLING);
- fService.disableChannels(sessionName, list, true, new NullProgressMonitor());
+ fService.disableChannels(sessionName, list, TraceDomainType.KERNEL, new NullProgressMonitor());
list.clear();
list.add("ustChannel");
- fService.disableChannels(sessionName, list, false, new NullProgressMonitor());
+ fService.disableChannels(sessionName, list, TraceDomainType.UST, new NullProgressMonitor());
} catch (ExecutionException e) {
fail(e.toString());
list.add(kernelChannel1);
fShell.setScenario(SCEN_CHANNEL_HANDLING);
- fService.enableChannels(sessionName, list, true, null, new NullProgressMonitor());
+ fService.enableChannels(sessionName, list, TraceDomainType.KERNEL, null, new NullProgressMonitor());
// Create/enable/configure 1 UST channel
list.clear();
list.add("ustChannel");
- fService.enableChannels(sessionName, list, false, null, new NullProgressMonitor());
+ fService.enableChannels(sessionName, list, TraceDomainType.UST, null, new NullProgressMonitor());
} catch (ExecutionException e) {
fail(e.toString());
eventList.add(eventName0);
eventList.add(eventName1);
eventList.add(eventName2);
- fService.enableEvents(sessionName, null, eventList, true, null, null, new NullProgressMonitor());
+ fService.enableEvents(sessionName, null, eventList, TraceDomainType.KERNEL, null, null, new NullProgressMonitor());
// 2) session name, channel = mychannel, event name= null, kernel
- fService.enableEvents(sessionName, channelName, null, true, null, null, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, null, TraceDomainType.KERNEL, null, null, new NullProgressMonitor());
// 3) session name, channel = mychannel, 1 event name, ust, no filter
eventList.clear();
eventList.add(ustEventName0);
- fService.enableEvents(sessionName, channelName, eventList, false, null, null, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, eventList, TraceDomainType.UST, null, null, new NullProgressMonitor());
// 4) session name, channel = mychannel, no event name, ust, with filter
- fService.enableEvents(sessionName, channelName, eventList, false, "intfield==10", null, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, eventList, TraceDomainType.UST, "intfield==10", null, new NullProgressMonitor());
// 5) session name, channel = mychannel, no event name, ust, no filter
eventList.clear();
- fService.enableEvents(sessionName, channelName, eventList, false, null, null, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, eventList, TraceDomainType.UST, null, null, new NullProgressMonitor());
// 6) session name, channel = null,
- fService.enableEvents(sessionName, null, ILttngControlService.ALL_EVENTS, true, null, null, new NullProgressMonitor());
+ fService.enableEvents(sessionName, null, ILttngControlService.ALL_EVENTS, TraceDomainType.KERNEL, null, null, new NullProgressMonitor());
// 7) session name, channel = mychannel, all events, ust, exclude 1 event
excludeList.add(ustEventName0);
- fService.enableEvents(sessionName, channelName, null, false, null, excludeList, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, null, TraceDomainType.UST, null, excludeList, new NullProgressMonitor());
// 8) session name, channel = mychannel, all events, ust, exclude 2 events
excludeList.add(ustEventName1);
- fService.enableEvents(sessionName, channelName, null, false, null, excludeList, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, null, TraceDomainType.UST, null, excludeList, new NullProgressMonitor());
// 9) session name, channel = mychannel, enable 'ust*', ust, exclude 2 events
eventList.add(ustEventWildcard);
- fService.enableEvents(sessionName, channelName, eventList, false, null, excludeList, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, eventList, TraceDomainType.UST, null, excludeList, new NullProgressMonitor());
} catch (ExecutionException e) {
fail(e.toString());
@NonNull
LttngVersion version = fService.getVersion();
- fShell.setScenario(SCEN_EVENT_EXLUDED);
+ fShell.setScenario(SCEN_EVENT_EXCLUDED);
// 1) 1 event excluded
eventList.add(ustEventWildcard);
excludeList.add(ustEventName0);
- fService.enableEvents(sessionName, channelName, eventList, false, null, excludeList, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, eventList, TraceDomainType.UST, null, excludeList, new NullProgressMonitor());
@Nullable
ISessionInfo session = fService.getSession(sessionName, new NullProgressMonitor());
// 2) 2 events excluded
excludeList.add(ustEventName1);
- fService.enableEvents(sessionName, channelName, eventList, false, null, excludeList, new NullProgressMonitor());
+ fService.enableEvents(sessionName, channelName, eventList, TraceDomainType.UST, null, excludeList, new NullProgressMonitor());
session = fService.getSession(sessionName, new NullProgressMonitor());
assertNotNull(session);
assertTrue(expectedContexts.containsAll(availContexts));
// 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
- fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
+ fService.addContexts(sessionName, channelName, eventName, TraceDomainType.UST, contexts, new NullProgressMonitor());
} catch (ExecutionException e) {
fail(e.toString());
}
try {
// 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
- fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
+ fService.addContexts(sessionName, channelName, eventName, TraceDomainType.UST, contexts, new NullProgressMonitor());
fail("No exeption generated");
} catch (ExecutionException e) {
// success
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
- private TraceDomainComponent fDomain;
+ private TraceDomainComponent fDomainComponent;
private ChannelInfo fChannelInfo;
- private boolean fIsKernel;
+ private TraceDomainType fDomain;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
- public void setIsKernel(boolean isKernel) {
- fIsKernel = isKernel;
- }
@Override
public IChannelInfo getChannelInfo() {
@Override
public void setDomainComponent(TraceDomainComponent domain) {
- fDomain = domain;
- if (fDomain != null) {
- fIsKernel = fDomain.isKernel();
+ fDomainComponent = domain;
+ if (fDomainComponent != null) {
+ fDomain = fDomainComponent.getDomain();
}
}
}
@Override
- public boolean isKernel() {
- return fIsKernel;
+ public TraceDomainType getDomain() {
+ return fDomain;
+ }
+
+ public void setDomain(TraceDomainType domain) {
+ fDomain = domain;
}
@Override
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.IEnableEventsDialog;
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
- private boolean fIsKernel;
private boolean fIsTracePoints;
private boolean fIsAllEvents;
private boolean fIsAllTracePoints;
private String fFilter;
private List<String> fNames = new ArrayList<>();
private List<String> fExcludedEvents;
+ private TraceDomainType fDomain;
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
- public void setIsKernel(boolean isKernel) {
- fIsKernel = isKernel;
+ public void setDomain(TraceDomainType domain) {
+ fDomain = domain;
}
public void setIsAllEvents(boolean isAllEvents) {
}
@Override
- public boolean isKernel() {
- return fIsKernel;
+ public TraceDomainType getDomain() {
+ return fDomain;
}
@Override
import java.util.Arrays;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.IGetEventInfoDialog;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
}
@Override
- public void setIsKernel(boolean isKernel) {
+ public void setDomain(TraceDomainType domain) {
}
@Override
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
* The parent domain component where the channel node should be added.
* Null in case of creation on session level.
*/
- private TraceDomainComponent fDomain = null;
+ private TraceDomainComponent fDomainComponent = null;
/**
* The target node component
*/
*/
private IChannelInfo fChannelInfo = null;
/**
- * Output domain information. True in case of Kernel domain. False for UST.
+ * Domain type ({@link TraceDomainType})
*/
- private boolean fIsKernel;
+ private TraceDomainType fDomain = null;
/**
* Flag which indicates whether Kernel domain is available or not
*/
*/
public EnableChannelDialog(Shell shell) {
super(shell);
- fIsKernel = true;
+ fDomain = TraceDomainType.KERNEL;
// Common verify listener
fVerifyListener = new VerifyListener() {
@Override
public void setDomainComponent(TraceDomainComponent domain) {
- fDomain = domain;
- if (fDomain != null) {
- fIsKernel = fDomain.isKernel();
+ fDomainComponent = domain;
+ if (fDomainComponent != null) {
+ fDomain = fDomainComponent.getDomain();
} else {
- fIsKernel = true;
+ fDomain = TraceDomainType.KERNEL;
}
}
@Override
- public boolean isKernel() {
- return fIsKernel;
+ public TraceDomainType getDomain() {
+ return fDomain;
}
@Override
public void setHasKernel(boolean hasKernel) {
- if (fDomain != null) {
- fIsKernel = fDomain.isKernel();
+ if (fDomainComponent != null) {
+ fDomain = fDomainComponent.getDomain();
} else {
- fIsKernel = hasKernel;
+ fDomain = hasKernel ? TraceDomainType.KERNEL : TraceDomainType.UST;
}
fHasKernel = hasKernel;
fKernelButton = new Button(domainGroup, SWT.RADIO);
fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName);
- fKernelButton.setSelection(fIsKernel);
+ fKernelButton.setSelection(fDomain.equals(TraceDomainType.KERNEL));
fUstButton = new Button(domainGroup, SWT.RADIO);
fUstButton.setText(Messages.TraceControl_UstDisplayName);
- fUstButton.setSelection(!fIsKernel);
+ fUstButton.setSelection(fDomain.equals(TraceDomainType.UST));
if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
Group bufferTypeGroup = new Group(dialogComposite, SWT.SHADOW_NONE);
fSharedBuffersButton = new Button(bufferTypeGroup, SWT.RADIO);
fSharedBuffersButton.setText(Messages.TraceControl_SharedBuffersDisplayName);
- fSharedBuffersButton.setSelection(fIsKernel);
+ fSharedBuffersButton.setSelection(fDomain.equals(TraceDomainType.KERNEL));
fSharedBuffersButton.setEnabled(false);
fPIDBuffersButton = new Button(bufferTypeGroup, SWT.RADIO);
fUIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip);
fUIDBuffersButton.setSelection(false);
- fUIDBuffersButton.setEnabled(!fIsKernel);
- fPIDBuffersButton.setEnabled(!fIsKernel);
+ fUIDBuffersButton.setEnabled(fDomain.equals(TraceDomainType.UST));
+ fPIDBuffersButton.setEnabled(fDomain.equals(TraceDomainType.UST));
// Update buffers type buttons depending on UST or Kernel
fUstButton.addSelectionListener(new SelectionAdapter() {
});
}
- if ((fDomain != null) || (!fHasKernel)) {
+ if ((fDomainComponent != null) || (!fHasKernel)) {
fKernelButton.setEnabled(false);
fUstButton.setEnabled(false);
}
}
- fIsKernel = fKernelButton.getSelection();
+ if (fKernelButton.getSelection()) {
+ fDomain = TraceDomainType.KERNEL;
+ }
+ else if (fUstButton.getSelection()) {
+ fDomain = TraceDomainType.UST;
+ }
// Check for invalid names
if (!channelInfo.getName().matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$
}
// Check for duplicate names
- if (fDomain != null && fDomain.containsChild(channelInfo.getName())) {
+ if (fDomainComponent != null && fDomainComponent.containsChild(channelInfo.getName())) {
MessageDialog.openError(getShell(),
Messages.TraceControl_EnableChannelDialogTitle,
Messages.TraceControl_ChannelAlreadyExistsError + " (" + channelInfo.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
}
private void setBufferTypeButtonSelection() {
- if ((fDomain != null) && fDomain.getBufferType() != null) {
- switch (fDomain.getBufferType()) {
+ if ((fDomainComponent != null) && fDomainComponent.getBufferType() != null) {
+ switch (fDomainComponent.getBufferType()) {
case BUFFER_PER_PID:
fPIDBuffersButton.setSelection(true);
break;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
* The parent domain component where the channel node should be added.
* Null in case the domain is not known (i.e. on session level).
*/
- private TraceDomainComponent fDomain;
+ private TraceDomainComponent fDomainComponent;
/**
- * Output domain information. True in case of Kernel domain. False for UST.
+ * The domain type ({@link TraceDomainType})
*/
- private boolean fIsKernel;
+ private TraceDomainType fDomain;
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
@Override
public boolean isAllEvents() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isAllEvents();
}
return false;
@Override
public boolean isTracepoints() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isTracepoints();
}
return fUstComposite.isTracepoints();
@Override
public boolean isAllTracePoints() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isAllTracePoints();
}
return fUstComposite.isAllTracePoints();
@Override
public boolean isSysCalls() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isSysCalls();
}
return false;
@Override
public boolean isAllSysCalls() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isSysCalls();
}
return false;
@Override
public List<String> getEventNames() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.getEventNames();
}
return fUstComposite.getEventNames();
@Override
public boolean isDynamicProbe() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isDynamicProbe();
}
return false;
@Override
public String getProbeName() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.getProbeName();
}
return null;
@Override
public String getProbeEventName() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.getProbeEventName();
}
return null;
@Override
public boolean isDynamicFunctionProbe() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.isDynamicFunctionProbe();
}
return false;
@Override
public String getFunctionEventName() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.getFunctionEventName();
}
return null;
@Override
public String getFunction() {
- if (fIsKernel) {
+ if (fDomain.equals(TraceDomainType.KERNEL)) {
return fKernelComposite.getFunction();
}
return null;
@Override
public boolean isWildcard() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.isWildcard();
}
return false;
@Override
public String getWildcard() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.getWildcard();
}
return null;
@Override
public boolean isLogLevel() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.isLogLevel();
}
return false;
@Override
public LogLevelType getLogLevelType() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.getLogLevelType();
}
return null;
@Override
public TraceLogLevel getLogLevel() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.getLogLevel();
}
return null;
@Override
public String getLogLevelEventName() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.getLogLevelEventName();
}
return null;
}
@Override
- public boolean isKernel() {
- return fIsKernel;
+ public TraceDomainType getDomain() {
+ return fDomain;
}
@Override
@Override
public void setTraceDomainComponent(TraceDomainComponent domain) {
- fDomain = domain;
- if (fDomain != null) {
- fIsKernel = fDomain.isKernel();
+ fDomainComponent = domain;
+ if (fDomainComponent != null) {
+ fDomain = fDomainComponent.getDomain();
} else {
- fIsKernel = fProviderGroup != null ? fProviderGroup.hasKernelProvider() : true;
+ if (fProviderGroup != null) {
+ fDomain = fProviderGroup.hasKernelProvider() ? TraceDomainType.KERNEL : TraceDomainType.UST;
+ }
}
}
@Override
public String getFilterExpression() {
- if (fIsKernel) {
+
+ switch (fDomain) {
+ case KERNEL:
return fKernelComposite.getFilterExpression();
+ case UST:
+ return fUstComposite.getFilterExpression();
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ return null;
}
- return fUstComposite.getFilterExpression();
}
@Override
public List<String> getExcludedEvents() {
- if (!fIsKernel) {
+ if (fDomain.equals(TraceDomainType.UST)) {
return fUstComposite.getExcludedEvents();
}
return null;
fKernelButton = new Button(domainGroup, SWT.RADIO);
fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName);
- fKernelButton.setSelection(fIsKernel);
fUstButton = new Button(domainGroup, SWT.RADIO);
fUstButton.setText(Messages.TraceControl_UstDisplayName);
- fUstButton.setSelection(!fIsKernel);
- if ((fDomain != null) || ((fProviderGroup != null) && (!fProviderGroup.hasKernelProvider()))) {
+ switch (fDomain) {
+ case KERNEL:
+ fKernelButton.setSelection(true);
+ break;
+ case UST:
+ fUstButton.setSelection(true);
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
+ }
+
+ if ((fDomainComponent != null) || ((fProviderGroup != null) && (!fProviderGroup.hasKernelProvider()))) {
fKernelButton.setEnabled(false);
fUstButton.setEnabled(false);
}
// ------------------------------------------------------------------------
fUstComposite = null;
fKernelComposite = null;
- if (fIsKernel) {
+
+ switch (fDomain) {
+
+ case KERNEL:
createKernelComposite();
- fUstComposite = null;
- } else {
+ break;
+ case UST:
createUstComposite();
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
}
fKernelButton.addSelectionListener(new SelectionAdapter() {
@Override
protected void okPressed() {
- fIsKernel = fKernelButton.getSelection();
+
+ if (fKernelButton.getSelection()) {
+ fDomain = TraceDomainType.KERNEL;
+ } else if (fUstButton.getSelection()){
+ fDomain = TraceDomainType.UST;
+ }
// Validate kernel composite in case of kernel domain
if (fKernelComposite != null && !fKernelComposite.isValid()) {
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.BaseEventComponent;
// initialize filter with null
fFilterExpression = null;
- if (fProviderGroup.isEventFilteringSupported(true)) {
+ if (fProviderGroup.isEventFilteringSupported(TraceDomainType.KERNEL)) {
String tempFilter = fFilterText.getText();
if(!tempFilter.trim().isEmpty()) {
}
private void createFilterGroup() {
- if (fProviderGroup.isEventFilteringSupported(true)) {
+ if (fProviderGroup.isEventFilteringSupported(TraceDomainType.KERNEL)) {
Group filterMainGroup = new Group(this, SWT.SHADOW_NONE);
filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName);
GridLayout layout = new GridLayout(3, false);
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
// initialize filter with null
fFilterExpression = null;
- if (fProviderGroup.isEventFilteringSupported(false)) {
+ if (fProviderGroup.isEventFilteringSupported(TraceDomainType.UST)) {
String tempFilter = fFilterText.getText();
if(!tempFilter.trim().isEmpty()) {
}
void createFilterGroup() {
- if (fProviderGroup.isEventFilteringSupported(false)) {
+ if (fProviderGroup.isEventFilteringSupported(TraceDomainType.UST)) {
Group filterMainGroup = new Group(this, SWT.SHADOW_NONE);
filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName);
GridLayout layout = new GridLayout(3, false);
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
*/
private TraceSessionComponent[] fSessions;
/**
- * True for kernel, false for UST.
+ * The domain type ({@link TraceDomainType})
*/
- private boolean fIsKernel;
+ private TraceDomainType fDomain;
/**
* Index in session array (selected session).
*/
}
@Override
- public void setIsKernel(boolean isKernel) {
- fIsKernel = isKernel;
+ public void setDomain(TraceDomainType domain) {
+ fDomain = domain;
}
@Override
TraceDomainComponent[] domains = fSessions[fSessionIndex].getDomains();
for (int i = 0; i < domains.length; i++) {
- if (domains[i].isKernel() == fIsKernel) {
+ if (domains[i].getDomain().equals(fDomain)) {
domain = domains[i];
break;
}
});
// take first session to test whether events filtering is supported or not
- if (fSessions[0].isEventFilteringSupported(fIsKernel)) {
+ if (fSessions[0].isEventFilteringSupported(fDomain)) {
Group filterMainGroup = new Group(dialogComposite, SWT.SHADOW_NONE);
filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName);
layout = new GridLayout(2, false);
// initialize filter with null
fFilterExpression = null;
- if (fSessions[0].isEventFilteringSupported(fIsKernel)) {
+ if (fSessions[0].isEventFilteringSupported(fDomain)) {
String tempFilter = fFilterText.getText();
if(!tempFilter.trim().isEmpty()) {
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
void setTargetNodeComponent(TargetNodeComponent node);
/**
- * @return true for Kernel domain. False for UST.
+ * @return The domain type ({@link TraceDomainType})
*/
- boolean isKernel();
+ TraceDomainType getDomain();
/**
* Sets the whether dialog is for Kernel or UST
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup;
// Accessors
// ------------------------------------------------------------------------
/**
- * @return the session the events shall be enabled.
+ * @return the domain type ({@link TraceDomainType})
*/
- boolean isKernel();
+ TraceDomainType getDomain();
/**
* Sets the trace provider group.
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
TraceChannelComponent getChannel();
/**
- * Sets flag about domain.
- * @param isKernel - true for kernel, false for UST
+ * Sets the domain type.
+ * @param domain domain type ({@link TraceDomainType})
*/
- void setIsKernel(boolean isKernel);
+ void setDomain(TraceDomainType domain);
/**
* Sets available session.
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.IGetEventInfoDialog;
// Open dialog box to retrieve the session and channel where the events should be enabled in.
final IGetEventInfoDialog dialog = TraceControlDialogFactory.getInstance().getGetEventInfoDialog();
- dialog.setIsKernel(param.isKernel());
+ dialog.setDomain(param.getDomain());
dialog.setSessions(param.getSessions());
if (dialog.open() != Window.OK) {
TraceChannelComponent channel = dialog.getChannel();
if (channel == null) {
// enable events on default channel (which will be created by lttng-tools)
- session.enableEvents(eventNames, param.isKernel(), dialog.getFilterExpression(), null, monitor);
+ session.enableEvents(eventNames, param.getDomain(), dialog.getFilterExpression(), null, monitor);
} else {
channel.enableEvents(eventNames, dialog.getFilterExpression(), null, monitor);
}
public boolean isEnabled() {
@NonNull ArrayList<@NonNull BaseEventComponent> events = new ArrayList<>();
@NonNull TraceSessionComponent[] sessions = null;
- Boolean isKernel = null;
+ TraceDomainType domain = null;
// Get workbench page for the Control View
IWorkbenchPage page = getWorkbenchPage();
ITraceControlComponent provider = event.getParent();
// check for kernel or UST provider
- boolean temp = false;
+ TraceDomainType temp = null;
if (provider instanceof KernelProviderComponent) {
- temp = true;
+ temp = TraceDomainType.KERNEL;
} else if (provider instanceof UstProviderComponent) {
- temp = false;
+ temp = TraceDomainType.UST;
} else {
return false;
}
- if (isKernel == null) {
- isKernel = Boolean.valueOf(temp);
+ if (domain == null) {
+ domain = temp;
} else {
// don't mix events from Kernel and UST provider
- if (isKernel.booleanValue() != temp) {
+ if (!domain.equals(temp)) {
return false;
}
}
boolean isEnabled = ((!events.isEmpty()) && (sessions != null) && (sessions.length > 0));
// To avoid compiler warnings check for null even if isKernel is always not null when used below
- if (isKernel == null) {
+ if (domain == null) {
return false;
}
try {
fParam = null;
if(isEnabled) {
- fParam = new Parameter(NonNullUtils.checkNotNull(sessions), events, isKernel);
+ fParam = new Parameter(NonNullUtils.checkNotNull(sessions), events, domain);
}
} finally {
fLock.unlock();
private final @NonNull TraceSessionComponent[] fSessions;
/**
- * Flag for indicating Kernel or UST.
+ * The domain type ({@link TraceDomainType})
*/
- private final boolean fIsKernel;
+ private final TraceDomainType fDomain;
/**
* Constructor
*
* @param sessions - a array of trace sessions
* @param events - a lists of events to enable
- * @param isKernel - domain (true for kernel or UST)
+ * @param domain - domain type ({@link TraceDomainType})
*/
- public Parameter(@NonNull TraceSessionComponent[] sessions, List<BaseEventComponent> events, boolean isKernel) {
+ public Parameter(@NonNull TraceSessionComponent[] sessions, List<BaseEventComponent> events, TraceDomainType domain) {
fSessions = NonNullUtils.checkNotNull(Arrays.copyOf(sessions, sessions.length));
fEvents = new ArrayList<>();
fEvents.addAll(events);
- fIsKernel = isKernel;
+ fDomain = domain;
}
/**
* @param other - a parameter to copy
*/
public Parameter(Parameter other) {
- this(other.fSessions, other.fEvents, other.fIsKernel);
+ this(other.fSessions, other.fEvents, other.fDomain);
}
public TraceSessionComponent[] getSessions() {
return fEvents;
}
- public boolean isKernel() {
- return fIsKernel;
+ public TraceDomainType getDomain() {
+ return fDomain;
}
}
}
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.window.Window;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.IEnableChannelDialog;
* @param info
* - channel information to set for the channel (use null for
* default)
- * @param isKernel
- * - a flag for indicating kernel or UST.
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param monitor
* - a progress monitor
* @throws ExecutionException
* If something goes wrong when enabling the channel
*/
public abstract void enableChannel(CommandParameter param,
- List<String> channelNames, IChannelInfo info, boolean isKernel,
+ List<String> channelNames, IChannelInfo info, TraceDomainType domain,
IProgressMonitor monitor) throws ExecutionException;
/**
channelNames.add(dialog.getChannelInfo().getName());
try {
- enableChannel(param, channelNames, dialog.getChannelInfo(), dialog.isKernel(), monitor);
+ enableChannel(param, channelNames, dialog.getChannelInfo(), dialog.getDomain(), monitor);
} catch (ExecutionException e) {
error = e;
}
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.window.Window;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
* - a parameter instance with data for the command execution
* @param eventNames
* - list of event names
- * @param isKernel
- * - true if kernel domain else false
+ * @param domain
+ * - the domain type ({@link TraceDomainType})
* @param filterExpression
* - a filter expression
* @param excludedEvents
* @throws ExecutionException
* If the command fails for some reason
*/
- public abstract void enableEvents(CommandParameter param, List<String> eventNames, boolean isKernel, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException;
+ public abstract void enableEvents(CommandParameter param, List<String> eventNames, TraceDomainType domain, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException;
/**
* Enables all syscall events.
try {
String filter = dialog.getFilterExpression();
if (dialog.isAllEvents()) {
- enableEvents(param, ILttngControlService.ALL_EVENTS, dialog.isKernel(), filter, dialog.getExcludedEvents(), monitor);
+ enableEvents(param, ILttngControlService.ALL_EVENTS, dialog.getDomain(), filter, dialog.getExcludedEvents(), monitor);
} else if (dialog.isTracepoints()) {
// Enable tracepoint events
if (dialog.isAllTracePoints()) {
- enableEvents(param, null, dialog.isKernel(), filter, dialog.getExcludedEvents(), monitor);
+ enableEvents(param, null, dialog.getDomain(), filter, dialog.getExcludedEvents(), monitor);
} else {
List<String> eventNames = dialog.getEventNames();
if (!eventNames.isEmpty()) {
- enableEvents(param, eventNames, dialog.isKernel(), filter, dialog.getExcludedEvents(), monitor);
+ enableEvents(param, eventNames, dialog.getDomain(), filter, dialog.getExcludedEvents(), monitor);
}
}
}
eventNames.add(dialog.getWildcard());
if (!eventNames.isEmpty()) {
- enableEvents(param, eventNames, dialog.isKernel(), filter, dialog.getExcludedEvents(), monitor);
+ enableEvents(param, eventNames, dialog.getDomain(), filter, dialog.getExcludedEvents(), monitor);
}
}
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
}
if ((channel.getState() != getNewState())) {
- if (channel.isKernel()) {
+ if (channel.getDomain().equals(TraceDomainType.KERNEL)) {
kernelChannels.add(channel);
if (kernelDomain == null) {
kernelDomain = (TraceDomainComponent) channel.getParent();
// Enable command only for events of same session, same channel and domain
if ((!sessionName.equals(event.getSessionName())) ||
(!channelName.equals(event.getChannelName())) ||
- (channel.isKernel() != event.isKernel())) {
+ (!channel.getDomain().equals(event.getDomain()))) {
events.clear();
break;
}
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
// ------------------------------------------------------------------------
@Override
- public void enableChannel(CommandParameter param, List<String> channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
+ public void enableChannel(CommandParameter param, List<String> channelNames, IChannelInfo info, TraceDomainType domain, IProgressMonitor monitor) throws ExecutionException {
if (param instanceof DomainCommandParameter) {
((DomainCommandParameter)param).getDomain().enableChannels(channelNames, info, monitor);
}
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
// ------------------------------------------------------------------------
@Override
- public void enableChannel(CommandParameter param, List<String> channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
- param.getSession().enableChannels(channelNames, info, isKernel, monitor);
+ public void enableChannel(CommandParameter param, List<String> channelNames, IChannelInfo info, TraceDomainType domain, IProgressMonitor monitor) throws ExecutionException {
+ param.getSession().enableChannels(channelNames, info, domain, monitor);
}
@Override
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
// ------------------------------------------------------------------------
@Override
- public void enableEvents(CommandParameter param, List<String> eventNames, boolean isKernel, String filterExression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
+ public void enableEvents(CommandParameter param, List<String> eventNames, TraceDomainType domain, String filterExression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
if (param instanceof ChannelCommandParameter) {
((ChannelCommandParameter)param).getChannel().enableEvents(eventNames, filterExression, excludedEvents, monitor);
}
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
// ------------------------------------------------------------------------
@Override
- public void enableEvents(CommandParameter param, List<String> eventNames, boolean isKernel, String filterExression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
+ public void enableEvents(CommandParameter param, List<String> eventNames, TraceDomainType domain, String filterExression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
if (param instanceof DomainCommandParameter) {
((DomainCommandParameter)param).getDomain().enableEvents(eventNames, filterExression, excludedEvents, monitor);
}
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
// ------------------------------------------------------------------------
@Override
- public void enableEvents(CommandParameter param, List<String> eventNames, boolean isKernel, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
- param.getSession().enableEvents(eventNames, isKernel, filterExpression, excludedEvents, monitor);
+ public void enableEvents(CommandParameter param, List<String> eventNames, TraceDomainType domain, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
+ param.getSession().enableEvents(eventNames, domain, filterExpression, excludedEvents, monitor);
}
@Override
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IFieldInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
}
/**
- * @return if provider kernel or UST
+ * @return the domain type ({@link TraceDomainType})
*/
- public boolean isKernel() {
- return getParent() instanceof KernelProviderComponent;
+ public TraceDomainType getDomain() {
+ return getParent() instanceof KernelProviderComponent ? TraceDomainType.KERNEL : TraceDomainType.UST;
}
// ------------------------------------------------------------------------
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
}
@Override
- public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
+ public void enableChannels(String sessionName, List<String> channelNames, TraceDomainType domain, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
}
@Override
- public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
+ public void disableChannels(String sessionName, List<String> channelNames, TraceDomainType domain, IProgressMonitor monitor) throws ExecutionException {
}
@Override
- public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
+ public void enableEvents(String sessionName, String channelName, List<String> eventNames, TraceDomainType domain, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
}
@Override
}
@Override
- public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
+ public void disableEvent(String sessionName, String channelName, List<String> eventNames, TraceDomainType domain, IProgressMonitor monitor) throws ExecutionException {
}
@Override
}
@Override
- public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List<String> contexts, IProgressMonitor monitor) throws ExecutionException {
+ public void addContexts(String sessionName, String channelName, String eventName, TraceDomainType domain, List<String> contexts, IProgressMonitor monitor) throws ExecutionException {
}
@Override
import org.eclipse.remote.core.RemoteConnectionChangeEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
/**
* Returns if node supports filtering of events
- * @param isKernel - <code>true</code> for kernel provider else <code>false</code>
+ * @param domain - the domain type ({@link TraceDomainType})
* @return <code>true</code> if node supports filtering else <code>false</code>
*/
- public boolean isEventFilteringSupported(boolean isKernel) {
- if (isKernel) {
+ public boolean isEventFilteringSupported(TraceDomainType domain) {
+ if (domain.equals(TraceDomainType.KERNEL)) {
return getControlService().isVersionSupported("2.7.0"); //$NON-NLS-1$
}
return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
}
/**
- * @return if domain is kernel or UST
+ * @return the domain type ({@link TraceDomainType})
*/
- public boolean isKernel() {
- return ((TraceDomainComponent)getParent()).isKernel();
+ public TraceDomainType getDomain() {
+ return ((TraceDomainComponent)getParent()).getDomain();
}
/**
* If the command fails
*/
public void enableEvents(List<String> eventNames, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
- getControlService().enableEvents(getSessionName(), getName(), eventNames, isKernel(), filterExpression, excludedEvents, monitor);
+ getControlService().enableEvents(getSessionName(), getName(), eventNames, getDomain(), filterExpression, excludedEvents, monitor);
}
/**
public void disableEvent(List<String> eventNames, IProgressMonitor monitor)
throws ExecutionException {
getControlService().disableEvent(getParent().getParent().getName(),
- getName(), eventNames, isKernel(), monitor);
+ getName(), eventNames, getDomain(), monitor);
}
/**
public void addContexts(List<String> contexts, IProgressMonitor monitor)
throws ExecutionException {
getControlService().addContexts(getSessionName(), getName(), null,
- isKernel(), contexts, monitor);
+ getDomain(), contexts, monitor);
}
}
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
}
/**
- * @return true if domain is kernel, false for UST
+ * @return the domain type ({@link TraceDomainType})
*/
- public boolean isKernel() {
- return fDomainInfo.isKernel();
+ public TraceDomainType getDomain() {
+ return fDomainInfo.getDomain();
}
/**
- * Sets whether domain is Kernel domain or UST
- * @param isKernel true for kernel, false for UST
+ * Sets the domain type
+ *
+ * @param domain
+ * the domain type ({@link TraceDomainType})
*/
- public void setIsKernel(boolean isKernel) {
- fDomainInfo.setIsKernel(isKernel);
+ public void setDomain(TraceDomainType domain) {
+ fDomainInfo.setDomain(domain);
}
/**
public void enableChannels(List<String> channelNames, IChannelInfo info,
IProgressMonitor monitor) throws ExecutionException {
getControlService().enableChannels(getParent().getName(), channelNames,
- isKernel(), info, monitor);
+ getDomain(), info, monitor);
}
/**
public void disableChannels(List<String> channelNames,
IProgressMonitor monitor) throws ExecutionException {
getControlService().disableChannels(getParent().getName(),
- channelNames, isKernel(), monitor);
+ channelNames, getDomain(), monitor);
}
/**
public void enableEvents(List<String> eventNames, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor)
throws ExecutionException {
getControlService().enableEvents(getSessionName(), null, eventNames,
- isKernel(), filterExpression, excludedEvents, monitor);
+ getDomain(), filterExpression, excludedEvents, monitor);
}
/**
public void addContexts(List<String> contexts, IProgressMonitor monitor)
throws ExecutionException {
getControlService().addContexts(getSessionName(), null, null,
- isKernel(), contexts, monitor);
+ getDomain(), contexts, monitor);
}
}
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
}
/**
- * @return if domain is kernel or UST
+ * @return the domain type ({@link TraceDomainType})
*/
- public boolean isKernel() {
- return ((TraceChannelComponent)getParent()).isKernel();
+ public TraceDomainType getDomain() {
+ return ((TraceChannelComponent)getParent()).getDomain();
}
// ------------------------------------------------------------------------
public void addContexts(List<String> contexts, IProgressMonitor monitor)
throws ExecutionException {
getControlService().addContexts(getSessionName(), getChannelName(),
- getName(), isKernel(), contexts, monitor);
+ getName(), getDomain(), contexts, monitor);
}
}
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IUstProviderInfo;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
/**
* Returns if node supports filtering of events
- * @param isKernel - <code>true</code> for kernel provider else <code>false</code>
+ * @param domain - the domain type ({@link TraceDomainType})
* @return <code>true</code> if node supports filtering else <code>false</code>
*/
- public boolean isEventFilteringSupported(boolean isKernel) {
- return ((TargetNodeComponent)getParent()).isEventFilteringSupported(isKernel);
+ public boolean isEventFilteringSupported(TraceDomainType domain) {
+ return ((TargetNodeComponent)getParent()).isEventFilteringSupported(domain);
}
}
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
/**
* Returns if node supports filtering of events
- * @param isKernel - <code>true</code> for kernel provider else <code>false</code>
+ * @param domain - the domain type ({@link TraceDomainType})
* @return <code>true</code> if node supports filtering else <code>false</code>
*/
- public boolean isEventFilteringSupported(boolean isKernel) {
- return ((TargetNodeComponent)getParent().getParent()).isEventFilteringSupported(isKernel);
+ public boolean isEventFilteringSupported(TraceDomainType domain) {
+ return ((TargetNodeComponent)getParent().getParent()).isEventFilteringSupported(domain);
}
/**
* @param info
* - channel information to set for the channel (use null for
* default)
- * @param isKernel
- * - a flag for indicating kernel or UST.
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param monitor
* - a progress monitor
* @throws ExecutionException
* If the command fails
*/
public void enableChannels(List<String> channelNames, IChannelInfo info,
- boolean isKernel, IProgressMonitor monitor)
+ TraceDomainType domain, IProgressMonitor monitor)
throws ExecutionException {
- getControlService().enableChannels(getName(), channelNames, isKernel,
+ getControlService().enableChannels(getName(), channelNames, domain,
info, monitor);
}
*
* @param eventNames
* - a list of event names to enabled.
- * @param isKernel
- * - a flag for indicating kernel or UST.
+ * @param domain
+ * - the type of the domain type ({@link TraceDomainType})
* @param filterExpression
* - a filter expression
* @param excludedEvents
* @throws ExecutionException
* If the command fails
*/
- public void enableEvents(List<String> eventNames, boolean isKernel,
+ public void enableEvents(List<String> eventNames, TraceDomainType domain,
String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
- getControlService().enableEvents(getName(), null, eventNames, isKernel,
+ getControlService().enableEvents(getName(), null, eventNames, domain,
filterExpression, excludedEvents, monitor);
}
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
* - a session name to create
* @param channelNames
* - a list of channel names to be enabled
- * @param isKernel
- * - a flag to indicate Kernel or UST (true for Kernel, false for
- * UST)
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param info
* - channel information used for creation of a channel (or null
* for default)
* If the command fails
*/
void enableChannels(String sessionName, List<String> channelNames,
- boolean isKernel, IChannelInfo info, IProgressMonitor monitor)
+ TraceDomainType domain, IChannelInfo info, IProgressMonitor monitor)
throws ExecutionException;
/**
* - a session name to create
* @param channelNames
* - a list of channel names to be enabled
- * @param isKernel
- * - a flag to indicate Kernel or UST (true for Kernel, false for
- * UST)
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param monitor
* - a progress monitor
* @throws ExecutionException
* If the command fails
*/
void disableChannels(String sessionName, List<String> channelNames,
- boolean isKernel, IProgressMonitor monitor)
+ TraceDomainType domain, IProgressMonitor monitor)
throws ExecutionException;
/**
* @param eventNames
* - a list of event names to be enabled, or null (list of size =
* 0)for all events .
- * @param isKernel
- * - a flag for indicating kernel or UST.
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param filterExpression
* - a filter expression
* @param excludedEvents
* If the command fails
*/
void enableEvents(String sessionName, String channelName,
- List<String> eventNames, boolean isKernel, String filterExpression, List<String> excludedEvents,
+ List<String> eventNames, TraceDomainType domain, String filterExpression, List<String> excludedEvents,
IProgressMonitor monitor)
throws ExecutionException;
* - a channel name (null for default channel)
* @param eventNames
* - a list of event names to enabled.
- * @param isKernel
- * - a flag for indicating kernel or UST.
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param monitor
* - a progress monitor
* @throws ExecutionException
* If the command fails
*/
void disableEvent(String sessionName, String channelName,
- List<String> eventNames, boolean isKernel, IProgressMonitor monitor)
+ List<String> eventNames, TraceDomainType domain, IProgressMonitor monitor)
throws ExecutionException;
/**
* - a channel name (null for all channels)
* @param eventName
* - a event name (null for all events)
- * @param isKernel
- * - a flag for indicating kernel or UST.
+ * @param domain
+ * - indicate the domain type ({@link TraceDomainType})
* @param contexts
* - a list of name of contexts to add
* @param monitor
* If the command fails
*/
void addContexts(String sessionName, String channelName,
- String eventName, boolean isKernel, List<String> contexts,
+ String eventName, TraceDomainType domain, List<String> contexts,
IProgressMonitor monitor) throws ExecutionException;
/**
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
// Create Domain
IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_KernelDomainDisplayName);
- // set kernel flag
- domainInfo.setIsKernel(true);
+ // set kernel domain
+ domainInfo.setDomain(TraceDomainType.KERNEL);
// in domain kernel
ArrayList<IChannelInfo> channels = new ArrayList<>();
if (matcher.matches()) {
IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName);
- // set kernel flag
- domainInfo.setIsKernel(false);
+ // set kernel domain
+ domainInfo.setDomain(TraceDomainType.UST);
// in domain UST
ArrayList<IChannelInfo> channels = new ArrayList<>();
}
@Override
- public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
+ public void enableChannels(String sessionName, List<String> channelNames, TraceDomainType domain, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
// no channels to enable
if (channelNames.isEmpty()) {
command.add(toCsv(channelNames));
- if (isKernel) {
+ switch (domain) {
+ case KERNEL:
command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- } else {
+ break;
+ case UST:
command.add(LTTngControlServiceConstants.OPTION_UST);
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
}
command.add(LTTngControlServiceConstants.OPTION_SESSION);
if (isVersionSupported("2.2.0")) { //$NON-NLS-1$
// --buffers-uid Every application sharing the same UID use the
// same buffers --buffers-pid Buffers are allocated per PID
- if (!isKernel) {
+ if (domain.equals(TraceDomainType.UST)) {
if (info.getBufferType() == BufferType.BUFFER_PER_PID) {
command.add(LTTngControlServiceConstants.OPTION_PER_PID_BUFFERS);
}
@Override
- public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
+ public void disableChannels(String sessionName, List<String> channelNames, TraceDomainType domain, IProgressMonitor monitor) throws ExecutionException {
// no channels to enable
if (channelNames.isEmpty()) {
command.add(toCsv(channelNames));
- if (isKernel) {
+ switch (domain) {
+ case KERNEL:
command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- } else {
+ break;
+ case UST:
command.add(LTTngControlServiceConstants.OPTION_UST);
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
+
}
command.add(LTTngControlServiceConstants.OPTION_SESSION);
}
@Override
- public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
+ public void enableEvents(String sessionName, String channelName, List<String> eventNames, TraceDomainType domain, String filterExpression, List<String> excludedEvents, IProgressMonitor monitor) throws ExecutionException {
ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
boolean isAllEvents = ALL_EVENTS.equals(eventNames);
command.add(toCsv(eventNames));
}
- if (isKernel) {
+ switch (domain) {
+ case KERNEL:
command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- } else {
+ break;
+ case UST:
command.add(LTTngControlServiceConstants.OPTION_UST);
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
}
command.add(LTTngControlServiceConstants.OPTION_SESSION);
}
@Override
- public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
+ public void disableEvent(String sessionName, String channelName, List<String> eventNames, TraceDomainType domain, IProgressMonitor monitor) throws ExecutionException {
ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_EVENT);
if (eventNames == null) {
command.add(eventNameParameter.toString());
}
- if (isKernel) {
+ switch (domain) {
+ case KERNEL:
command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- } else {
+ break;
+ case UST:
command.add(LTTngControlServiceConstants.OPTION_UST);
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
}
command.add(LTTngControlServiceConstants.OPTION_SESSION);
}
@Override
- public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List<String> contextNames, IProgressMonitor monitor) throws ExecutionException {
+ public void addContexts(String sessionName, String channelName, String eventName, TraceDomainType domain, List<String> contextNames, IProgressMonitor monitor) throws ExecutionException {
ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT);
command.add(LTTngControlServiceConstants.OPTION_SESSION);
command.add(eventName);
}
- if (isKernel) {
+ switch (domain) {
+ case KERNEL:
command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- } else {
+ break;
+ case UST:
command.add(LTTngControlServiceConstants.OPTION_UST);
+ break;
+ case JUL:
+ case LOG4J:
+ case PYTHON:
+ case UNKNOWN:
+ default:
+ break;
}
for (Iterator<String> iterator = contextNames.iterator(); iterator.hasNext();) {
int index = currentIndex;
// if kernel set the buffer type to shared
- if (domainInfo.isKernel()) {
+ if (domainInfo.getDomain().equals(TraceDomainType.KERNEL)) {
domainInfo.setBufferType(BufferType.BUFFER_SHARED);
}
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISnapshotInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.IUstProviderInfo;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
switch (domainType) {
case KERNEL:
domain = new DomainInfo(Messages.TraceControl_KernelProviderDisplayName);
- domain.setIsKernel(true);
+ domain.setDomain(TraceDomainType.KERNEL);
break;
case UST:
domain = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName);
- domain.setIsKernel(false);
+ domain.setDomain(TraceDomainType.UST);
break;
case JUL:
/**
* JUL domain only events. The channel is activated in UST Channel
*/
domain = new DomainInfo(Messages.TraceControl_JULDomainDisplayName);
- domain.setIsKernel(false);
+ domain.setDomain(TraceDomainType.JUL);
break;
case UNKNOWN:
domain = new DomainInfo(Messages.TraceControl_UnknownDomainDisplayName);
- domain.setIsKernel(false);
+ domain.setDomain(TraceDomainType.UNKNOWN);
break;
+ //$CASES-OMITTED$
default:
throw new ExecutionException(Messages.TraceControl_MiInvalidElementError);
}