From: Bernd Hufmann Date: Fri, 1 Apr 2016 13:09:34 +0000 (-0400) Subject: control: command support for enabling all tracepoints/syscalls X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=9ee91a867744ffc34478dfe9bf8840e8a40e3a2c control: command support for enabling all tracepoints/syscalls Change-Id: I68f2783bfa9ff7882f8956a06028c0d63d286e98 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/72207 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam --- diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki b/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki index f001449889..6245831a20 100644 --- a/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki +++ b/doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki @@ -1341,6 +1341,12 @@ A dialog box will open for entering information about events to be enabled. 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]] diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableAllEventsDialog.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableAllEventsDialog.png new file mode 100644 index 0000000000..2c07bfa516 Binary files /dev/null and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableAllEventsDialog.png differ diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableEventWithKernelFilter.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableEventWithKernelFilter.png index d10c984cc9..56506da434 100644 Binary files a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableEventWithKernelFilter.png and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EnableEventWithKernelFilter.png differ diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EventOnSessionDialog.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EventOnSessionDialog.png index af952a94c5..122aa1fe74 100644 Binary files a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EventOnSessionDialog.png and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2EventOnSessionDialog.png differ diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2FunctionEventDialog.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2FunctionEventDialog.png index 82c49b50cf..8cc6c982ad 100644 Binary files a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2FunctionEventDialog.png and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2FunctionEventDialog.png differ diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2ProbeEventDialog.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2ProbeEventDialog.png index 0b44eee2c6..80d94261f5 100644 Binary files a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2ProbeEventDialog.png and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2ProbeEventDialog.png differ diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2SyscallsDialog.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2SyscallsDialog.png index c94f825548..4f07ebcdd5 100644 Binary files a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2SyscallsDialog.png and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2SyscallsDialog.png differ diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2TracepointEventsDialog.png b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2TracepointEventsDialog.png index 55bcc75084..1730e50db6 100644 Binary files a/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2TracepointEventsDialog.png and b/doc/org.eclipse.tracecompass.doc.user/doc/images/LTTng2TracepointEventsDialog.png differ diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java new file mode 100644 index 0000000000..95fa5bb75d --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java index 9c4aded752..8849965809 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java @@ -108,6 +108,8 @@ public class ControlViewKernelFilterTest extends ControlViewTest { 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); diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSwtBotUtil.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSwtBotUtil.java index da47fe0bb8..b5a40976f6 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSwtBotUtil.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSwtBotUtil.java @@ -58,6 +58,8 @@ class ControlViewSwtBotUtil { 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"; diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java index 58a7175af3..b9a77f3de1 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java @@ -293,6 +293,8 @@ public class ControlViewTest { 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(); diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/testfiles/CreateSessionTestLTTng2_8.cfg b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/testfiles/CreateSessionTestLTTng2_8.cfg index 32f6a722ea..5327bf6119 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/testfiles/CreateSessionTestLTTng2_8.cfg +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/testfiles/CreateSessionTestLTTng2_8.cfg @@ -333,4 +333,82 @@ lttng --mi xml destroy mysession destroymysession${workspace}/lttng-traces/mysession-20160105-151744false00true - \ No newline at end of file + +############################################################################### +# Enable all kernel and syscall events using LTTng 2.8 +############################################################################### + +CreateSessionAllKernelEvents + + +lttng --mi xml create mysession + + +0 + + + +createmysession/home/bernd/lttng-traces/mysession-20160422-070226false00true + + +lttng --mi xml list mysession + + +0 + + + +listmysession/home/bernd/lttng-traces/mysession-20160422-070226false00 + + +lttng --mi xml enable-event -a -k -s mysession + + +0 + + + +enable-event*ALLtruetruetrue + + +lttng --mi xml list mysession + + +0 + + + +listmysession${workspace}/lttng-traces/mysession-20160610-165451false00KERNELGLOBALchannel0trueDISCARD26214440200000SPLICE00000*SYSCALLtrue*TRACEPOINTtrueTRACE_EMERGALL + + +lttng --mi xml start mysession + + +0 + + + +startmysessiontruetrue + + +lttng --mi xml stop mysession + + +0 + + + +stopmysessionfalsetrue + + +lttng --mi xml destroy mysession + + +0 + + + +destroymysession/home/bernd/lttng-traces/mysession-20160422-070226false00true + + + diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceTest.java index 17273b4b39..8618b25e30 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceTest.java @@ -1119,7 +1119,8 @@ public class LTTngControlServiceTest { 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()); diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java index 0e3e9e72f7..67e80eb853 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java @@ -31,6 +31,7 @@ public class EnableEventsDialogStub implements IEnableEventsDialog { // ------------------------------------------------------------------------ private boolean fIsKernel; private boolean fIsTracePoints; + private boolean fIsAllEvents; private boolean fIsAllTracePoints; private boolean fIsSysCalls; private boolean fIsDynamicProbe; @@ -55,6 +56,10 @@ public class EnableEventsDialogStub implements IEnableEventsDialog { fIsKernel = isKernel; } + public void setIsAllEvents(boolean isAllEvents) { + fIsAllEvents = isAllEvents; + } + public void setIsTracePoints(boolean isTracePoints) { fIsTracePoints = isTracePoints; } @@ -123,6 +128,11 @@ public class EnableEventsDialogStub implements IEnableEventsDialog { fFilter = filter; } + @Override + public boolean isAllEvents() { + return fIsAllEvents; + } + @Override public boolean isTracepoints() { return fIsTracePoints; diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMi3Test.cfg b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMi3Test.cfg index bee5051d43..013be09bd5 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMi3Test.cfg +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMi3Test.cfg @@ -1874,6 +1874,31 @@ lttng --mi xml enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TR + +lttng --mi xml enable-event -a -k -s mysession2 + + +0 + + + + + enable-event + + + + * + ALL + true + false + true + + + + true + + + #################################################################### diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg index faf95338db..214e6a4290 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg @@ -1831,6 +1831,31 @@ lttng --mi xml enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TR + +lttng --mi xml enable-event -a -k -s mysession2 + + +0 + + + + + enable-event + + + + * + ALL + true + false + true + + + + true + + + #################################################################### diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg index 2f14c87734..6387f5fa0b 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg @@ -1010,6 +1010,16 @@ lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG UST event myevent5 created in channel mychannel + +lttng enable-event -a -k -s mysession2 + + +0 + + +All Kernel events are enabled in channel channel0 + + #################################################################### @@ -1623,4 +1633,6 @@ lttng save -o /tmp/test -f mysession Session mysession saved successfully. - \ No newline at end of file + + + diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java index 9de796b560..48a20349bb 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java @@ -105,6 +105,13 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog { // ------------------------------------------------------------------------ // Accessors // ------------------------------------------------------------------------ + @Override + public boolean isAllEvents() { + if (fIsKernel) { + return fKernelComposite.isAllEvents(); + } + return false; + } @Override public boolean isTracepoints() { @@ -353,7 +360,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog { } }); - getShell().setMinimumSize(new Point(500, 650)); + getShell().setMinimumSize(new Point(550, 750)); return fDialogComposite; } diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java index d7f6db270c..ae63d4f6a9 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java @@ -53,12 +53,16 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern // ------------------------------------------------------------------------ // 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 */ @@ -104,6 +108,10 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern * 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. */ @@ -171,7 +179,10 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern // ------------------------------------------------------------------------ // Acessors // ------------------------------------------------------------------------ - + @Override + public boolean isAllEvents() { + return fIsAllTracepointsAndSyscalls; + } @Override public boolean isTracepoints() { return fIsTracepoints; @@ -241,6 +252,9 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern */ public void createContent() { + // All Tracepoints/syscalls Group + createAllTracepointsSyscallGroup(); + // Tracepoints Group createTracepointsGroup(); @@ -257,7 +271,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern createFilterGroup(); // Set default enablements - setKernelEnablements(KernelGroupEnum.TRACEPOINTS); + setKernelEnablements(KernelGroupEnum.ALL); } /** @@ -265,6 +279,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern * @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(); @@ -339,6 +354,39 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern 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. */ @@ -561,6 +609,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern * @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); diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java index 44b2eb50aa..868f30164e 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java @@ -31,6 +31,11 @@ public interface IEnableKernelEvents { */ 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. */ diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java index 1fe8a58df9..aa78d62aeb 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java @@ -32,6 +32,7 @@ import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceCon 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; @@ -50,7 +51,8 @@ public abstract class BaseEnableEventHandler extends BaseControlViewHandler { /** * The command execution parameter. */ - @Nullable protected CommandParameter fParam = null; + @Nullable + protected CommandParameter fParam = null; // ------------------------------------------------------------------------ // Operations @@ -158,7 +160,7 @@ public abstract class BaseEnableEventHandler extends BaseControlViewHandler { List 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) { @@ -172,9 +174,10 @@ public abstract class BaseEnableEventHandler extends BaseControlViewHandler { 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 { diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java index 613a9edcad..ba9e39b456 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java @@ -201,6 +201,8 @@ public final class Messages extends NLS { 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; diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties index b75a9f5ca1..5f980989d5 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties @@ -189,6 +189,8 @@ TraceControl_EnableEventsNoSessionError=No session from session list is selected 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/ILttngControlService.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/ILttngControlService.java index 48c59dc246..3f89b19bcc 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/ILttngControlService.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/ILttngControlService.java @@ -12,6 +12,7 @@ **********************************************************************/ package org.eclipse.tracecompass.internal.lttng2.control.ui.views.service; +import java.util.Collections; import java.util.List; import org.eclipse.core.commands.ExecutionException; @@ -36,6 +37,12 @@ import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel */ public interface ILttngControlService { + + /** + * List to enable all events + */ + @NonNull List ALL_EVENTS = Collections.singletonList("*"); //$NON-NLS-1$ + /** * @return the LTTng version object */ diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java index 133c171e2f..998db7eddf 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlService.java @@ -68,7 +68,6 @@ import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandShell; */ public class LTTngControlService implements ILttngControlService { - // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ @@ -779,8 +778,9 @@ public class LTTngControlService implements ILttngControlService { public void enableEvents(String sessionName, String channelName, List 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)); @@ -800,7 +800,9 @@ public class LTTngControlService implements ILttngControlService { command.add(channelName); } - command.add(LTTngControlServiceConstants.OPTION_TRACEPOINT); + if (!isAllEvents) { + command.add(LTTngControlServiceConstants.OPTION_TRACEPOINT); + } if (filterExpression != null) { command.add(LTTngControlServiceConstants.OPTION_FILTER);