By default the domain '''Kernel''' is selected and the kernel specific data sections are created. From this dialog box kernel '''Tracepoint''' events, '''System calls (Syscall)''', a '''Dynamic Probe''' or a '''Dynamic Function entry/return''' probe can be enabled. Note that events of one of these types at a time can be enabled.
+To enable all '''Tracepoints''' and all '''System calls (Syscall)''', select the button '''Select''' of section '''All Tracepoint Events and Syscalls''' and press '''Ok'''.
+
+[[Image:images/LTTng2EnableAllEventsDialog.png]]
+
+Upon successful operation, the domain '''Kernel''' will be created in the tree (if neccessary), the default channel with name "channel0" will be added under the domain (if necessary) as well as all a wildcard event '''*''' of type '''TRACEPOINT''' under the channel and a wildcard event '''*''' of type '''SYSCALL''' . The channel and events will be '''ENABLED'''.
+
To enable '''Tracepoint''' events, first select the corresponding '''Select''' button, then select either all tracepoins (select '''All''') or select selectively one or more tracepoints in the displayed tree of tracepoints and finally press '''Ok'''.
[[Image:images/LTTng2TracepointEventsDialog.png]]
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests;
+
+import static org.junit.Assert.assertEquals;
+
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test for the Control view in Trace Compass. This will test the enabling
+ * Kernel and Syscalls at the same time.
+ *
+ * @author Bernd Hufmann
+ */
+@RunWith(SWTBotJunit4ClassRunner.class)
+public class ControlViewAllEventsTest extends ControlViewTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final String TEST_STREAM = "CreateSessionTestLTTng2_8.cfg";
+ private static final String CREATE_SESSION_KERNEL_SCENARIO_NAME = "CreateSessionAllKernelEvents";
+
+ private static final String SESSION_NAME = "mysession";
+
+ @Override
+ protected String getTestStream() {
+ return TEST_STREAM;
+ }
+
+ @Override
+ protected String getSessionName() {
+ return SESSION_NAME;
+ }
+
+ @Override
+ @Test
+ public void testTraceSessionTree() {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(INIT_SCENARIO_NAME);
+
+ testConnectToNode();
+ // Prepare for saving of profile
+ fProxy.setScenario(CREATE_SESSION_KERNEL_SCENARIO_NAME);
+ testCreateSession();
+ testEnableKernelEvent();
+ testStartStopTracing(TraceSessionState.ACTIVE);
+ testStartStopTracing(TraceSessionState.INACTIVE);
+ testDestroySession();
+ testDisconnectFromNode();
+ }
+
+ @Override
+ protected void testEnableKernelEvent() {
+ SWTBotTreeItem sessionItem = SWTBotUtils.getTreeItem(fBot, fTree,
+ getNodeName(),
+ ControlViewSwtBotUtil.SESSION_GROUP_NAME,
+ getSessionName());
+
+ sessionItem.select();
+ SWTBotMenu menuBot = sessionItem.contextMenu(ControlViewSwtBotUtil.ENABLE_EVENT_DEFAULT_CHANNEL_MENU_ITEM);
+ menuBot.click();
+
+ SWTBotShell shell = fBot.shell(ControlViewSwtBotUtil.ENABLE_EVENT_DIALOG_TITLE).activate();
+ // all tracepoint events and syscalls
+ shell.bot().radioInGroup(ControlViewSwtBotUtil.GROUP_SELECT_NAME, ControlViewSwtBotUtil.ALL_EVENT_GROUP_NAME).click();
+ shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
+ SWTBotUtils.waitForJobs();
+
+ fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+
+ SWTBotTreeItem channelItem = SWTBotUtils.getTreeItem(fBot, fTree,
+ getNodeName(),
+ ControlViewSwtBotUtil.SESSION_GROUP_NAME,
+ getSessionName(),
+ ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME,
+ ControlViewSwtBotUtil.DEFAULT_CHANNEL_NAME);
+ assertEquals(ControlViewSwtBotUtil.DEFAULT_CHANNEL_NAME, channelItem.getText());
+
+ SWTBotTreeItem eventItem = SWTBotUtils.getTreeItem(fBot, fTree,
+ getNodeName(),
+ ControlViewSwtBotUtil.SESSION_GROUP_NAME,
+ getSessionName(),
+ ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME,
+ ControlViewSwtBotUtil.DEFAULT_CHANNEL_NAME,
+ ControlViewSwtBotUtil.ALL_EVENTS_NAME);
+ assertEquals(ControlViewSwtBotUtil.ALL_EVENTS_NAME, eventItem.getText());
+ }
+}
\ No newline at end of file
SWTBotShell shell = fBot.shell(ControlViewSwtBotUtil.ENABLE_EVENT_DIALOG_TITLE).activate();
+ shell.bot().radioInGroup(ControlViewSwtBotUtil.GROUP_SELECT_NAME, ControlViewSwtBotUtil.TRACEPOINTS_GROUP_NAME).click();
+
SWTBotTree tracepointsTree = shell.bot().tree();
tracepointsTree.select(ControlViewSwtBotUtil.ALL_TREE_NODE);
SWTBotText filterText = shell.bot().textInGroup(ControlViewSwtBotUtil.FILTER_EXPRESSION_LABEL);
public static final String CONFIRM_DIALOG_OK_BUTTON = "OK";
public static final String ENABLE_EVENT_DIALOG_TITLE = "Enable Events";
public static final String ALL_TREE_NODE = "All";
+ public static final String ALL_EVENT_GROUP_NAME = "All Tracepoint Events and Syscalls";
+ public static final String TRACEPOINTS_GROUP_NAME = "Tracepoint Events";
public static final String SYSCALL_GROUP_NAME = "All Syscalls";
public static final String GROUP_SELECT_NAME = "Select";
public static final String ENABLE_CHANNEL_DIALOG_TITLE = "Enable Channel";
SWTBotShell shell = fBot.shell(ControlViewSwtBotUtil.ENABLE_EVENT_DIALOG_TITLE).activate();
+ shell.bot().radioInGroup(ControlViewSwtBotUtil.GROUP_SELECT_NAME, ControlViewSwtBotUtil.TRACEPOINTS_GROUP_NAME).click();
+
SWTBotTree tracepointsTree = shell.bot().tree();
tracepointsTree.select(ControlViewSwtBotUtil.ALL_TREE_NODE);
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
<?xml version="1.0" encoding="UTF-8"?>
<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>destroy</name><output><sessions><session><name>mysession</name><path>${workspace}/lttng-traces/mysession-20160105-151744</path><enabled>false</enabled><snapshot_mode>0</snapshot_mode><live_timer_interval>0</live_timer_interval></session></sessions></output><success>true</success></command>
</COMMAND_OUTPUT>
-</SCENARIO>
\ No newline at end of file
+</SCENARIO>
+###############################################################################
+# Enable all kernel and syscall events using LTTng 2.8
+###############################################################################
+<SCENARIO>
+CreateSessionAllKernelEvents
+
+<COMMAND_INPUT>
+lttng --mi xml create mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>create</name><output><session><name>mysession</name><path>/home/bernd/lttng-traces/mysession-20160422-070226</path><enabled>false</enabled><snapshot_mode>0</snapshot_mode><live_timer_interval>0</live_timer_interval></session></output><success>true</success></command>
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>list</name><output><sessions><session><name>mysession</name><path>/home/bernd/lttng-traces/mysession-20160422-070226</path><enabled>false</enabled><snapshot_mode>0</snapshot_mode><live_timer_interval>0</live_timer_interval><domains/></session></sessions></output></command>
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml enable-event -a -k -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>enable-event</name><output><events><event><name>*</name><type>ALL</type><enabled>true</enabled><success>true</success></event></events></output><success>true</success></command>
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>list</name><output><sessions><session><name>mysession</name><path>${workspace}/lttng-traces/mysession-20160610-165451</path><enabled>false</enabled><snapshot_mode>0</snapshot_mode><live_timer_interval>0</live_timer_interval><domains><domain><type>KERNEL</type><buffer_type>GLOBAL</buffer_type><trackers/><channels><channel><name>channel0</name><enabled>true</enabled><attributes><overwrite_mode>DISCARD</overwrite_mode><subbuffer_size>262144</subbuffer_size><subbuffer_count>4</subbuffer_count><switch_timer_interval>0</switch_timer_interval><read_timer_interval>200000</read_timer_interval><output_type>SPLICE</output_type><tracefile_size>0</tracefile_size><tracefile_count>0</tracefile_count><live_timer_interval>0</live_timer_interval><discarded_events>0</discarded_events><lost_packets>0</lost_packets></attributes><events><event><name>*</name><type>SYSCALL</type><enabled>true</enabled></event><event><name>*</name><type>TRACEPOINT</type><enabled>true</enabled><loglevel>TRACE_EMERG</loglevel><loglevel_type>ALL</loglevel_type><exclusions/></event></events></channel></channels></domain></domains></session></sessions></output></command>
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml start mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>start</name><output><sessions><session><name>mysession</name><enabled>true</enabled></session></sessions></output><success>true</success></command>
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml stop mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>stop</name><output><sessions><session><name>mysession</name><enabled>false</enabled></session></sessions></output><success>true</success></command>
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0"><name>destroy</name><output><sessions><session><name>mysession</name><path>/home/bernd/lttng-traces/mysession-20160422-070226</path><enabled>false</enabled><snapshot_mode>0</snapshot_mode><live_timer_interval>0</live_timer_interval></session></sessions></output><success>true</success></command>
+</COMMAND_OUTPUT>
+</SCENARIO>
+
list.clear();
fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor());
- // TODO add test with filters
+ // 6) session name, channel = null,
+ fService.enableEvents(sessionName, null, ILttngControlService.ALL_EVENTS, true, null, new NullProgressMonitor());
} catch (ExecutionException e) {
fail(e.toString());
// ------------------------------------------------------------------------
private boolean fIsKernel;
private boolean fIsTracePoints;
+ private boolean fIsAllEvents;
private boolean fIsAllTracePoints;
private boolean fIsSysCalls;
private boolean fIsDynamicProbe;
fIsKernel = isKernel;
}
+ public void setIsAllEvents(boolean isAllEvents) {
+ fIsAllEvents = isAllEvents;
+ }
+
public void setIsTracePoints(boolean isTracePoints) {
fIsTracePoints = isTracePoints;
}
fFilter = filter;
}
+ @Override
+ public boolean isAllEvents() {
+ return fIsAllEvents;
+ }
+
@Override
public boolean isTracepoints() {
return fIsTracePoints;
</command>
</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml enable-event -a -k -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command xmlns="http://lttng.org/xml/ns/lttng-mi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lttng.org/xml/ns/lttng-mi http://lttng.org/xml/schemas/lttng-mi/3/lttng-mi-3.0.xsd" schemaVersion="3.0">
+ <name>enable-event</name>
+ <output>
+ <events>
+ <event>
+ <name>*</name>
+ <type>ALL</type>
+ <enabled>true</enabled>
+ <filter>false</filter>
+ <success>true</success>
+ </event>
+ </events>
+ </output>
+ <success>true</success>
+</command>
+</COMMAND_OUTPUT>
+
</SCENARIO>
####################################################################
</command>
</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng --mi xml enable-event -a -k -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<?xml version="1.0" encoding="UTF-8"?>
+<command>
+ <name>enable-event</name>
+ <output>
+ <events>
+ <event>
+ <name>*</name>
+ <type>ALL</type>
+ <enabled>true</enabled>
+ <filter>false</filter>
+ <success>true</success>
+ </event>
+ </events>
+ </output>
+ <success>true</success>
+</command>
+</COMMAND_OUTPUT>
+
</SCENARIO>
####################################################################
UST event myevent5 created in channel mychannel
</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All Kernel events are enabled in channel channel0
+</COMMAND_OUTPUT>
+
</SCENARIO>
####################################################################
Session mysession saved successfully.
</COMMAND_OUTPUT>
-</SCENARIO>
\ No newline at end of file
+</SCENARIO>
+
+</SCENARIO>
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
+ @Override
+ public boolean isAllEvents() {
+ if (fIsKernel) {
+ return fKernelComposite.isAllEvents();
+ }
+ return false;
+ }
@Override
public boolean isTracepoints() {
}
});
- getShell().setMinimumSize(new Point(500, 650));
+ getShell().setMinimumSize(new Point(550, 750));
return fDialogComposite;
}
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
- private enum KernelGroupEnum { TRACEPOINTS, SYSCALLS, PROBE, FUNCTION }
+ private enum KernelGroupEnum { ALL, TRACEPOINTS, SYSCALLS, PROBE, FUNCTION }
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
+ /**
+ * A button to enable/disable the all tracepoints&sycalls group
+ */
+ private Button fAllActivateButton;
/**
* A button to enable/disable the tracepoints group
*/
* component which contains a list of available tracepoints.
*/
private final TraceProviderGroup fProviderGroup;
+ /**
+ * The flag indicating that all tracepoints/syscalls are selected.
+ */
+ private boolean fIsAllTracepointsAndSyscalls;
/**
* The flag indicating that tracepoints are selected.
*/
// ------------------------------------------------------------------------
// Acessors
// ------------------------------------------------------------------------
-
+ @Override
+ public boolean isAllEvents() {
+ return fIsAllTracepointsAndSyscalls;
+ }
@Override
public boolean isTracepoints() {
return fIsTracepoints;
*/
public void createContent() {
+ // All Tracepoints/syscalls Group
+ createAllTracepointsSyscallGroup();
+
// Tracepoints Group
createTracepointsGroup();
createFilterGroup();
// Set default enablements
- setKernelEnablements(KernelGroupEnum.TRACEPOINTS);
+ setKernelEnablements(KernelGroupEnum.ALL);
}
/**
* @return true if configured data is valid and can be retrieved.
*/
public boolean isValid() {
+ fIsAllTracepointsAndSyscalls = fAllActivateButton.getSelection();
fIsTracepoints = fTracepointsActivateButton.getSelection();
fIsSysCalls = fSysCallsActivateButton.getSelection();
fIsDynamicProbe = fProbeActivateButton.getSelection();
return true;
}
+ /**
+ * Creates all tracepoints/syscalls group.
+ */
+ private void createAllTracepointsSyscallGroup() {
+
+ GridLayout layout;
+ GridData data;
+ Group tpMainGroup = new Group(this, SWT.SHADOW_NONE);
+ tpMainGroup.setText(Messages.TraceControl_EnableEventsAllEventsLabel);
+ layout = new GridLayout(2, false);
+ tpMainGroup.setLayout(layout);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ tpMainGroup.setLayoutData(data);
+
+ Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE);
+ layout = new GridLayout(1, true);
+ buttonComposite.setLayout(layout);
+ data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true);
+ buttonComposite.setLayoutData(data);
+
+ fAllActivateButton = new Button(buttonComposite, SWT.RADIO);
+ fAllActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName);
+ fAllActivateButton.setToolTipText(Messages.TraceControl_EnableEventsAllEventsTooltip);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ fAllActivateButton.setLayoutData(data);
+ fAllActivateButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setKernelEnablements(KernelGroupEnum.ALL);
+ }
+ });
+ }
+
/**
* Creates tracepoints group.
*/
* @param group - group to enable.
*/
private void setKernelEnablements(KernelGroupEnum group) {
+ fAllActivateButton.setSelection(group == KernelGroupEnum.ALL);
fTracepointsActivateButton.setSelection(group == KernelGroupEnum.TRACEPOINTS);
fTracepointsViewer.getTree().setEnabled(group == KernelGroupEnum.TRACEPOINTS);
*/
boolean isTracepoints();
+ /**
+ * @return a flag indicating all tracepoints and syscall shall be enabled or not
+ */
+ boolean isAllEvents();
+
/**
* @return a flag indicating whether all tracepoints shall be enabled or not.
*/
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/**
* The command execution parameter.
*/
- @Nullable protected CommandParameter fParam = null;
+ @Nullable
+ protected CommandParameter fParam = null;
// ------------------------------------------------------------------------
// Operations
List<ITraceControlComponent> providers = node.getChildren(TraceProviderGroup.class);
final IEnableEventsDialog dialog = TraceControlDialogFactory.getInstance().getEnableEventsDialog();
- dialog.setTraceProviderGroup((TraceProviderGroup)providers.get(0));
+ dialog.setTraceProviderGroup((TraceProviderGroup) providers.get(0));
dialog.setTraceDomainComponent(getDomain(param));
if (dialog.open() != Window.OK) {
try {
String filter = dialog.getFilterExpression();
-
- // Enable tracepoint events
- if (dialog.isTracepoints()) {
+ if (dialog.isAllEvents()) {
+ enableEvents(param, ILttngControlService.ALL_EVENTS, dialog.isKernel(), filter, monitor);
+ } else if (dialog.isTracepoints()) {
+ // Enable tracepoint events
if (dialog.isAllTracePoints()) {
enableEvents(param, null, dialog.isKernel(), filter, monitor);
} else {
public static String TraceControl_EnableEventsNoChannelError;
public static String TraceControl_EnableGroupSelectionName;
+ public static String TraceControl_EnableEventsAllEventsLabel;
+ public static String TraceControl_EnableEventsAllEventsTooltip;
public static String TraceControl_EnableEventsTracepointGroupName;
public static String TraceControl_EnableEventsTracepointTreeTooltip;
public static String TraceControl_EnableEventsTracepointTreeAllLabel;
TraceControl_EnableEventsNoChannelError=No channel from channel list is selected.
TraceControl_EnableGroupSelectionName=Select
+TraceControl_EnableEventsAllEventsLabel=All Tracepoint Events and Syscalls
+TraceControl_EnableEventsAllEventsTooltip=Enable all tracepoint events and all Syscalls
TraceControl_EnableEventsTracepointGroupName=Tracepoint Events
TraceControl_EnableEventsTracepointTreeTooltip=List of available kernel tracepoint events
TraceControl_EnableEventsTracepointTreeAllLabel=All
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.service;
+import java.util.Collections;
import java.util.List;
import org.eclipse.core.commands.ExecutionException;
*/
public interface ILttngControlService {
+
+ /**
+ * List to enable all events
+ */
+ @NonNull List<String> ALL_EVENTS = Collections.singletonList("*"); //$NON-NLS-1$
+
/**
* @return the LTTng version object
*/
*/
public class LTTngControlService implements ILttngControlService {
-
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException {
ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
+ boolean isAllEvents = ALL_EVENTS.equals(eventNames);
- if (eventNames == null || eventNames.isEmpty()) {
+ if (isAllEvents || (eventNames == null) || (eventNames.isEmpty())) {
command.add(LTTngControlServiceConstants.OPTION_ALL);
} else {
command.add(toCsv(eventNames));
command.add(channelName);
}
- command.add(LTTngControlServiceConstants.OPTION_TRACEPOINT);
+ if (!isAllEvents) {
+ command.add(LTTngControlServiceConstants.OPTION_TRACEPOINT);
+ }
if (filterExpression != null) {
command.add(LTTngControlServiceConstants.OPTION_FILTER);