Add JUnit tests for LTTng 2.0 tracer control (add-context/calibrate)
authorBernd Hufmann <bhufmann@gmail.com>
Thu, 12 Apr 2012 18:08:43 +0000 (14:08 -0400)
committerBernd Hufmann <bhufmann@gmail.com>
Thu, 12 Apr 2012 18:08:43 +0000 (14:08 -0400)
16 files changed:
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlKernelSessionTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlTreeModelTest.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/AddContextDialogStub.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/shells/LTTngToolsFileShell.java
org.eclipse.linuxtools.lttng2.ui.tests/testfiles/CreateTreeTest.cfg
org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/ITraceInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/BaseEventInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/ChannelInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/DomainInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/EventInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/ProbeEventInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/SessionInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/UstProviderInfo.java

index cdb2969a53fac83784ac8a48bf67e7d6fd143d86..ac70305cedaf3058a77c4b57eabd8beb58ff6f45 100644 (file)
@@ -22,6 +22,7 @@ import junit.framework.TestSuite;
 
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.AddContextDialogStub;
 import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateChannelDialogStub;
 import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
 import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
@@ -49,7 +50,7 @@ import org.junit.Before;
 import org.osgi.framework.FrameworkUtil;
 
 /**
- * The class <code>TraceControlKernelSessionTests</code> contains UST session/channel/event
+ * The class <code>TraceControlKernelSessionTests</code> contains Kernel session/channel/event
  * handling test cases.
  */
 
@@ -689,6 +690,85 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals("0x2000", probeEvent.getOffset());
         assertNull(null, probeEvent.getAddress());
         assertEquals("create_dev", probeEvent.getSymbol());
+
+        // ------------------------------------------------------------------------
+        // Add Context on domain  
+        // ------------------------------------------------------------------------
+        // Get Kernel domain component instance
+        domains = session.getChildren();
+        assertNotNull(domains);
+        assertEquals(1, domains.length);
+
+        AddContextDialogStub addContextStub = new AddContextDialogStub();
+        List<String> contexts = new ArrayList<String>();
+        contexts.add("prio");
+        contexts.add("perf:branch-misses");
+        contexts.add("perf:cache-misses");
+        addContextStub.setContexts(contexts);
+        TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub);
+        
+        fFacility.executeCommand(domains[0], "addContextOnDomain");
+        // Currently there is nothing to verify because the list commands don't show any context information
+        // However, the execution of the command make sure that the correct service command line is build and executed.
+
+        // ------------------------------------------------------------------------
+        // Add Context on channel  
+        // ------------------------------------------------------------------------
+
+        // Get Kernel domain component instance
+        domains = session.getChildren();
+        assertNotNull(domains);
+        assertEquals(1, domains.length);
+
+        //Verify that channel was created with correct data
+        channels =  domains[0].getChildren();
+        channel = (TraceChannelComponent) channels[0]; 
+        
+        try {
+            // The setContext() verifies that the contexts set are part of the available contexts
+            // The available contexts are set by the command handler addContextOnDomain above.
+            // So we indirectly test here that the parsing and setting of available contexts were
+            // done correctly above.
+            addContextStub.setContexts(contexts);
+        } catch (IllegalArgumentException e) {
+            fail("Exception caught - unknown context");
+        }
+
+        fFacility.executeCommand(channel, "addContextOnChannel");
+        // Currently there is nothing to verify because the list commands don't show any context information
+        // However, the execution of the command make sure that the correct service command line is build and executed.
+        
+        // ------------------------------------------------------------------------
+        // Add Context on event  
+        // ------------------------------------------------------------------------
+        // Get Kernel domain component instance
+        domains = session.getChildren();
+        assertNotNull(domains);
+        assertEquals(1, domains.length);
+
+        //Verify that channel was created with correct data
+        channels =  domains[0].getChildren();
+        channel = (TraceChannelComponent) channels[2]; 
+        
+        channel0Events = channel.getChildren();
+
+        event = (TraceEventComponent) channel0Events[6];
+        
+        fFacility.executeCommand(event, "addContextOnEvent");
+        // Currently there is nothing to verify because the list commands don't show any context information
+        // However, the execution of the command make sure that the correct service command line is build and executed.        
+
+        // ------------------------------------------------------------------------
+        // Calibrate  
+        // ------------------------------------------------------------------------
+        // Get Kernel domain component instance
+        domains = session.getChildren();
+        assertNotNull(domains);
+        assertEquals(1, domains.length);
+        
+        fFacility.executeCommand(domains[0], "calibrate");
+        // There is nothing to verify here. 
+        // However, the execution of the command make sure that the correct service command line is build and executed.
         
         // ------------------------------------------------------------------------
         // refresh 
