From 798b45436961bc9957774bed520cf3d418fbbcae Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Mon, 25 Apr 2016 18:24:44 -0400 Subject: [PATCH] lttng: Add ControlService tests for LTTng MI 3.0 The MI 3.0 schema was added but no tests were using it yet. This patch adds tests to make use of this new protocol. Change-Id: If31665a4bc94fd0392accda1a6eaf2382c944d47 Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/71380 Reviewed-by: Hudson CI Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann --- .../service/LTTngControlServiceMi3Test.java | 194 ++ .../service/LTTngControlServiceMiTest.java | 104 - .../service/LTTngControlServiceTest.java | 6 +- .../testfiles/LTTngServiceMi3Test.cfg | 2803 +++++++++++++++++ .../testfiles/LTTngServiceMiTest.cfg | 125 - 5 files changed, 3000 insertions(+), 232 deletions(-) create mode 100644 lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMi3Test.java create mode 100644 lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMi3Test.cfg diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMi3Test.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMi3Test.java new file mode 100644 index 0000000000..b615bd609b --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMi3Test.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Copyright (c) 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 + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.tracecompass.lttng2.control.ui.tests.service; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.NullProgressMonitor; +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; +import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType; +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; +import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService; +import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceFactory; +import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; +import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LttngVersion; +import org.junit.Test; + +/** + * Tests for the MI service when using MI version 3.0 + */ +@SuppressWarnings("javadoc") +public class LTTngControlServiceMi3Test extends LTTngControlServiceMiTest { + + private static final String MI_TEST_STREAM = "LTTngServiceMi3Test.cfg"; + + private static final String SCEN_GET_SESSION_FILTER_EXPRESSION = "GetSessionFilterExpression"; + private static final String SCEN_LIST_CONTEXT_28 = "ListContext28"; + + @Override + protected ILttngControlService getControlService() { + try { + return new LTTngControlServiceMI(getShell(), new LttngVersion("2.8.0")); + } catch (ExecutionException e) { + return null; + } + } + + @Override + protected String getTestStream() { + return MI_TEST_STREAM; + } + + @Override + public void testVersion() { + try { + fShell.setScenario(SCEN_LTTNG_VERSION); + ILttngControlService service = LTTngControlServiceFactory.getLttngControlService(fShell); + assertNotNull(service); + assertEquals("2.8.0", service.getVersionString()); + } catch (ExecutionException e) { + fail("Exeption thrown " + e); + } + } + + @Override + public void testVersionWithPrompt() { + try { + fShell.setScenario(SCEN_LTTNG_VERSION_WITH_PROMPT); + ILttngControlService service = LTTngControlServiceFactory.getLttngControlService(fShell); + assertNotNull(service); + assertEquals("2.8.0", service.getVersionString()); + } catch (ExecutionException e) { + fail("Exeption thrown " + e); + } + } + + @Override + public void testVersionCompiled() { + try { + fShell.setScenario(SCEN_LTTNG_COMPILED_VERSION); + ILttngControlService service = LTTngControlServiceFactory.getLttngControlService(fShell); + assertNotNull(service); + assertEquals("2.8.0", service.getVersionString()); + } catch (ExecutionException e) { + fail("Exeption thrown " + e); + } + } + + @Test + public void testGetSessionWithFilterExpression() throws ExecutionException { + fShell.setScenario(SCEN_GET_SESSION_FILTER_EXPRESSION); + ISessionInfo session = fService.getSession("mysession", new NullProgressMonitor()); + + // Verify Session + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath()); + assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); + + IDomainInfo[] domains = session.getDomains(); + assertNotNull(domains); + assertEquals(2, domains.length); + + // Verify Kernel domain + assertEquals("Kernel", domains[0].getName()); + IChannelInfo[] channels = domains[0].getChannels(); + assertNotNull(channels); + assertEquals(1, channels.length); + + // Verify Kernel's channel0 + assertEquals("channel0", channels[0].getName()); + assertEquals(4, channels[0].getNumberOfSubBuffers()); + assertEquals("splice()", channels[0].getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channels[0].getOutputType()); + assertEquals(false, channels[0].isOverwriteMode()); + assertEquals(200, channels[0].getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channels[0].getState()); + assertEquals(262144, channels[0].getSubBufferSize()); + assertEquals(0, channels[0].getSwitchTimer()); + + // Verify event info + IEventInfo[] channel0Events = channels[0].getEvents(); + assertNotNull(channel0Events); + assertEquals(1, channel0Events.length); + assertEquals("block_rq_remap", channel0Events[0].getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[0].getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, channel0Events[0].getEventType()); + assertEquals(TraceEnablement.ENABLED, channel0Events[0].getState()); + assertEquals("foo > 10", channel0Events[0].getFilterExpression()); + + // Verify domain UST global + assertEquals("UST global", domains[1].getName()); + + IChannelInfo[] ustChannels = domains[1].getChannels(); + + // Verify UST global's channel0 + assertEquals("channel0", ustChannels[0].getName()); + assertEquals(4, ustChannels[0].getNumberOfSubBuffers()); + assertEquals("mmap()", ustChannels[0].getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, ustChannels[0].getOutputType()); + assertEquals(false, ustChannels[0].isOverwriteMode()); + assertEquals(200, ustChannels[0].getReadTimer()); + assertEquals(TraceEnablement.ENABLED, ustChannels[0].getState()); + assertEquals(4096, ustChannels[0].getSubBufferSize()); + assertEquals(0, ustChannels[0].getSwitchTimer()); + + // Verify event info + IEventInfo[] ustEvents = ustChannels[0].getEvents(); + assertEquals(1, ustEvents.length); + + assertEquals("ust_tests_hello:tptest_sighandler", ustEvents[0].getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, ustEvents[0].getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, ustEvents[0].getEventType()); + assertEquals(TraceEnablement.DISABLED, ustEvents[0].getState()); + assertEquals("foo > 10", ustEvents[0].getFilterExpression()); + } + + @Test + public void testListContext28() throws ExecutionException { + ((LTTngControlService)fService).setVersion("2.8.0"); + fShell.setScenario(SCEN_LIST_CONTEXT_28); + + List availContexts = fService.getContextList(new NullProgressMonitor()); + assertNotNull(availContexts); + assertEquals(12, availContexts.size()); + + Set expectedContexts = new HashSet<>(); + expectedContexts.add("pid"); + expectedContexts.add("procname"); + expectedContexts.add("prio"); + expectedContexts.add("nice"); + expectedContexts.add("vpid"); + expectedContexts.add("tid"); + expectedContexts.add("pthread_id"); + expectedContexts.add("vtid"); + expectedContexts.add("ppid"); + expectedContexts.add("vppid"); + expectedContexts.add("perf:cpu:cpu-cycles"); + expectedContexts.add("perf:cpu:cycles"); + + assertTrue(expectedContexts.containsAll(availContexts)); + } +} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java index 01abe38254..4fb1365d21 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java @@ -17,9 +17,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.util.HashSet; import java.util.List; -import java.util.Set; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.NullProgressMonitor; @@ -35,7 +33,6 @@ import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState; import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.SessionInfo; import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService; import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LttngVersion; import org.junit.Ignore; @@ -45,15 +42,12 @@ import org.junit.Test; * @author ejorajo * */ -@SuppressWarnings("javadoc") public class LTTngControlServiceMiTest extends LTTngControlServiceTest { private static final String MI_TEST_STREAM = "LTTngServiceMiTest.cfg"; private static final String SCEN_SESSION_WITH_SYSCALLS = "GetSessionWithSyscalls"; private static final String SCEN_LIST_SESSION_2_7_COMPAT = "ListSession2.7Compat"; - private static final String SCEN_GET_SESSION_FILTER_EXPRESSION = "GetSessionFilterExpression"; - private static final String SCEN_LIST_CONTEXT_28 = "ListContext28"; @Override protected ILttngControlService getControlService() { @@ -160,32 +154,6 @@ public class LTTngControlServiceMiTest extends LTTngControlServiceTest { // is wrong for 2.6. } - @Test - public void testListContext28() throws ExecutionException { - ((LTTngControlService)fService).setVersion("2.8.0"); - fShell.setScenario(SCEN_LIST_CONTEXT_28); - - List availContexts = fService.getContextList(new NullProgressMonitor()); - assertNotNull(availContexts); - assertEquals(12, availContexts.size()); - - Set expectedContexts = new HashSet<>(); - expectedContexts.add("pid"); - expectedContexts.add("procname"); - expectedContexts.add("prio"); - expectedContexts.add("nice"); - expectedContexts.add("vpid"); - expectedContexts.add("tid"); - expectedContexts.add("pthread_id"); - expectedContexts.add("vtid"); - expectedContexts.add("ppid"); - expectedContexts.add("vppid"); - expectedContexts.add("perf:cpu:cpu-cycles"); - expectedContexts.add("perf:cpu:cycles"); - - assertTrue(expectedContexts.containsAll(availContexts)); - } - @Override public void testCreateSnapshotSession2_5() { // not applicable for MI @@ -336,76 +304,4 @@ public class LTTngControlServiceMiTest extends LTTngControlServiceTest { fail(e.toString()); } } - - @Test - public void testGetSessionWithFilterExpression() throws ExecutionException { - // FIXME: Disable scheme validation for now until MI 3.0 is integrated - LTTngControlServiceMI service = new LTTngControlServiceMI(getShell(), null); - - fShell.setScenario(SCEN_GET_SESSION_FILTER_EXPRESSION); - ISessionInfo session = service.getSession("mysession", new NullProgressMonitor()); - - // Verify Session - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath()); - assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); - - IDomainInfo[] domains = session.getDomains(); - assertNotNull(domains); - assertEquals(2, domains.length); - - // Verify Kernel domain - assertEquals("Kernel", domains[0].getName()); - IChannelInfo[] channels = domains[0].getChannels(); - assertNotNull(channels); - assertEquals(1, channels.length); - - // Verify Kernel's channel0 - assertEquals("channel0", channels[0].getName()); - assertEquals(4, channels[0].getNumberOfSubBuffers()); - assertEquals("splice()", channels[0].getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channels[0].getOutputType()); - assertEquals(false, channels[0].isOverwriteMode()); - assertEquals(200, channels[0].getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channels[0].getState()); - assertEquals(262144, channels[0].getSubBufferSize()); - assertEquals(0, channels[0].getSwitchTimer()); - - // Verify event info - IEventInfo[] channel0Events = channels[0].getEvents(); - assertNotNull(channel0Events); - assertEquals(1, channel0Events.length); - assertEquals("block_rq_remap", channel0Events[0].getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[0].getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, channel0Events[0].getEventType()); - assertEquals(TraceEnablement.ENABLED, channel0Events[0].getState()); - assertEquals("foo > 10", channel0Events[0].getFilterExpression()); - - // Verify domain UST global - assertEquals("UST global", domains[1].getName()); - - IChannelInfo[] ustChannels = domains[1].getChannels(); - - // Verify UST global's channel0 - assertEquals("channel0", ustChannels[0].getName()); - assertEquals(4, ustChannels[0].getNumberOfSubBuffers()); - assertEquals("mmap()", ustChannels[0].getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, ustChannels[0].getOutputType()); - assertEquals(false, ustChannels[0].isOverwriteMode()); - assertEquals(200, ustChannels[0].getReadTimer()); - assertEquals(TraceEnablement.ENABLED, ustChannels[0].getState()); - assertEquals(4096, ustChannels[0].getSubBufferSize()); - assertEquals(0, ustChannels[0].getSwitchTimer()); - - // Verify event info - IEventInfo[] ustEvents = ustChannels[0].getEvents(); - assertEquals(1, ustEvents.length); - - assertEquals("ust_tests_hello:tptest_sighandler", ustEvents[0].getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, ustEvents[0].getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, ustEvents[0].getEventType()); - assertEquals(TraceEnablement.DISABLED, ustEvents[0].getState()); - assertEquals("foo > 10", ustEvents[0].getFilterExpression()); - } } 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 07194ef60a..17273b4b39 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 @@ -73,11 +73,11 @@ public class LTTngControlServiceTest { private static final String TEST_STREAM = "LTTngServiceTest.cfg"; private static final String SCEN_LTTNG_NOT_INSTALLED = "LttngNotInstalled"; - private static final String SCEN_LTTNG_VERSION = "LttngVersion"; - private static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt"; + protected static final String SCEN_LTTNG_VERSION = "LttngVersion"; + protected static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt"; private static final String SCEN_LTTNG_UNSUPPORTED_VERSION = "LttngUnsupportedVersion"; private static final String SCEN_LTTNG_NO_VERSION = "LttngNoVersion"; - private static final String SCEN_LTTNG_COMPILED_VERSION = "LttngVersionCompiled"; + protected static final String SCEN_LTTNG_COMPILED_VERSION = "LttngVersionCompiled"; private static final String SCEN_NO_SESSION_AVAILABLE = "NoSessionAvailable"; private static final String SCEN_GET_SESSION_NAMES1 = "GetSessionNames1"; private static final String SCEN_GET_SESSION_WITH_GROUP = "GetSessionWithTracingGroup"; 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 new file mode 100644 index 0000000000..bee5051d43 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMi3Test.cfg @@ -0,0 +1,2803 @@ +#################################################################### +# 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 +# accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Jonathan Rajotte - Initial API and implementation +# Bernd Hufmann - Added new test cases +# Marc-Andre Laperle - Adapted to MI 3.0 (LTTng 2.8) +#################################################################### +#################################################################### +# Scenario: Test lttng not installed +#################################################################### + +LttngNotInstalled + +lttng --mi xml list + + +1 + + + +Command not found + + + + +#################################################################### +# Scenario: Test lttng version +#################################################################### + +LttngVersion + +lttng version + + +0 + + +lttng version 2.8.0 - Isseki Nicho +Web site: http://lttng.org + +lttng is free software and under the GPL license and part LGPL + + + +#################################################################### +# Scenario: Test lttng version +# output with prompt +#################################################################### + +LttngVersionWithPrompt + +lttng version + + +0 + + +Prompt> lttng version 2.8.0 - Isseki Nicho +Web site: http://lttng.org + +lttng is free software and under the GPL license and part LGPL + + + +#################################################################### +# Scenario: Test lttng version (unsupported version) +#################################################################### + +LttngUnsupportedVersion + +lttng version + + +0 + + +lttng version 200.0.0 - Annedd'ale +Web site: http://lttng.org/ + +lttng is free software and under the GPL license and part LGPL + + + + +#################################################################### +# Scenario: Test lttng version (noversion) +#################################################################### + +LttngNoVersion + +lttng version + + +0 + + +Web site: http://lttng.org/ + +lttng is free software and under the GPL license and part LGPL + + + +#################################################################### +# Scenario: Test lttng version (compiled from source) +#################################################################### + +LttngVersionCompiled + +lttng --mi xml version + + +0 + + + + + version + + + 2.8.0-rc1 + 2 + 8 + v2.8.0-rc1-29-g55b4b79 + 0 + Isseki Nicho + The result of a collaboration between "Dieu du Ciel!" and Nagano-based "Shiga Kogen", Isseki Nicho is a strong Imperial Dark Saison offering a rich roasted malt flavor combined with a complex fruity finish typical of Saison yeasts. + https://lttng.org + lttng is free software and under the GPL license and part LGPL + + + + + + +#################################################################### +# Scenario: Test no sessions available +#################################################################### + +NoSessionAvailable + +lttng --mi xml list + + +0 + + + +list + + + +#################################################################### +# Scenario: Test get sessions +#################################################################### + +GetSessionNames1 + +lttng --mi xml list + + +0 + + + + + list + + + + mysession1 + home/user/lttng-traces/mysession1-20120123-083928 + false + 0 + 0 + + + mysession + home/user/lttng-traces/mysession-20120123-083318 + false + 0 + 0 + + + + + + + +#################################################################### +# Scenario: Test get sessions with tracing group +#################################################################### + +GetSessionWithTracingGroup + +lttng -g group --mi xml list + + +0 + + + + + list + + + + mysession1 + home/user/lttng-traces/mysession1-20120123-083928 + false + 0 + 0 + + + mysession + home/user/lttng-traces/mysession-20120123-083318 + false + 0 + 0 + + + + + + + + +#################################################################### +# Scenario: Test lttng list where session doesn't exist +#################################################################### + +GetSessionNameNotExist + +lttng --mi xml list test + + +1 + + + +list + +Error: Session 'test' not found +Error: Command error + + + + +#################################################################### +# Scenario: Test lttng -vvv list where session doesn't exist +#################################################################### + +GetSessionNameNotExistVerbose + +lttng --mi xml -vvv list test + + +1 + + + +list + +Error: Session 'test' not found +Error: Command error + + + + +#################################################################### +# Scenario: Test lttng list with garbage output +#################################################################### + +GetSessionGarbageOut + +lttng --mi xml list + + +0 + + +asdfaereafsdcv 12333456434&*89**(())(^%$* +@#$%^&*()@#$%^&*()0834523094578kj;djkfs +a;sdf094v5u dsafj;sd9 + + + +#################################################################### +# Scenario: Test lttng list with sample outputs +#################################################################### + +GetSession1 + +lttng --mi xml list mysession + + +0 + + + + + list + + + + mysession + /home/user/lttng-traces/mysession-20120129-084256 + true + 0 + 0 + + + KERNEL + PER_PID + + + channel0 + true + + DISCARD + 262144 + 4 + 0 + 200 + SPLICE + 0 + 0 + 0 + + + + block_rq_remap + TRACEPOINT + true + TRACE_EMERG + ALL + + + block_bio_remap + TRACEPOINT + false + TRACE_EMERG + ALL + + + + + channel1 + false + + OVERWRITE + 524288 + 4 + 100 + 400 + SPLICE + 0 + 0 + 4294967295 + + + + + + + UST + PER_UID + + + mychannel1 + false + + OVERWRITE + 8192 + 8 + 200 + 100 + MMAP + 0 + 0 + 0 + + + + + channel0 + true + + DISCARD + 4096 + 4 + 0 + 200 + MMAP + 0 + 0 + 0 + + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + false + TRACE_DEBUG_LINE + ALL + + + * + TRACEPOINT + true + + + + + + + + + + + + +lttng --mi xml list mysession1 + + +0 + + + + + list + + + + mysession1 + /home/user/lttng-traces/mysession1-20120203-133225 + false + 0 + 0 + + + + + + + + +#################################################################### +# Scenario: Test lttng list in the presence of filter expressions +#################################################################### + +GetSessionFilterExpression + +lttng --mi xml list mysession + + +0 + + + + + list + + + + mysession + /home/user/lttng-traces/mysession-20120129-084256 + true + 0 + 0 + + + KERNEL + PER_PID + + + channel0 + true + + DISCARD + 262144 + 4 + 0 + 200 + SPLICE + 0 + 0 + 0 + + + + block_rq_remap + TRACEPOINT + true + foo > 10 + TRACE_EMERG + ALL + + + + + + + UST + PER_UID + + + channel0 + true + + DISCARD + 4096 + 4 + 0 + 200 + MMAP + 0 + 0 + 0 + + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + false + foo > 10 + TRACE_DEBUG_LINE + ALL + + + + + + + + + + + + + +#################################################################### +# Scenario: Test lttng list (with live time interval) +#################################################################### + +GetSessionWithLiveInterval + +lttng --mi xml list mysession + + +0 + + + + + list + + + + mysession + /home/user/lttng-traces/mysession-20120129-084256 + false + 1 + 4294967295 + + + + + + + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot list-output -s mysession + + +0 + + + + + snapshot + + + list-output + + + mysession + + + 1 + snapshot-1 + /home/user/lttng-traces/mysession-20120129-084256 + + 0 + + + + + + + true + + +#------------------------------------------------------------------------------ + +lttng --mi xml list mysession1 + + +0 + + + + + list + + + + mysession1 + /home/user/lttng-traces/mysession1-20120129-084256 + true + 0 + 0 + + + + + + +#------------------------------------------------------------------------------ + +lttng --mi xml list mysession2 + + +0 + + + + + list + + + + mysession2 + tcp4://172.0.0.1:5342/ [data: 5343] + false + 0 + 1000000 + + + + + + + + + + +#################################################################### +# Scenario: Test "lttng list -k" with sample output +#################################################################### + +GetKernelProvider1 + +lttng --mi xml list -k + + +0 + + + + + list + + + + KERNEL + PER_PID + + + sched_kthread_stop + TRACEPOINT + true + TRACE_EMERG + ALL + + + sched_kthread_stop_ret + TRACEPOINT + true + TRACE_EMERG + ALL + + + sched_wakeup_new + TRACEPOINT + true + TRACE_EMERG + ALL + + + + + + + + + +#################################################################### +# Scenario: Test "lttng list -k" with no kernel and no session daemon +#################################################################### + +ListWithNoKernel1 + +lttng --mi xml list -k + + +1 + + +Spawning session daemon + +Error: Unable to list kernel events + + + + +#################################################################### +# Scenario: Test "lttng list -k" with no kernel and with session daemon +#################################################################### + +ListWithNoKernel2 + +lttng --mi xml list -k + + +1 + + + +Error: Unable to list kernel events + + + + +#################################################################### +# Scenario: Test "lttng list -u" with sample output +#################################################################### + +GetUstProvider1 + +lttng --mi xml list -u -f + + +0 + + + + + list + + + + UST + PER_PID + + + 9379 + /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + true + TRACE_DEBUG_MODULE + ALL + + + + ust_tests_hello:tptest + TRACEPOINT + true + TRACE_INFO + ALL + + + doublefield + FLOAT + 0 + + + floatfield + FLOAT + 0 + + + stringfield + STRING + 0 + + + + + + + 4852 + /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + true + TRACE_WARNING + ALL + + + + ust_tests_hello:tptest + TRACEPOINT + true + TRACE_DEBUG_FUNCTION + ALL + + + doublefield + FLOAT + 0 + + + floatfield + FLOAT + 0 + + + stringfield + STRING + 0 + + + + + + + + + + + + + +#################################################################### +# Scenario: Test "lttng list -u" with no UST provider available +#################################################################### + +GetUstProvider2 + +lttng --mi xml list -u -f + + +0 + + + + + list + + + + UST + PER_PID + + + + + + + + +#################################################################### +# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x) +#################################################################### + +ListWithNoUst1 + +lttng --mi xml list -u -f + + +1 + + + +list + +Error: Unable to list UST event fields: LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled. +Error: Command error + + + +#################################################################### +# Scenario: Test "lttng list -u" with no UST available and no session daemon +#################################################################### + +ListWithNoUst2 + +lttng --mi xml list -u -f + + +1 + + + +list + +Error: Unable to list UST event fields: LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled. +Error: Command error + + + +#################################################################### +# Scenario: Test "lttng list -" with no kernel and with session daemon +#################################################################### + +ListWithNoUst3 + +lttng --mi xml list -u -f + + +1 + + + +list + +Error: Unable to list kernel events: Tracing the kernel requires a root lttng-sessiond daemon, as well as "tracing" group membership or root user ID for the lttng client. +Error: Command Error + + + + +#################################################################### +# Scenario: Test "lttng list -u -f" with sample output (version 2.6.0) +#################################################################### + +GetUstProvider3 + +lttng --mi xml list -u -f + + +0 + + + + + list + + + + UST + PER_PID + + + 9379 + /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + true + TRACE_DEBUG_MODULE + ALL + + + + ust_tests_hello:tptest + TRACEPOINT + true + TRACE_INFO + ALL + + + doublefield + FLOAT + 0 + + + floatfield + FLOAT + 0 + + + stringfield + STRING + 0 + + + + + + + 4852 + /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + true + TRACE_WARNING + ALL + + + + ust_tests_hello:tptest + TRACEPOINT + true + TRACE_DEBUG_FUNCTION + ALL + + + doublefield + FLOAT + 0 + + + floatfield + FLOAT + 0 + + + stringfield + STRING + 0 + + + + + + + + + + + + +#################################################################### +# Scenario: Test "lttng create +#################################################################### + +CreateSession1 + +lttng --mi xml create mysession2 + + +0 + + + + + create + + + mysession2 + /home/user/lttng-traces/mysession2-20120209-095418 + false + 0 + 0 + + + true + + + + +#################################################################### +# Scenario: Test "lttng create +#################################################################### + +CreateSessionWithPrompt + +lttng --mi xml create mysession2 + + +0 + + +Prompt> Session mysession2 created. +Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418 + + + +#################################################################### +# Scenario: Test "lttng create with different variants +# and errors +#################################################################### + +CreateSessionVariants + +lttng --mi xml create alreadyExist + + +1 + + + + + create + + false + + +Warning: Session mysession2 already exists +Error: Session name already exists + + + + +lttng --mi xml create session with spaces + + +0 + + + + + create + + + session with spaces + /home/user/lttng-traces/session with spaces-20120209-095418 + false + 0 + 0 + + + true + + + + +lttng --mi xml create wrongName + + +0 + + + + + create + + + auto + /home/user/lttng-traces/auto-20120209-095418 + false + 0 + 0 + + + true + + + + +lttng --mi xml create wrongPath -o /home/user/hallo + + +0 + + + + + create + + + wrongPath + /home/user/lttng-traces/wrongPath-20120209-095418 + false + 0 + 0 + + + true + + + + +lttng --mi xml create pathWithSpaces -o /home/user/hallo user/here + + +0 + + + + + create + + + pathWithSpaces + /home/user/hallo user/here/pathWithSpaces-20120209-095418 + false + 0 + 0 + + + true + + + + +#################################################################### +# Scenario: Test "lttng destroy +#################################################################### + + +DestroySession1 + +lttng --mi xml destroy mysession2 + + +0 + + + + + destroy + + + + mysession2 + /home/user/lttng-traces/mysession2-20140812-160632 + false + 0 + 0 + + + + true + + + + +#################################################################### +# Scenario: Test "lttng enable-channel ..." with different inputs +#################################################################### + + +ChannelHandling + +lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10 + + +0 + + +Kernel channel mychannel0 enabled for session mysession2 +Kernel channel mychannel1 enabled for session mysession2 + + + +lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 + + +0 + + + + + enable-channel + + + + mychannel0 + false + + OVERWRITE + 16384 + 2 + 200 + 100 + SPLICE + 0 + 0 + 4294967295 + + true + + + mychannel1 + false + + OVERWRITE + 16384 + 2 + 200 + 100 + SPLICE + 0 + 0 + 4294967295 + + true + + + + true + + + + +lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20 + + +0 + + +UST channel channel0 enabled for session mysession2 + + + +lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 + + +0 + + + + + enable-channel + + + + ustChannel + false + + OVERWRITE + 32768 + 2 + 100 + 200 + MMAP + 0 + 0 + 4294967295 + + true + + + + true + + + + +lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid -C 0 -W 20 + + +0 + + +UST channel channel0 enabled for session mysession2 + + + +lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid + + +0 + + + + + enable-channel + + + + ustChannel + false + + OVERWRITE + 4096 + 4 + 0 + 0 + MMAP + 0 + 0 + 4294967295 + + true + + + + true + + + + +lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200 --buffers-uid + + +0 + + + + + enable-channel + + + + ustChannel + false + + OVERWRITE + 32768 + 2 + 100 + 200 + MMAP + 0 + 0 + 4294967295 + + true + + + + true + + + + + +lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 + + +0 + + + + + enable-channel + + + + mychannel0 + false + + DISCARD + 262144 + 4 + 0 + 200000 + SPLICE + 0 + 0 + 4294967295 + + true + + + mychannel1 + false + + DISCARD + 262144 + 4 + 0 + 200000 + SPLICE + 0 + 0 + 4294967295 + + true + + + + true + + + + +lttng --mi xml enable-channel ustChannel -u -s mysession2 + + +0 + + + + + enable-channel + + + + ustChannel + false + + DISCARD + 131072 + 4 + 0 + 0 + MMAP + 0 + 0 + 4294967295 + + true + + + + true + + + + +lttng --mi xml disable-channel mychannel0,mychannel1 -k -s mysession2 + + +0 + + + + + disable-channel + + + + mychannel0 + false + true + + + mychannel1 + false + true + + + + true + + + + +lttng --mi xml disable-channel ustChannel -u -s mysession2 + + +0 + + + + + disable-channel + + + + ustChannel + false + true + + + + true + + + + + +#################################################################### +# Scenario: Test "lttng --mi xml enable-events ..." with different inputs +#################################################################### + +EventHandling + +# Tracepoint test cases + + +lttng --mi xml enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint + + +0 + + + + + enable-event + + + + block_rq_remap + TRACEPOINT + true + TRACE_EMERG + ALL + true + + + block_bio_remap + TRACEPOINT + true + TRACE_EMERG + ALL + true + + + softirq_entry + TRACEPOINT + true + TRACE_EMERG + ALL + true + + + + true + + + + +lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --tracepoint + + +0 + + + + + enable-event + + + + * + TRACEPOINT + true + TRACE_EMERG + ALL + true + + + + true + + + + +lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint + + +0 + + + + + enable-event + + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + true + true + + + + true + + + + +lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter intfield==10 + + +0 + + + + + enable-event + + + + ust_tests_hello:tptest_sighandler + TRACEPOINT + true + true + + + + true + + + + +lttng --mi xml enable-event -a -u -s mysession2 -c mychannel --tracepoint + + +0 + + + + + enable-event + + + + * + TRACEPOINT + true + true + + + + true + + + +# Syscall test cases + + +lttng --mi xml enable-event -a -k -s mysession2 --syscall + + +0 + + + + + enable-event + + + + * + SYSCALL + true + true + + + + true + + + + +lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --syscall + + +0 + + + + + enable-event + + + + * + SYSCALL + true + true + + + + true + + + +# dynamic probe/function probe test cases + + +lttng --mi xml enable-event myevent0 -k -s mysession2 --function 0xc0101340 + + +0 + + + + + enable-event + + + + myevent0 + FUNCTION + false + true + + + + true + + + + +lttng --mi xml enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post + + +0 + + + + + enable-event + + + + myevent1 + PROBE + false + 0 + init_post + true + + + + true + + + + +# log level test cases + + +lttng --mi xml enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG + + +0 + + + + + enable-event + + + + myevent4 + TRACEPOINT + true + TRACE_DEBUG + SINGLE + true + + + + true + + + + +lttng --mi xml enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION + + +0 + + + + + enable-event + + + + myevent5 + TRACEPOINT + true + TRACE_DEBUG_FUNCTION + RANGE + true + + + + true + + + + + +#################################################################### +# Scenario: Test "lttng add-context -h" and lttng --mi xml add-context ..." with different inputs +#################################################################### + + +ContextHandling + + +lttng --mi xml add-context -h + + +0 + + +usage: lttng add-context -t TYPE [-k|-u] [OPTIONS] + +If no channel is given (-c), the context is added to +all channels. + +Otherwise the context is added only to the channel (-c). + +Exactly one domain (-k or -u) must be specified. + +Options: + -h, --help Show this help + --list-options Simple listing of options + -s, --session NAME Apply to session name + -c, --channel NAME Apply to channel + -k, --kernel Apply to the kernel tracer + -u, --userspace Apply to the user-space tracer + +Context: + -t, --type TYPE Context type. You can repeat that option on + the command line to specify multiple contexts at once. + (--kernel preempts --userspace) + TYPE can be one of the strings below: + pid, procname, prio, nice, vpid, tid, pthread_id, + vtid, ppid, vppid, perf:cpu:cpu-cycles, perf:cpu:cycles +Note that the vpid, vppid and vtid context types represent the virtual process id, +virtual parent process id and virtual thread id as seen from the current execution context +as opposed to the pid, ppid and tid which are kernel internal data structures. + +Example: +This command will add the context information 'prio' and two per-cpu +perf counters (hardware branch misses and cache misses), to all channels +in the trace data output: +# lttng add-context -k -t prio -t perf:cpu:branch-misses -t perf:cpu:cache-misses + + + +lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid + + +0 + + +UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel +UST context pid added to event sched_kthread_stop_ret channel mychannel + + + +#################################################################### +# Scenario: Test "lttng --mi xml add-context --list" +#################################################################### + + +ListContext28 + + +lttng --mi xml add-context --list + + +0 + + +pid +procname +prio +nice +vpid +tid +pthread_id +vtid +ppid +vppid +perf:cpu:cpu-cycles +perf:cpu:cycles + + + + +ContextErrorHandling + + +lttng --mi xml add-context -h + + +1 + + +usage: lttng add-context -t TYPE + +If no channel and no event is given (-c/-e), the context +will be added to all events and all channels. +Otherwise the context will be added only to the channel (-c) +and/or event (-e) indicated. +Exactly one domain (-k/--kernel or -u/--userspace) must be specified. + +Options: + -h, --help Show this help + --list-options Simple listing of options + -s, --session NAME Apply to session name + -c, --channel NAME Apply to channel + -e, --event NAME Apply to event + -k, --kernel Apply to the kernel tracer + -u, --userspace Apply to the user-space tracer + -t, --type TYPE Context type. You can repeat that option on + the command line to specify multiple contexts at once. + (--kernel preempts --userspace) + TYPE can be one of the strings below: + pid, procname, prio, nice, vpid, tid, pthread_id, + vtid, ppid, vppid, perf:cpu-cycles, perf:cycles +Example: +This command will add the context information 'prio' and two perf +counters (hardware branch misses and cache misses), to all events +in the trace data output: +# lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses + + + + +lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid + + +1 + + +UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel +UST context pid added to event sched_kthread_stop_ret channel mychannel + + + + +#################################################################### +# Scenario: Test "lttng create with LTTng 2.1 options +#################################################################### + +CreateSessionLttng2.1 + + +lttng --mi xml create mysession -U net://172.0.0.1 + + +0 + + + + + create + + + mysession + tcp4://172.0.0.1:5342/mysession-20140813-095804 [data: 5343] + false + 0 + 0 + + + true + + + + +lttng --mi xml create mysession -U file:///tmp + + +0 + + + + + create + + + mysession + /tmp + false + 0 + 0 + + + true + + + + +lttng --mi xml create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343 + + +0 + + + + + create + + + mysession + tcp4://172.0.0.1:5342/ [data: 5343] + false + 0 + 0 + + + true + + + + +lttng --mi xml create mysession -U 172.0.0.1:1234:2345 + + +0 + + + + + create + + + mysession + tcp4://172.0.0.1:1234/mysession-20140813-102225 [data: 2345] + false + 0 + 0 + + + true + + + + +lttng --mi xml destroy mysession + + +0 + + + + + destroy + + + + mysession + /home/user/lttng-traces/mysession-20140818-100114 + false + 0 + 0 + + + + true + + + + +lttng --mi xml -vvv create mysession -U net://172.0.0.1 + + +0 + + +DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253] +DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132] +DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] +DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] +Session mysession created. +Traces will be written in net://172.0.0.1 +DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294] + + + + +#################################################################### +# Scenario: Test "lttng create --snapshot (LTTng 2.3) +#################################################################### + +CreateSessionSnapshot + +lttng --mi xml create mysession --snapshot + + +0 + + + + + create + + + mysession + + false + 1 + 4294967295 + + + true + + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot list-output -s mysession + + +0 + + + + + snapshot + + + list-output + + + mysession + + + 1 + snapshot-1 + /home/user/lttng-traces/mysession-20130913-141651 + + 0 + + + + + + + true + + +#------------------------------------------------------------------------------ + +lttng --mi xml list + + +0 + + + + + list + + + + mysession + + false + 1 + 4294967295 + + + + + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot record -s mysession + + +0 + + + Snapshot recorded successfully for session mysession + +#------------------------------------------------------------------------------ + +lttng --mi xml destroy mysession + + +0 + + + + + destroy + + + + mysession + /home/user/lttng-traces/mysession-20140818-100114 + false + 0 + 0 + + + + true + + + + +#################################################################### +# Scenario: Test "lttng create --snapshot -U (LTTng 2.3) +#################################################################### + +CreateSessionStreamedSnapshot + +lttng --mi xml create mysession --snapshot -U net://172.0.0.1 + + +0 + + +Session mysession created. +Default snapshot output set to: net://172.0.0.1 +Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output. + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot list-output -s mysession + + +0 + + +Snapshot output list for session mysession + [2] snapshot-2: net4://172.0.0.1:5342/ + +#------------------------------------------------------------------------------ + +lttng --mi xml list + + +0 + + + 1) mysession () [inactive snapshot] + + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot record -s mysession + + +0 + + + Snapshot recorded successfully for session mysession + +#------------------------------------------------------------------------------ + +lttng --mi xml destroy mysession + + +0 + + + + + destroy + + + + mysession + /home/user/lttng-traces/mysession-20140818-100114 + false + 0 + 0 + + + + true + + + + +#################################################################### +# Scenario: Test "lttng create --snapshot (LTTng 2.3) +#################################################################### + +CreateSessionSnapshotErrors + +lttng --mi xml snapshot list-output -s blabla + + +1 + + + + + + snapshot + + + list-output + + + + false + + + +#------------------------------------------------------------------------------ +#next is not an error case but good to be tested + +lttng --mi xml list + + +0 + + + + + list + + + + mysession + + true + 1 + 4294967295 + + + + + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot record -s blabla + + +1 + + + + Error: Session name not found + + + + snapshot + + + record + + + + false + + +#------------------------------------------------------------------------------ + +lttng --mi xml snapshot record -s mysession + + +1 + + + + Error: Session needs to be started once + + + + snapshot + + + record + + + + false + + + + + +#################################################################### +# Scenario: Test "lttng create --live [USEC] (LTTng 2.4) +#################################################################### + +CreateSessionLive + +lttng --mi xml create mysession --live -U net://127.0.0.1 + + +0 + + + + + create + + + mysession + tcp4://127.0.0.1:5342/ [data: 5343] + false + 0 + 1000000 + + + true + + +#------------------------------------------------------------------------------ + +lttng --mi xml list + + +0 + + + + + list + + + + mysession + tcp4://127.0.0.1:5342/ [data: 5343] + false + 0 + 1000000 + + + + + +#------------------------------------------------------------------------------ + +lttng --mi xml destroy mysession + + +0 + + + + + destroy + + + + mysession + /home/user/lttng-traces/mysession-20140818-100114 + false + 0 + 0 + + + + true + + + + +#################################################################### +# Scenario: Test errors for "lttng create --live [USEC] (LTTng 2.4) +#################################################################### + +CreateSessionLiveErrors + +lttng --mi xml create mysession --live --snapshot + + +1 + + + +Error: Snapshot and live modes are mutually exclusive. +Error: Command error + + +#------------------------------------------------------------------------------ + +lttng --mi xml create mysession --live -U blah + + +1 + + + +Error: URI parse unknown protocol blah +Error: Unable to parse the URL blah +Error: Invalid parameter + + +#------------------------------------------------------------------------------ + +lttng --mi xml create mysession --live -C net://127.0.0.1 + + +1 + + + +Error: You need both control and data URL. +Error: Command error + + + + +#################################################################### +# Scenario: Test "lttng list (version 2.6.0, syscalls) +#################################################################### + +GetSessionWithSyscalls + +lttng --mi xml list mysession + + +0 + + + + + list + + + + mysession + /home/user/lttng-traces/mysession-20120129-084256 + false0 + 0 + + + KERNEL + PER_PID + + + channel0 + true + + DISCARD + 262144 + 4 + 0 + 200 + SPLICE + 0 + 0 + 0 + + + read + SYSCALL + true + + + write + SYSCALL + true + + + + + + + + + + + + +ListSession2.7Compat + +lttng --mi xml list mysession + + +0 + + + + + list + + + + mysession + /home/user/lttng-traces/mysession-20151020-085614 + false + 0 + 0 + + + KERNEL + GLOBAL + + + + channel0 + true + + DISCARD + 262144 + 4 + 0 + 200000 + SPLICE + 0 + 0 + 0 + + + * + SYSCALL + true + + + * + TRACEPOINT + true + TRACE_EMERG + ALL + + + + + + + UST + PER_PID + + + + channel0 + true + + DISCARD + 4096 + 4 + 0 + 0 + MMAP + 0 + 0 + 0 + + + * + TRACEPOINT + true + + + + + + + + + + + +#################################################################### +# Scenario: Test "lttng load [OPTIONS] [SESSION]" +# "lttng save [OPTIONS] [SESSION]" +# (LTTng 2.5) +#################################################################### + +SessionProfile + +lttng --mi xml load -i /home/user/.lttng/sessions/mysession.lttng + + +0 + + +load*.lttng/sessions/seqSession2.lttngtrue + + + +SessionProfile + +lttng --mi xml load -i /home/user/.lttng/sessions/mysession.lttng -f + + +0 + + +load*.lttng/sessions/seqSession2.lttngtrue + + + +lttng --mi xml save + + +0 + + +save*true + + + +lttng --mi xml save mysession + + +0 + + +saveseqSession2true + + + +lttng --mi xml save -f mysession + + +0 + + +saveseqSession2true + + + +lttng --mi xml save -o /tmp/test -f mysession + + +0 + + +saveseqSession2true + + + 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 e88b05f327..faf95338db 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 @@ -457,102 +457,6 @@ lttng --mi xml list mysession1 -#################################################################### -# Scenario: Test lttng list in the presence of filter expressions -#################################################################### - -GetSessionFilterExpression - -lttng --mi xml list mysession - - -0 - - - - - list - - - - mysession - /home/user/lttng-traces/mysession-20120129-084256 - true - 0 - 0 - - - KERNEL - PER_PID - - - channel0 - true - - DISCARD - 262144 - 4 - 0 - 200 - SPLICE - 0 - 0 - 0 - - - - block_rq_remap - TRACEPOINT - true - foo > 10 - TRACE_EMERG - ALL - false - - - - - - - UST - PER_UID - - - channel0 - true - - DISCARD - 4096 - 4 - 0 - 200 - MMAP - 0 - 0 - 0 - - - - ust_tests_hello:tptest_sighandler - TRACEPOINT - false - foo > 10 - TRACE_DEBUG_LINE - ALL - false - - - - - - - - - - - - - #################################################################### # Scenario: Test lttng list (with live time interval) #################################################################### @@ -1990,35 +1894,6 @@ UST context pid added to event sched_kthread_stop_ret channel mychannel -#################################################################### -# Scenario: Test "lttng --mi xml add-context --list" -#################################################################### - - -ListContext28 - - -lttng --mi xml add-context --list - - -0 - - -pid -procname -prio -nice -vpid -tid -pthread_id -vtid -ppid -vppid -perf:cpu:cpu-cycles -perf:cpu:cycles - - - ContextErrorHandling -- 2.34.1