@@ -707,7 +787,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
         
         session = (TraceSessionComponent)groups[1].getChildren()[0];
-        
+
         // ------------------------------------------------------------------------
         // start session 
         // ------------------------------------------------------------------------
index dcb50f90f8ec2ee738e3af6bd2193c84392ad2c0..2b51940800edf377b03f5e853be779d1d824bf76 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEv
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
@@ -59,6 +60,7 @@ public class TraceControlTreeModelTest extends TestCase {
 
     private static final String TEST_STREAM = "ListInfoTest.cfg";
     private static final String SCEN_LIST_INFO_TEST = "ListInfoTest";
+    private static final String TARGET_NODE_NAME = "myNode";
     
     // ------------------------------------------------------------------------
     // Test data
@@ -127,7 +129,7 @@ public class TraceControlTreeModelTest extends TestCase {
         IHost host = new Host(new SystemProfile("myProfile", true));
         host.setHostName("127.0.0.1");
 
-        TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy);
+        TargetNodeComponent node = new TargetNodeComponent(TARGET_NODE_NAME, root, host, fProxy);
 
         root.addChild(node);
         node.connect();
@@ -290,6 +292,9 @@ public class TraceControlTreeModelTest extends TestCase {
         assertNotNull(channels);
         assertEquals(2, channels.length);
 
+        // Verify setters and setters
+        verifyDomainGettersSetters((TraceDomainComponent) domains[0]);
+        
         // ------------------------------------------------------------------------
         // Verify Kernel's channel0
         // ------------------------------------------------------------------------
@@ -337,6 +342,9 @@ public class TraceControlTreeModelTest extends TestCase {
         assertNull(probeEvent.getOffset());
         assertNull(probeEvent.getSymbol());
 
+        // verify getters and setter
+        verifyProbeEventGettersSetters(probeEvent);
+
         probeEvent = (TraceProbeEventComponent) channel0Events[3];
         assertEquals("myevent0", probeEvent.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
@@ -472,12 +480,45 @@ public class TraceControlTreeModelTest extends TestCase {
         assertNotNull(activeImage);
         assertNotSame(activeImage, inactiveImage);
 
+        ITraceControlComponent[] children = session.getChildren();
+        TraceDomainComponent[] domains = session.getDomains();
+
+        assertEquals(children.length, domains.length);
+
+        for (int i = 0; i < domains.length; i++) {
+            assertEquals(domains[i].getName(), children[i].getName());
+        }
         
         // restore original values      
         session.setName(name);
         session.setSessionPath(origPath);
         session.setSessionState(origState);
     }
+    
+    private void verifyDomainGettersSetters(TraceDomainComponent domain) {
+        // save original values
+        boolean isKernel = domain.isKernel();
+
+        domain.setIsKernel(false);
+        assertFalse(domain.isKernel());
+        domain.setIsKernel(true);
+        assertTrue(domain.isKernel());
+
+        ITraceControlComponent[] children = domain.getChildren();
+        TraceChannelComponent[] channels = domain.getChannels();
+
+        assertEquals(children.length, channels.length);
+
+        for (int i = 0; i < channels.length; i++) {
+            assertEquals(channels[i].getName(), children[i].getName());
+        }
+
+        String nodeName = domain.getTargetNode().getName();
+        assertEquals(TARGET_NODE_NAME, nodeName);
+
+        // restore original values
+        domain.setIsKernel(isKernel);
+    }
 
     private void verifyBaseEventGettersSetters(BaseEventComponent event) {
         // save original values
@@ -546,6 +587,28 @@ public class TraceControlTreeModelTest extends TestCase {
         event.setState(state);
     }
     
+    private void verifyProbeEventGettersSetters(TraceProbeEventComponent event) {
+        // save original values
+        String address = event.getAddress();
+        String offset = event.getOffset();
+        String symbol = event.getSymbol();
+        
+        // test cases
+        event.setAddress("0xffff1234");
+        assertEquals("0xffff1234", event.getAddress());
+        
+        event.setOffset("0x1234");
+        assertEquals("0x1234", event.getOffset());
+        
+        event.setSymbol("init");
+        assertEquals("init", event.getSymbol());
+        
+        // restore original values
+        event.setAddress(address);
+        event.setOffset(offset);
+        event.setSymbol(symbol);
+    }
+    
     private void verifyChannelGettersSetters(TraceChannelComponent channel) {
         // save original values
         String name = channel.getName();
index c8a2bdaba7a5ce0769143543fac291f0f909ff7d..b3bb210e6b03669e99a3ab40caa281a92c6a0004 100644 (file)
@@ -14,7 +14,10 @@ package org.eclipse.linuxtools.lttng2.ui.tests.control.service;
 import java.io.File;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import junit.framework.TestCase;
 
@@ -62,6 +65,9 @@ public class LTTngControlServiceTest extends TestCase {
     private static final String SCEN_DESTROY_SESSION1 = "DestroySession1";
     private static final String SCEN_CHANNEL_HANDLING = "ChannelHandling";
     private static final String SCEN_EVENT_HANDLING = "EventHandling";
+    private static final String SCEN_CONTEXT_HANDLING = "ContextHandling";
+    private static final String SCEN_CONTEXT_ERROR_HANDLING = "ContextErrorHandling";
+    private static final String SCEN_CALIBRATE_HANDLING = "CalibrateHandling";
 
     // ------------------------------------------------------------------------
     // Test data
@@ -654,4 +660,91 @@ public class LTTngControlServiceTest extends TestCase {
         }
     }
     
+    public void testAddContext() {
+        try {
+            // 1) session name, channel = null, 3 event names, kernel
+            String sessionName = "mysession2";
+            String channelName = "mychannel";
+            String eventName = "ust_tests_hello:tptest_sighandler";
+            List<String> contexts = new ArrayList<String>();
+            contexts.add("prio");
+            contexts.add("pid");
+
+            fShell.setScenario(SCEN_CONTEXT_HANDLING);
+
+            List<String> availContexts = fService.getContextList(new NullProgressMonitor());
+            assertNotNull(availContexts);
+            assertEquals(12, availContexts.size());
+
+            // A very "hard-coded" way to verify but it works ...  
+            Set<String> expectedContexts = new HashSet<String>();
+            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-cycles");
+            expectedContexts.add("perf:cycles");
+            
+            assertTrue(expectedContexts.containsAll(availContexts));
+            
+            // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
+            fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
+
+        } catch (ExecutionException e) {
+            fail(e.toString());
+        }
+    }
+
+    public void testAddContextFailure() {
+
+        // 1) session name, channel = null, 3 event names, kernel
+        String sessionName = "mysession2";
+        String channelName = "mychannel";
+        String eventName = "ust_tests_hello:tptest_sighandler";
+        List<String> contexts = new ArrayList<String>();
+        contexts.add("prio");
+        contexts.add("pid");
+        fShell.setScenario(SCEN_CONTEXT_ERROR_HANDLING);
+        try {
+            fService.getContextList(new NullProgressMonitor());
+            fail("No exeption generated");
+        } catch (ExecutionException e) {
+            // success
+        } 
+        try {
+            // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
+            fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
+            fail("No exeption generated");
+        } catch (ExecutionException e) {
+            // success
+        } 
+    }
+
+    public void testCalibrate() {
+        try {
+            fShell.setScenario(SCEN_CALIBRATE_HANDLING);
+            fService.calibrate(true, new NullProgressMonitor());
+
+        } catch (ExecutionException e) {
+            fail(e.toString());
+        }
+    }
+
+    public void testCalibrateFailure() {
+
+        try {
+            fShell.setScenario(SCEN_CALIBRATE_HANDLING);
+            fService.calibrate(false, new NullProgressMonitor());
+            fail("No exeption generated");
+        } catch (ExecutionException e) {
+            // success
+        } 
+    }
+    
 }
diff --git a/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/AddContextDialogStub.java b/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/AddContextDialogStub.java
new file mode 100644 (file)
index 0000000..65bb0fa
--- /dev/null
@@ -0,0 +1,62 @@
+/**********************************************************************
+ * Copyright (c) 2012 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: 
+ *   Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IAddContextDialog;
+
+/**
+ * Add Context dialog stub. 
+ */
+public class AddContextDialogStub implements IAddContextDialog {
+
+    private Set<String> fAvailableContexts = null;
+    private List<String> fContexts = null;
+
+    @Override
+    public int open() {
+        return 0;
+    }
+
+    @Override
+    public void setAvalibleContexts(List<String> contexts) {
+        fAvailableContexts = new HashSet<String>();
+        fAvailableContexts.addAll(contexts);
+    }
+
+    @Override
+    public List<String> getContexts() {
+        List<String> ret = new ArrayList<String>();
+        ret.addAll(fContexts);
+        return ret;
+    }
+
+    public void setContexts(List<String> contexts) throws IllegalArgumentException{
+        fContexts = new ArrayList<String>();
+        fContexts.addAll(contexts);
+        // If availableContexts are null we cannot verify 
+        if (fAvailableContexts != null) {
+            for (Iterator<String> iterator = fContexts.iterator(); iterator.hasNext();) {
+                String string = (String) iterator.next();
+                if (!fAvailableContexts.contains(string)) {
+                    throw new IllegalArgumentException();
+                }
+            }
+        }
+    }
+}
+
index c77a2b70060eb472214a20256e7b377edb886b51..0aef42a8d7881b6dc8b209b4e1da4d3249d07d28 100644 (file)
@@ -247,7 +247,11 @@ public class LTTngToolsFileShell extends TestCommandShell {
 
         String[] output = new String[1];
         output[0] = String.valueOf("Command not found");
-        return new CommandResult(1, output);
+        CommandResult result = new CommandResult(0, null);
+        // For verification of setters of class CommandResult
+        result.setOutput(output);
+        result.setResult(1);
+        return result;
    }
     
     // ------------------------------------------------------------------------
index 121d281d456481d327828fd018fc37c916635aed..bd22c0c18a9fe17f83586633cbb486e64c4efd9d 100644 (file)
@@ -1473,6 +1473,484 @@ Channels:
 
 </COMMAND_OUTPUT>
 
+<COMMAND_INPUT>
+lttng add-context  -h 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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,
+                               perf:stalled-cycles-frontend,
+                               perf:idle-cycles-frontend,
+                               perf:stalled-cycles-backend,
+                               perf:idle-cycles-backend, perf:instructions,
+                               perf:cache-references, perf:cache-misses,
+                               perf:branch-instructions, perf:branches,
+                               perf:branch-misses, perf:bus-cycles,
+                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
+                               perf:L1-dcache-stores,
+                               perf:L1-dcache-store-misses,
+                               perf:L1-dcache-prefetches,
+                               perf:L1-dcache-prefetch-misses,
+                               perf:L1-icache-loads, perf:L1-icache-load-misses,
+                               perf:L1-icache-stores,
+                               perf:L1-icache-store-misses,
+                               perf:L1-icache-prefetches,
+                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
+                               perf:LLC-load-misses, perf:LLC-stores,
+                               perf:LLC-store-misses, perf:LLC-prefetches,
+                               perf:LLC-prefetch-misses, perf:dTLB-loads,
+                               perf:dTLB-load-misses, perf:dTLB-stores,
+                               perf:dTLB-store-misses, perf:dTLB-prefetches,
+                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
+                               perf:iTLB-load-misses, perf:branch-loads,
+                               perf:branch-load-misses, perf:cpu-clock,
+                               perf:task-clock, perf:page-fault, perf:faults,
+                               perf:major-faults, perf:minor-faults,
+                               perf:context-switches, perf:cs,
+                               perf:cpu-migrations, perf:migrations,
+                               perf:alignment-faults, perf:emulation-faults
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -s mysession -k  -t prio -t perf:branch-misses -t perf:cache-misses
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel context perf:cache-misses added to all channels
+kernel context perf:branch-misses added to all channels
+kernel context prio added to all channels
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: probe) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -h 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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,
+                               perf:stalled-cycles-frontend,
+                               perf:idle-cycles-frontend,
+                               perf:stalled-cycles-backend,
+                               perf:idle-cycles-backend, perf:instructions,
+                               perf:cache-references, perf:cache-misses,
+                               perf:branch-instructions, perf:branches,
+                               perf:branch-misses, perf:bus-cycles,
+                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
+                               perf:L1-dcache-stores,
+                               perf:L1-dcache-store-misses,
+                               perf:L1-dcache-prefetches,
+                               perf:L1-dcache-prefetch-misses,
+                               perf:L1-icache-loads, perf:L1-icache-load-misses,
+                               perf:L1-icache-stores,
+                               perf:L1-icache-store-misses,
+                               perf:L1-icache-prefetches,
+                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
+                               perf:LLC-load-misses, perf:LLC-stores,
+                               perf:LLC-store-misses, perf:LLC-prefetches,
+                               perf:LLC-prefetch-misses, perf:dTLB-loads,
+                               perf:dTLB-load-misses, perf:dTLB-stores,
+                               perf:dTLB-store-misses, perf:dTLB-prefetches,
+                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
+                               perf:iTLB-load-misses, perf:branch-loads,
+                               perf:branch-load-misses, perf:cpu-clock,
+                               perf:task-clock, perf:page-fault, perf:faults,
+                               perf:major-faults, perf:minor-faults,
+                               perf:context-switches, perf:cs,
+                               perf:cpu-migrations, perf:migrations,
+                               perf:alignment-faults, perf:emulation-faults
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -s mysession -c mychannel -k  -t prio -t perf:branch-misses -t perf:cache-misses
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel context perf:cache-misses added to channel mychannel
+kernel context perf:branch-misses added to channel mychannel
+kernel context prio added to channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: probe) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -h 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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,
+                               perf:stalled-cycles-frontend,
+                               perf:idle-cycles-frontend,
+                               perf:stalled-cycles-backend,
+                               perf:idle-cycles-backend, perf:instructions,
+                               perf:cache-references, perf:cache-misses,
+                               perf:branch-instructions, perf:branches,
+                               perf:branch-misses, perf:bus-cycles,
+                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
+                               perf:L1-dcache-stores,
+                               perf:L1-dcache-store-misses,
+                               perf:L1-dcache-prefetches,
+                               perf:L1-dcache-prefetch-misses,
+                               perf:L1-icache-loads, perf:L1-icache-load-misses,
+                               perf:L1-icache-stores,
+                               perf:L1-icache-store-misses,
+                               perf:L1-icache-prefetches,
+                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
+                               perf:LLC-load-misses, perf:LLC-stores,
+                               perf:LLC-store-misses, perf:LLC-prefetches,
+                               perf:LLC-prefetch-misses, perf:dTLB-loads,
+                               perf:dTLB-load-misses, perf:dTLB-stores,
+                               perf:dTLB-store-misses, perf:dTLB-prefetches,
+                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
+                               perf:iTLB-load-misses, perf:branch-loads,
+                               perf:branch-load-misses, perf:cpu-clock,
+                               perf:task-clock, perf:page-fault, perf:faults,
+                               perf:major-faults, perf:minor-faults,
+                               perf:context-switches, perf:cs,
+                               perf:cpu-migrations, perf:migrations,
+                               perf:alignment-faults, perf:emulation-faults
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -s mysession -c channel0 -e sched_kthread_stop_ret -k  -t prio -t perf:branch-misses -t perf:cache-misses
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel context perf:cache-misses added to event sched_kthread_stop_ret channel mychannel
+kernel context perf:branch-misses added to event sched_kthread_stop_ret channel mychannel
+kernel context prio added to channel event sched_kthread_stop_ret mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: probe) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng calibrate  -k  --function 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel calibration done
+</COMMAND_OUTPUT>
+
 </SCENARIO>
 
 <SCENARIO>
index 7a540a5fe6b6cd96afa26dfe9ae201475d457934..c75069edf183bb3507b9002315c7da09cc59d35f 100644 (file)
@@ -538,4 +538,135 @@ UST event myevent5 created in channel mychannel
 
 </SCENARIO>
 
+####################################################################
+# Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs 
+####################################################################
+
+<SCENARIO>
+ContextHandling
+
+<COMMAND_INPUT>
+lttng add-context  -h 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+<SCENARIO>
+ContextErrorHandling
+
+<COMMAND_INPUT>
+lttng add-context  -h 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context  -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+<SCENARIO>
+CalibrateHandling
+<COMMAND_INPUT>
+lttng calibrate  -k  --function 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel calibration done
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng calibrate  -u  --function 
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel calibration done
+</COMMAND_OUTPUT>
+
+</SCENARIO>
index ceb7081bf5f7d96d008784449bee53868483481e..1b4ff42fa44dc22e1c2279ca0c4e4a6b8f6d7003 100644 (file)
@@ -30,8 +30,4 @@ public interface ITraceInfo {
      */
     public void setName(String name);
     
-    /** 
-     * @return a formated (readable) String with content.
-     */
-    public String formatString();
 }
index dd3db48249715e3b83b406281900079fa481199f..dce60ad2b82c3610e1f07f83da64701696201ace 100644 (file)
@@ -155,30 +155,6 @@ public class BaseEventInfo extends TraceInfo implements IBaseEventInfo {
         }
     }
     
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @SuppressWarnings("nls")
-    @Override
-    public String formatString() {
-        StringBuffer output = new StringBuffer();
-        //    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)");
-        output.append("\n      ");
-        output.append(getName());
-        if (fLogLevel != TraceLogLevel.LEVEL_UNKNOWN) {
-            output.append(" (loglevel: ");
-            output.append(fLogLevel.getInName());
-            output.append(" (");
-            output.append(fLogLevel.ordinal());
-            output.append("))");
-        }
-        output.append(" (type: ");
-        output.append(fEventType.getInName());
-        output.append(')');
-        return output.toString();
-    }
-    
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode()
index 6d538073f29c321d38d6aecb6356d75da1d1ebeb..f4d30f7fe19f9e526640e38f4fd3f0eeb08b556e 100644 (file)
@@ -273,56 +273,6 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
         fEvents.add(channel);
     }
     
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @SuppressWarnings("nls")
-    @Override
-    public String formatString() {
-        StringBuffer output = new StringBuffer();
-        //- channel0: [enabled]
-        output.append("\n- ");
-        output.append(getName());
-        output.append(": [");
-        output.append(getState().getInName());
-        output.append("]\n");
-        //     Attributes:
-        output.append("\n    Attributes:\n");
-        //     overwrite mode: 0
-        output.append("      overwrite mode: ");
-        output.append(isOverwriteMode() ? "1" : "0");
-        //         subbufers size: 262144
-        output.append("\n      subbufers size: ");
-        output.append(getSubBufferSize());
-        //         number of subbufers: 4
-        output.append("\n      number of subbufers: ");
-        output.append(getNumberOfSubBuffers());
-        //        switch timer interval: 0
-        output.append("\n      switch timer interval: ");
-        output.append(getSwitchTimer());
-        //         read timer interval: 200
-        output.append("\n      read timer interval: ");
-        output.append(getReadTimer());
-        //         output: splice()
-        output.append("\n      output: ");
-        output.append(getOutputType());
-        output.append("\n\n");
-
-        output.append("    Events:");
-        if (fEvents.isEmpty()) {
-            output.append("\n      None");
-        } else {
-            for (Iterator<IEventInfo> iterator = fEvents.iterator(); iterator.hasNext();) {
-                IEventInfo event = (IEventInfo) iterator.next();
-                output.append(event.formatString());
-            }
-        }
-        output.append('\n');
-
-        return output.toString();
-    }
-    
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode()
index 33692d9e371c7f5b1f574559c756646389d7e0b4..5e2abfc0f06d78cde004de6ab467cd5e8f0a00c9 100644 (file)
@@ -114,35 +114,6 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
         fChannels.add(channel);
     }
     
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @SuppressWarnings("nls")
-    @Override
-    public String formatString() {
-        StringBuffer output = new StringBuffer();
-        //=== Domain: Kernel ===
-        output.append("\n=== Domain: ");
-        output.append(getName());
-        output.append(" ===\n");
-        output.append("\n");
-        // Channels:
-        output.append("Channels:\n");
-        // -------------
-        output.append("-------------");
-        if (fChannels.isEmpty()) {
-            output.append("\nNone");
-        } else {
-            for (Iterator<IChannelInfo> iterator = fChannels.iterator(); iterator.hasNext();) {
-                IChannelInfo channel = (IChannelInfo) iterator.next();
-                output.append(channel.formatString());
-            }
-        }
-        output.append('\n');
-        return output.toString();
-    }
-    
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode()
index bf88b84098ee192041cbcd1214169a7be06be3c7..1fd2c89bf1f7ec00b474088335324807182067aa 100644 (file)
@@ -72,22 +72,6 @@ public class EventInfo extends BaseEventInfo implements IEventInfo {
         fState = state;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @SuppressWarnings("nls")
-    @Override
-    public String formatString() {
-        StringBuffer output = new StringBuffer();
-        //    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint) [enabled]");
-        output.append(super.formatString());
-        output.append(" [");
-        output.append(fState.getInName());
-        output.append(']');
-        return output.toString();
-    }
-
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IEventInfo#setState(java.lang.String)
index 551a5d726897befeae1ef96198c6d90814e8d6d9..7827de27eda467bd871222f8e957c87b2e9bc5a3 100644 (file)
@@ -123,30 +123,7 @@ public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
     // ------------------------------------------------------------------------
     // Operation
     // ------------------------------------------------------------------------
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-   @SuppressWarnings("nls")
-   @Override
-   public String formatString() {
-       StringBuffer output = new StringBuffer();
-       //    name (type: probe) [enabled]");
-       //       address: 
-       output.append(super.formatString());
-       if (fAddress != null) {
-           output.append("\n        addr: ");
-           output.append(fAddress);
-       } else {
-           output.append("\n        offset: ");
-           output.append(fOffset);
-           output.append('\n');
-           output.append("        symbol: ");
-           output.append(fSymbol);
-       }
-       return output.toString();
-   }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventInfo#hashCode()
@@ -225,5 +202,4 @@ public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
             return output.toString();
     }
 
-
 }
index 1817c1e2676a4ac4a2db7deda684ef978074bf52..f98dca386b6249724b1c4dc348829e83f9ee81c0 100644 (file)
@@ -158,33 +158,6 @@ public class SessionInfo extends TraceInfo implements ISessionInfo {
     public void addDomain(IDomainInfo domainInfo) {
         fDomains.add(domainInfo);
     }
-
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @Override
-    @SuppressWarnings("nls")
-    public String formatString() {
-        StringBuffer output = new StringBuffer();
-        // Tracing session mysession: [active]
-        output.append("Tracing session ");
-        output.append(getName());
-        output.append(": [");
-        output.append(getSessionState().getInName());
-        output.append("]\n");
-        
-        //    Trace path: /home/user/lttng-traces/mysession-20120129-084256
-        output.append("    Trace path: ");
-        output.append(getSessionPath());
-        output.append('\n');
-        
-        for (Iterator<IDomainInfo> iterator = fDomains.iterator(); iterator.hasNext();) {
-            IDomainInfo domain = (IDomainInfo) iterator.next();
-            output.append(domain.formatString());
-        }
-        return output.toString();
-    }
     
     /*
      * (non-Javadoc)
index e26824b95fdb9e232eafb1241153808451f92ed7..955168937c50933c9d72f1d60f9da2989d43bd7e 100644 (file)
@@ -77,15 +77,6 @@ public class TraceInfo implements ITraceInfo {
         fName = name;
     }
     
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @Override
-    public String formatString() {
-        return toString();
-    }
-    
     /*
      * (non-Javadoc)
      * @see java.lang.Object#hashCode()
index b730e1ef811d5d18e17ec14b5fcaecdec9bb6ba8..41e0bcf6f69f33d7e34e1db4b3301a7bef62472d 100644 (file)
@@ -122,30 +122,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
-     */
-    @SuppressWarnings("nls")
-    @Override
-    public String formatString() {
-        StringBuffer output = new StringBuffer();
-        //PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-        output.append("\nPID: ");
-        output.append(fPid);
-        output.append(" - Name: ");
-        output.append(getName());
-        for (Iterator<IBaseEventInfo> iterator = fEvents.iterator(); iterator.hasNext();) {
-            IBaseEventInfo event = (IBaseEventInfo) iterator.next();
-            output.append(event.formatString());
-        }
-        output.append("\n");
 
-        return output.toString();
-    }
-
-    
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode()
This page took 0.042101 seconds and 5 git commands to generate.