lttng: update enable channel for UST buffer type
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui.tests / src / org / eclipse / linuxtools / lttng2 / ui / tests / control / service / LTTngControlServiceTest.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2013 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 * Alexandre Montplaisir - Port to JUnit4
12 **********************************************************************/
13
14 package org.eclipse.linuxtools.lttng2.ui.tests.control.service;
15
16 import static org.junit.Assert.assertEquals;
17 import static org.junit.Assert.assertNotNull;
18 import static org.junit.Assert.assertTrue;
19 import static org.junit.Assert.fail;
20
21 import java.io.File;
22 import java.net.URL;
23 import java.util.ArrayList;
24 import java.util.HashSet;
25 import java.util.List;
26 import java.util.Set;
27
28 import org.eclipse.core.commands.ExecutionException;
29 import org.eclipse.core.runtime.FileLocator;
30 import org.eclipse.core.runtime.NullProgressMonitor;
31 import org.eclipse.core.runtime.Path;
32 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
33 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
34 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
35 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
36 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
37 import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
38 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
39 import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
40 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
41 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
42 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
43 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
44 import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
45 import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
46 import org.eclipse.linuxtools.internal.lttng2.stubs.service.CommandShellFactory;
47 import org.eclipse.linuxtools.internal.lttng2.stubs.shells.LTTngToolsFileShell;
48 import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
49 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging.ControlCommandLogger;
50 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
51 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
52 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlService;
53 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlServiceFactory;
54 import org.junit.After;
55 import org.junit.Before;
56 import org.junit.Test;
57 import org.osgi.framework.FrameworkUtil;
58
59 /**
60 * The class <code>LTTngControlServiceTest</code> contains test for the class
61 * <code>{@link LTTngControlService}</code>.
62 */
63 @SuppressWarnings("javadoc")
64 public class LTTngControlServiceTest {
65
66 private static final String DIRECTORY = "testfiles";
67 private static final String TEST_STREAM = "LTTngServiceTest.cfg";
68
69 private static final String SCEN_LTTNG_NOT_INSTALLED = "LttngNotInstalled";
70 private static final String SCEN_LTTNG_VERSION = "LttngVersion";
71 private static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt";
72 private static final String SCEN_LTTNG_UNSUPPORTED_VERSION = "LttngUnsupportedVersion";
73 private static final String SCEN_LTTNG_NO_VERSION = "LttngNoVersion";
74 private static final String SCEN_NO_SESSION_AVAILABLE = "NoSessionAvailable";
75 private static final String SCEN_GET_SESSION_NAMES1 = "GetSessionNames1";
76 private static final String SCEN_GET_SESSION_NAME_NOT_EXIST = "GetSessionNameNotExist";
77 private static final String SCEN_GET_SESSION_NAME_NOT_EXIST_VERBOSE = "GetSessionNameNotExistVerbose";
78 private static final String SCEN_GET_SESSION_GARBAGE_OUT = "GetSessionGarbageOut";
79 private static final String SCEN_GET_SESSION1 = "GetSession1";
80 private static final String SCEN_GET_KERNEL_PROVIDER1 = "GetKernelProvider1";
81 private static final String SCEN_LIST_WITH_NO_KERNEL1 = "ListWithNoKernel1";
82 private static final String SCEN_LIST_WITH_NO_KERNEL2 = "ListWithNoKernel2";
83 private static final String SCEN_LIST_WITH_NO_KERNEL_VERBOSE = "ListWithNoKernelVerbose";
84 private static final String SCEN_GET_UST_PROVIDER1 = "GetUstProvider1";
85 private static final String SCEN_GET_UST_PROVIDER2 = "GetUstProvider2";
86 private static final String SCEN_GET_UST_PROVIDER3 = "GetUstProvider3";
87 private static final String SCEN_LIST_WITH_NO_UST1 = "ListWithNoUst1";
88 private static final String SCEN_LIST_WITH_NO_UST2 = "ListWithNoUst2";
89 private static final String SCEN_LIST_WITH_NO_UST3 = "ListWithNoUst3";
90 private static final String SCEN_LIST_WITH_NO_UST_VERBOSE = "ListWithNoUstVerbose";
91 private static final String SCEN_CREATE_SESSION1 = "CreateSession1";
92 private static final String SCEN_CREATE_SESSION_WITH_PROMPT = "CreateSessionWithPrompt";
93 private static final String SCEN_CREATE_SESSION_VARIANTS = "CreateSessionVariants";
94 private static final String SCEN_DESTROY_SESSION1 = "DestroySession1";
95 private static final String SCEN_DESTROY_SESSION_VERBOSE = "DestroySessionVerbose";
96 private static final String SCEN_CHANNEL_HANDLING = "ChannelHandling";
97 private static final String SCEN_EVENT_HANDLING = "EventHandling";
98 private static final String SCEN_CONTEXT_HANDLING = "ContextHandling";
99 private static final String SCEN_CONTEXT_ERROR_HANDLING = "ContextErrorHandling";
100 private static final String SCEN_CALIBRATE_HANDLING = "CalibrateHandling";
101 private static final String SCEN_CREATE_SESSION_2_1 = "CreateSessionLttng2.1";
102 private static final String SCEN_CREATE_SESSION_VERBOSE_2_1 = "CreateSessionLttngVerbose2.1";
103
104 // ------------------------------------------------------------------------
105 // Test data
106 // ------------------------------------------------------------------------
107
108 private CommandShellFactory fShellFactory;
109 private String fTestfile;
110 private LTTngToolsFileShell fShell;
111 private ILttngControlService fService;
112
113 // ------------------------------------------------------------------------
114 // Housekeeping
115 // ------------------------------------------------------------------------
116
117 /**
118 * Perform pre-test initialization.
119 *
120 * @throws Exception
121 * if the initialization fails for some reason
122 */
123 @Before
124 public void setUp() throws Exception {
125 fShellFactory = CommandShellFactory.getInstance();
126
127 URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
128 File testfile = new File(FileLocator.toFileURL(location).toURI());
129 fTestfile = testfile.getAbsolutePath();
130
131 fShell = fShellFactory.getFileShell();
132 fShell.loadScenarioFile(fTestfile);
133 fService = new LTTngControlService(fShell);
134
135 ControlPreferences.getInstance().init(Activator.getDefault().getPreferenceStore());
136 }
137
138 @After
139 public void tearDown() {
140 disableVerbose();
141 ControlPreferences.getInstance().dispose();
142 }
143
144 // ------------------------------------------------------------------------
145 // Test Cases
146 // ------------------------------------------------------------------------
147
148 @Test
149 public void testVersion() {
150 try {
151 fShell.setScenario(SCEN_LTTNG_VERSION);
152 ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
153 assertNotNull(service);
154 assertEquals("2.1.0", service.getVersion());
155 } catch (ExecutionException e) {
156 fail("Exeption thrown " + e);
157 }
158 }
159
160 @Test
161 public void testVersionWithPrompt() {
162 try {
163 fShell.setScenario(SCEN_LTTNG_VERSION_WITH_PROMPT);
164 ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
165 assertNotNull(service);
166 assertEquals("2.0.0", service.getVersion());
167 } catch (ExecutionException e) {
168 fail("Exeption thrown " + e);
169 }
170 }
171
172 @Test
173 public void testUnsupportedVersion() {
174 try {
175 fShell.setScenario(SCEN_LTTNG_UNSUPPORTED_VERSION);
176 LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
177 fail("No exeption thrown");
178 } catch (ExecutionException e) {
179 // success
180 }
181 }
182
183 @Test
184 public void testNoVersion() {
185 try {
186 fShell.setScenario(SCEN_LTTNG_NO_VERSION);
187 LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
188 fail("No exeption thrown");
189 } catch (ExecutionException e) {
190 // success
191 }
192 }
193
194 @Test
195 public void testLttngNotInstalled() {
196 try {
197 fShell.setScenario(SCEN_LTTNG_NOT_INSTALLED);
198 fService.getSessionNames(new NullProgressMonitor());
199 fail("No exeption thrown");
200 } catch (ExecutionException e) {
201 // success
202 }
203 }
204
205 @Test
206 public void testGetSessionNames1() {
207 try {
208 fShell.setScenario(SCEN_NO_SESSION_AVAILABLE);
209 String[] result = fService.getSessionNames(new NullProgressMonitor());
210
211 assertNotNull(result);
212 assertEquals(0, result.length);
213
214 } catch (ExecutionException e) {
215 fail(e.toString());
216 }
217 }
218
219 @Test
220 public void testGetSessionNames2() {
221 try {
222 fShell.setScenario(SCEN_GET_SESSION_NAMES1);
223 String[] result = fService.getSessionNames(new NullProgressMonitor());
224
225 assertNotNull(result);
226 assertEquals(2, result.length);
227 assertEquals("mysession1", result[0]);
228 assertEquals("mysession", result[1]);
229
230 } catch (ExecutionException e) {
231 fail(e.toString());
232 }
233 }
234
235 @Test
236 public void testGetSessionNotExist() {
237 try {
238 fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST);
239 fService.getSessionNames(new NullProgressMonitor());
240 fail("No exeption thrown");
241
242 } catch (ExecutionException e) {
243 // success
244 }
245 }
246
247 @Test
248 public void testGetSessionNotExistVerbose() {
249 try {
250 enableVerbose();
251 fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST_VERBOSE);
252 fService.getSessionNames(new NullProgressMonitor());
253 fail("No exeption thrown");
254
255 } catch (ExecutionException e) {
256 // success
257 } finally {
258 disableVerbose();
259 }
260 }
261
262 @Test
263 public void testGetSessionNameGarbage() {
264 try {
265 fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT);
266 String[] result = fService.getSessionNames(new NullProgressMonitor());
267
268 assertNotNull(result);
269 assertEquals(0, result.length);
270
271 } catch (ExecutionException e) {
272 fail(e.toString());
273 }
274 }
275
276 @Test
277 public void testGetSession1() {
278 try {
279 fShell.setScenario(SCEN_GET_SESSION1);
280 ISessionInfo session = fService.getSession("mysession", new NullProgressMonitor());
281
282 // Verify Session
283 assertNotNull(session);
284 assertEquals("mysession", session.getName());
285 assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath());
286 assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
287
288 IDomainInfo[] domains = session.getDomains();
289 assertNotNull(domains);
290 assertEquals(2, domains.length);
291
292 // Verify Kernel domain
293 assertEquals("Kernel", domains[0].getName());
294 IChannelInfo[] channels = domains[0].getChannels();
295 assertNotNull(channels);
296 assertEquals(2, channels.length);
297
298 // Verify Kernel's channel0
299 assertEquals("channel0", channels[0].getName());
300 assertEquals(4, channels[0].getNumberOfSubBuffers());
301 assertEquals("splice()", channels[0].getOutputType());
302 assertEquals(false, channels[0].isOverwriteMode());
303 assertEquals(200, channels[0].getReadTimer());
304 assertEquals(TraceEnablement.ENABLED, channels[0].getState());
305 assertEquals(262144, channels[0].getSubBufferSize());
306 assertEquals(0, channels[0].getSwitchTimer());
307
308 // Verify event info
309 IEventInfo[] channel0Events = channels[0].getEvents();
310 assertNotNull(channel0Events);
311 assertEquals(2, channel0Events.length);
312 assertEquals("block_rq_remap", channel0Events[0].getName());
313 assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[0].getLogLevel());
314 assertEquals(TraceEventType.TRACEPOINT, channel0Events[0].getEventType());
315 assertEquals(TraceEnablement.ENABLED, channel0Events[0].getState());
316
317 assertEquals("block_bio_remap", channel0Events[1].getName());
318 assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[1].getLogLevel());
319 assertEquals(TraceEventType.TRACEPOINT, channel0Events[1].getEventType());
320 assertEquals(TraceEnablement.DISABLED, channel0Events[1].getState());
321
322 // Verify Kernel's channel1
323 assertEquals("channel1", channels[1].getName());
324 assertEquals(4, channels[1].getNumberOfSubBuffers());
325 assertEquals("splice()", channels[1].getOutputType());
326 assertEquals(true, channels[1].isOverwriteMode());
327 assertEquals(400, channels[1].getReadTimer());
328 assertEquals(TraceEnablement.DISABLED, channels[1].getState());
329 assertEquals(524288, channels[1].getSubBufferSize());
330 assertEquals(100, channels[1].getSwitchTimer());
331
332 // Verify event info
333 IEventInfo[] channel1Events = channels[1].getEvents();
334 assertEquals(0, channel1Events.length);
335
336 // Verify domain UST global
337 assertEquals("UST global", domains[1].getName());
338
339 IChannelInfo[] ustChannels = domains[1].getChannels();
340
341 // Verify UST global's mychannel1
342 assertEquals("mychannel1", ustChannels[0].getName());
343 assertEquals(8, ustChannels[0].getNumberOfSubBuffers());
344 assertEquals("mmap()", ustChannels[0].getOutputType());
345 assertEquals(true, ustChannels[0].isOverwriteMode());
346 assertEquals(100, ustChannels[0].getReadTimer());
347 assertEquals(TraceEnablement.DISABLED, ustChannels[0].getState());
348 assertEquals(8192, ustChannels[0].getSubBufferSize());
349 assertEquals(200, ustChannels[0].getSwitchTimer());
350
351 // Verify event info
352 IEventInfo[] ustEvents = ustChannels[0].getEvents();
353 assertEquals(0, ustEvents.length);
354
355 // Verify UST global's channel0
356 assertEquals("channel0", ustChannels[1].getName());
357 assertEquals(4, ustChannels[1].getNumberOfSubBuffers());
358 assertEquals("mmap()", ustChannels[1].getOutputType());
359 assertEquals(false, ustChannels[1].isOverwriteMode());
360 assertEquals(200, ustChannels[1].getReadTimer());
361 assertEquals(TraceEnablement.ENABLED, ustChannels[1].getState());
362 assertEquals(4096, ustChannels[1].getSubBufferSize());
363 assertEquals(0, ustChannels[1].getSwitchTimer());
364
365 // Verify event info
366 ustEvents = ustChannels[1].getEvents();
367 assertEquals(2, ustEvents.length);
368
369 assertEquals("ust_tests_hello:tptest_sighandler", ustEvents[0].getName());
370 assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, ustEvents[0].getLogLevel());
371 assertEquals(TraceEventType.TRACEPOINT, ustEvents[0].getEventType());
372 assertEquals(TraceEnablement.DISABLED, ustEvents[0].getState());
373
374 assertEquals("*", ustEvents[1].getName());
375 assertEquals(TraceLogLevel.LEVEL_UNKNOWN, ustEvents[1].getLogLevel());
376 assertEquals(TraceEventType.TRACEPOINT, ustEvents[1].getEventType());
377 assertEquals(TraceEnablement.ENABLED, ustEvents[1].getState());
378
379 // next session (no detailed information available)
380 session = fService.getSession("mysession1", new NullProgressMonitor());
381 assertNotNull(session);
382 assertEquals("mysession1", session.getName());
383 assertEquals("/home/user/lttng-traces/mysession1-20120203-133225", session.getSessionPath());
384 assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
385
386 domains = session.getDomains();
387 assertNotNull(domains);
388 assertEquals(0, domains.length);
389 } catch (ExecutionException e) {
390 fail(e.toString());
391 }
392 }
393
394 public void testGetKernelProvider() {
395 try {
396 fShell.setScenario(SCEN_GET_KERNEL_PROVIDER1);
397 List<IBaseEventInfo> events = fService.getKernelProvider(new NullProgressMonitor());
398
399 // Verify event info
400 assertNotNull(events);
401 assertEquals(3, events.size());
402
403 IBaseEventInfo baseEventInfo = events.get(0);
404 assertNotNull(baseEventInfo);
405 assertEquals("sched_kthread_stop", baseEventInfo.getName());
406 assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel());
407 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
408
409 baseEventInfo = events.get(1);
410 assertEquals("sched_kthread_stop_ret", baseEventInfo.getName());
411 assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel());
412 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
413
414 baseEventInfo = events.get(2);
415 assertEquals("sched_wakeup_new", baseEventInfo.getName());
416 assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel());
417 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
418
419 } catch (ExecutionException e) {
420 fail(e.toString());
421 }
422 }
423
424 @Test
425 public void testGetKernelProviderNoKernel1() {
426 try {
427 fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL1);
428 List<IBaseEventInfo> events = fService.getKernelProvider(new NullProgressMonitor());
429
430 // Verify event info
431 assertNotNull(events);
432 assertEquals(0, events.size());
433
434 } catch (ExecutionException e) {
435 fail(e.toString());
436 }
437 }
438
439 @Test
440 public void testGetKernelProviderNoKernel2() {
441 try {
442 fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL2);
443 List<IBaseEventInfo> events = fService.getKernelProvider(new NullProgressMonitor());
444
445 // Verify event info
446 assertNotNull(events);
447 assertEquals(0, events.size());
448
449 } catch (ExecutionException e) {
450 fail(e.toString());
451 }
452 }
453
454 @Test
455 public void testGetKernelProviderNoKernelVerbose() {
456 try {
457 enableVerbose();
458 fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL_VERBOSE);
459 List<IBaseEventInfo> events = fService.getKernelProvider(new NullProgressMonitor());
460
461 // Verify event info
462 assertNotNull(events);
463 assertEquals(0, events.size());
464
465 } catch (ExecutionException e) {
466 fail(e.toString());
467 } finally {
468 disableVerbose();
469 }
470 }
471
472 @Test
473 public void testGetUstProvider() {
474 try {
475 fShell.setScenario(SCEN_GET_UST_PROVIDER1);
476 List<IUstProviderInfo> providers = fService.getUstProvider();
477
478 // Check all providers
479 assertNotNull(providers);
480 assertEquals(2, providers.size());
481
482 //Verify first provider
483 assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName());
484 assertEquals(9379, providers.get(0).getPid());
485
486 // Verify event info
487 IBaseEventInfo[] events = providers.get(0).getEvents();
488 assertNotNull(events);
489 assertEquals(2, events.length);
490
491 IBaseEventInfo baseEventInfo = events[0];
492 assertNotNull(baseEventInfo);
493 assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName());
494 assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE, baseEventInfo.getLogLevel());
495 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
496
497 baseEventInfo = events[1];
498 assertEquals("ust_tests_hello:tptest", baseEventInfo.getName());
499 assertEquals(TraceLogLevel.TRACE_INFO, baseEventInfo.getLogLevel());
500 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
501
502 //Verify second provider
503 assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName());
504 assertEquals(4852, providers.get(1).getPid());
505
506 // Verify event info
507 events = providers.get(1).getEvents();
508 assertNotNull(events);
509 assertEquals(2, events.length);
510
511 baseEventInfo = events[0];
512 assertNotNull(baseEventInfo);
513 assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName());
514 assertEquals(TraceLogLevel.TRACE_WARNING, baseEventInfo.getLogLevel());
515 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
516
517 baseEventInfo = events[1];
518 assertEquals("ust_tests_hello:tptest", baseEventInfo.getName());
519 assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel());
520 assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
521
522 } catch (ExecutionException e) {
523 fail(e.toString());
524 }
525 }
526
527 @Test
528 public void testUstProvider2() {
529 try {
530 fShell.setScenario(SCEN_GET_UST_PROVIDER2);
531 List<IUstProviderInfo> providers = fService.getUstProvider();
532
533 assertNotNull(providers);
534 assertEquals(0, providers.size());
535
536 } catch (ExecutionException e) {
537 fail(e.toString());
538 }
539 }
540
541 @Test
542 public void testGetUstProvider3() {
543 try {
544 fShell.setScenario(SCEN_GET_UST_PROVIDER3);
545 // Set version
546 ((LTTngControlService)fService).setVersion("2.1.0");
547 List<IUstProviderInfo> providers = fService.getUstProvider();
548
549 // Check all providers
550 assertNotNull(providers);
551 assertEquals(2, providers.size());
552
553 //Verify first provider
554 assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName());
555 assertEquals(9379, providers.get(0).getPid());
556
557 // Verify event info
558 IBaseEventInfo[] events = providers.get(0).getEvents();
559 assertNotNull(events);
560 assertEquals(2, events.length);
561
562 IBaseEventInfo baseEventInfo = events[0];
563 assertNotNull(baseEventInfo);
564 IFieldInfo[] fields = baseEventInfo.getFields();
565 assertNotNull(fields);
566 assertEquals(0, fields.length);
567
568 baseEventInfo = events[1];
569 fields = baseEventInfo.getFields();
570 assertNotNull(fields);
571 assertEquals(3, fields.length);
572 assertEquals("doublefield", fields[0].getName());
573 assertEquals("float", fields[0].getFieldType());
574
575 assertEquals("floatfield", fields[1].getName());
576 assertEquals("float", fields[1].getFieldType());
577
578 assertEquals("stringfield", fields[2].getName());
579 assertEquals("string", fields[2].getFieldType());
580
581 //Verify second provider
582 assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName());
583 assertEquals(4852, providers.get(1).getPid());
584
585 // Verify event info
586 events = providers.get(1).getEvents();
587 assertNotNull(events);
588 assertEquals(2, events.length);
589
590 baseEventInfo = events[0];
591 assertNotNull(baseEventInfo);
592 fields = baseEventInfo.getFields();
593 assertNotNull(fields);
594 assertEquals(0, fields.length);
595
596 baseEventInfo = events[1];
597 fields = baseEventInfo.getFields();
598 assertNotNull(fields);
599 assertEquals(3, fields.length);
600
601 assertEquals("doublefield", fields[0].getName());
602 assertEquals("float", fields[0].getFieldType());
603
604 assertEquals("floatfield", fields[1].getName());
605 assertEquals("float", fields[1].getFieldType());
606
607 assertEquals("stringfield", fields[2].getName());
608 assertEquals("string", fields[2].getFieldType());
609
610 // Reset version
611 ((LTTngControlService)fService).setVersion("2.0.0");
612
613 } catch (ExecutionException e) {
614 fail(e.toString());
615 }
616 }
617
618
619 @Test
620 public void testGetKernelProviderNoUst1() {
621 try {
622 fShell.setScenario(SCEN_LIST_WITH_NO_UST1);
623 List<IUstProviderInfo> providerList = fService.getUstProvider(new NullProgressMonitor());
624
625 // Verify Provider info
626 assertNotNull(providerList);
627 assertEquals(0, providerList.size());
628
629 } catch (ExecutionException e) {
630 fail(e.toString());
631 }
632 }
633
634
635 @Test
636 public void testGetKernelProviderNoUst2() {
637 try {
638 // Set version
639 ((LTTngControlService)fService).setVersion("2.1.0");
640
641 fShell.setScenario(SCEN_LIST_WITH_NO_UST2);
642 List<IUstProviderInfo> providerList = fService.getUstProvider(new NullProgressMonitor());
643
644 // Verify Provider info
645 assertNotNull(providerList);
646 assertEquals(0, providerList.size());
647
648 // Reset version
649 ((LTTngControlService)fService).setVersion("2.0.0");
650
651 } catch (ExecutionException e) {
652 fail(e.toString());
653 }
654 }
655
656 @Test
657 public void testGetKernelProviderNoUst3() {
658 try {
659
660 // Set version
661 ((LTTngControlService)fService).setVersion("2.1.0");
662
663 fShell.setScenario(SCEN_LIST_WITH_NO_UST3);
664 List<IUstProviderInfo> providerList = fService.getUstProvider(new NullProgressMonitor());
665
666 // Verify provider info
667 assertNotNull(providerList);
668 assertEquals(0, providerList.size());
669
670 // Reset version
671 ((LTTngControlService)fService).setVersion("2.0.0");
672
673 } catch (ExecutionException e) {
674 fail(e.toString());
675 }
676 }
677
678 @Test
679 public void testGetKernelProviderNoUstVerbose() {
680 try {
681 enableVerbose();
682
683 // Set version
684 ((LTTngControlService)fService).setVersion("2.1.0");
685
686 fShell.setScenario(SCEN_LIST_WITH_NO_UST_VERBOSE);
687 List<IUstProviderInfo> providerList = fService.getUstProvider(new NullProgressMonitor());
688
689 // Verify provider info
690 assertNotNull(providerList);
691 assertEquals(0, providerList.size());
692
693 // Reset version
694 ((LTTngControlService)fService).setVersion("2.0.0");
695
696 } catch (ExecutionException e) {
697 fail(e.toString());
698 } finally {
699 disableVerbose();
700 }
701 }
702
703
704
705 @Test
706 public void testCreateSession() {
707 try {
708 fShell.setScenario(SCEN_CREATE_SESSION1);
709
710 ISessionInfo info = fService.createSession("mysession2", null, new NullProgressMonitor());
711 assertNotNull(info);
712 assertEquals("mysession2", info.getName());
713 assertNotNull(info.getSessionPath());
714 assertTrue(info.getSessionPath().contains("mysession2"));
715 assertEquals(TraceSessionState.INACTIVE, info.getSessionState());
716 } catch (ExecutionException e) {
717 fail(e.toString());
718 }
719 }
720
721 @Test
722 public void testCreateSessionWithPrompt() {
723 try {
724 // First line has the shell prompt before the command output
725 // This can happen in a real application if the command line is not echoed by the shell.
726 fShell.setScenario(SCEN_CREATE_SESSION_WITH_PROMPT);
727
728 // First line has no shell prompt before the output
729 ISessionInfo info = fService.createSession("mysession2", null, new NullProgressMonitor());
730 assertNotNull(info);
731 assertEquals("mysession2", info.getName());
732 assertNotNull(info.getSessionPath());
733 assertTrue(info.getSessionPath().contains("mysession2"));
734 assertEquals(TraceSessionState.INACTIVE, info.getSessionState());
735 } catch (ExecutionException e) {
736 fail(e.toString());
737 }
738 }
739
740 @Test
741 public void testCreateSessionVariants() {
742
743 fShell.setScenario(SCEN_CREATE_SESSION_VARIANTS);
744
745 try {
746 fService.createSession("alreadyExist", null, new NullProgressMonitor());
747 fail("No exeption thrown");
748 } catch (ExecutionException e) {
749 // success
750 }
751
752 try {
753 fService.createSession("wrongName", null, new NullProgressMonitor());
754 fail("No exeption thrown");
755 } catch (ExecutionException e) {
756 // success
757 }
758
759 try {
760 fService.createSession("withPath", "/home/user/hallo", new NullProgressMonitor());
761 fail("No exeption thrown");
762 } catch (ExecutionException e) {
763 // success
764 }
765
766 try {
767 ISessionInfo info = fService.createSession("session with spaces", null, new NullProgressMonitor());
768 assertNotNull(info);
769 assertEquals("session with spaces", info.getName());
770 assertNotNull(info.getSessionPath());
771 assertTrue(info.getSessionPath().contains("session with spaces"));
772 assertEquals(TraceSessionState.INACTIVE, info.getSessionState());
773
774 } catch (ExecutionException e) {
775 fail(e.toString());
776 }
777
778 try {
779 ISessionInfo info = fService.createSession("pathWithSpaces", "/home/user/hallo user/here", new NullProgressMonitor());
780 assertNotNull(info);
781 assertEquals("pathWithSpaces", info.getName());
782 assertNotNull(info.getSessionPath());
783 assertTrue(info.getSessionPath().contains("/home/user/hallo user/here"));
784 assertEquals(TraceSessionState.INACTIVE, info.getSessionState());
785
786 } catch (ExecutionException e) {
787 fail(e.toString());
788 }
789 }
790
791 @Test
792 public void testDestroySession() {
793 try {
794 fShell.setScenario(SCEN_DESTROY_SESSION1);
795 fService.destroySession("mysession2", new NullProgressMonitor());
796 } catch (ExecutionException e) {
797 fail(e.toString());
798 }
799 }
800
801 @Test
802 public void testDestroySessionVerbose() {
803 try {
804 enableVerbose();
805 fShell.setScenario(SCEN_DESTROY_SESSION_VERBOSE);
806 fService.destroySession("mysession2", new NullProgressMonitor());
807 } catch (ExecutionException e) {
808 fail(e.toString());
809 } finally {
810 disableVerbose();
811 }
812 }
813
814 @Test
815 public void testCreateChannel() {
816 try {
817 ((LTTngControlService)fService).setVersion("2.2.0");
818 String sessionName = "mysession2";
819 List<String> list = new ArrayList<String>();
820 String kernelChannel0 = "mychannel0";
821 String kernelChannel1 = "mychannel1";
822 list.add(kernelChannel0);
823 list.add(kernelChannel1);
824
825 fShell.setScenario(SCEN_CHANNEL_HANDLING);
826
827 // Create/enable/configure 2 kernel channels
828 ChannelInfo chanInfo = new ChannelInfo("");
829 chanInfo.setOverwriteMode(true);
830 chanInfo.setSubBufferSize(16384);
831 chanInfo.setReadTimer(100);
832 chanInfo.setSwitchTimer(200);
833 chanInfo.setNumberOfSubBuffers(2);
834 chanInfo.setMaxNumberTraceFiles(10);
835 chanInfo.setMaxSizeTraceFiles(0);
836 fService.enableChannels(sessionName, list, true, chanInfo, new NullProgressMonitor());
837
838 // Create/enable/configure 1 UST channel
839 list.clear();
840 list.add("ustChannel");
841
842 chanInfo = new ChannelInfo("");
843 chanInfo.setOverwriteMode(true);
844 chanInfo.setSubBufferSize(32768);
845 chanInfo.setReadTimer(200);
846 chanInfo.setSwitchTimer(100);
847 chanInfo.setNumberOfSubBuffers(1);
848 chanInfo.setMaxNumberTraceFiles(20);
849 chanInfo.setMaxSizeTraceFiles(0);
850 fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
851 ((LTTngControlService)fService).setVersion("2.0.0");
852
853 } catch (ExecutionException e) {
854 fail(e.toString());
855 }
856 }
857
858 @Test
859 public void testCreateChannelUIDBuffer() {
860 try {
861 ((LTTngControlService)fService).setVersion("2.2.0");
862 String sessionName = "mysession2";
863 List<String> list = new ArrayList<String>();
864 String USTChannel = "ustChannel";
865 list.add(USTChannel);
866 fShell.setScenario(SCEN_CHANNEL_HANDLING);
867
868 ChannelInfo chanInfo = new ChannelInfo("");
869 chanInfo.setOverwriteMode(true);
870 chanInfo.setSubBufferSize(32768);
871 chanInfo.setReadTimer(200);
872 chanInfo.setSwitchTimer(100);
873 chanInfo.setNumberOfSubBuffers(1);
874 chanInfo.setMaxNumberTraceFiles(20);
875 chanInfo.setMaxSizeTraceFiles(0);
876 chanInfo.setBufferType(BufferType.BUFFER_PER_UID);
877 fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
878 ((LTTngControlService)fService).setVersion("2.0.0");
879
880 } catch (ExecutionException e) {
881 fail(e.toString());
882 }
883 }
884
885 @Test
886 public void testCreateChannelPIDBuffer() {
887 try {
888 ((LTTngControlService)fService).setVersion("2.2.0");
889 String sessionName = "mysession2";
890 List<String> list = new ArrayList<String>();
891 String USTChannel = "ustChannel";
892 list.add(USTChannel);
893 fShell.setScenario(SCEN_CHANNEL_HANDLING);
894
895
896 ChannelInfo chanInfo = new ChannelInfo("");
897 chanInfo.setOverwriteMode(true);
898 chanInfo.setSubBufferSize(-1);
899 chanInfo.setReadTimer(-1);
900 chanInfo.setSwitchTimer(-1);
901 chanInfo.setNumberOfSubBuffers(-1);
902 chanInfo.setMaxNumberTraceFiles(-1);
903 chanInfo.setMaxSizeTraceFiles(-1);
904 chanInfo.setBufferType(BufferType.BUFFER_PER_PID);
905
906 fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
907 ((LTTngControlService)fService).setVersion("2.0.0");
908
909 } catch (ExecutionException e) {
910 fail(e.toString());
911 }
912 }
913
914 @Test
915 public void testDisableChannel() {
916 try {
917
918 String sessionName = "mysession2";
919 List<String> list = new ArrayList<String>();
920 String kernelChannel0 = "mychannel0";
921 String kernelChannel1 = "mychannel1";
922 list.add(kernelChannel0);
923 list.add(kernelChannel1);
924
925 fShell.setScenario(SCEN_CHANNEL_HANDLING);
926 fService.disableChannels(sessionName, list, true, new NullProgressMonitor());
927
928 list.clear();
929 list.add("ustChannel");
930 fService.disableChannels(sessionName, list, false, new NullProgressMonitor());
931
932 } catch (ExecutionException e) {
933 fail(e.toString());
934 }
935 }
936
937 @Test
938 public void testEnableChannel() {
939 try {
940
941 String sessionName = "mysession2";
942 List<String> list = new ArrayList<String>();
943 String kernelChannel0 = "mychannel0";
944 String kernelChannel1 = "mychannel1";
945 list.add(kernelChannel0);
946 list.add(kernelChannel1);
947
948 fShell.setScenario(SCEN_CHANNEL_HANDLING);
949 fService.enableChannels(sessionName, list, true, null, new NullProgressMonitor());
950
951 // Create/enable/configure 1 UST channel
952 list.clear();
953 list.add("ustChannel");
954
955 fService.enableChannels(sessionName, list, false, null, new NullProgressMonitor());
956
957 } catch (ExecutionException e) {
958 fail(e.toString());
959 }
960 }
961
962 @Test
963 public void testEnableEvents() {
964 try {
965 // 1) session name, channel = null, 3 event names, kernel
966 String sessionName = "mysession2";
967 List<String> list = new ArrayList<String>();
968 String eventName0 = "block_rq_remap";
969 String eventName1 = "block_bio_remap";
970 String eventName2 = "softirq_entry";
971 list.add(eventName0);
972 list.add(eventName1);
973 list.add(eventName2);
974 fShell.setScenario(SCEN_EVENT_HANDLING);
975 fService.enableEvents(sessionName, null, list, true, null, new NullProgressMonitor());
976
977 // 2) session name, channel=mychannel, event name= null, kernel
978 String channelName = "mychannel";
979 fService.enableEvents(sessionName, channelName, null, true, null, new NullProgressMonitor());
980
981 // 3) session name, channel=mychannel, 1 event name, ust, no filter
982 String ustEventName = "ust_tests_hello:tptest_sighandler";
983 list.clear();
984 list.add(ustEventName);
985 fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor());
986
987 // 4) session name, channel = mychannel, no event name, ust, with filter
988 fService.enableEvents(sessionName, channelName, list, false, "intfield==10", new NullProgressMonitor());
989
990 // 5) session name, channel = mychannel, no event name, ust, no filter
991 list.clear();
992 fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor());
993
994 // TODO add test with filters
995
996 } catch (ExecutionException e) {
997 fail(e.toString());
998 }
999 }
1000
1001 @Test
1002 public void testEnableSyscalls() {
1003 try {
1004 // 1) session name, channel = null, 3 event names, kernel
1005 String sessionName = "mysession2";
1006 String channelName = "mychannel";
1007
1008 fShell.setScenario(SCEN_EVENT_HANDLING);
1009
1010 // 1) session name, channel = null
1011 fService.enableSyscalls(sessionName, null, new NullProgressMonitor());
1012
1013 // 2) session name, channel = mychannel
1014 fService.enableSyscalls(sessionName, channelName, new NullProgressMonitor());
1015
1016 } catch (ExecutionException e) {
1017 fail(e.toString());
1018 }
1019 }
1020
1021 @Test
1022 public void testDynamicProbe() {
1023 try {
1024 // 1) session name, channel = null, 3 event names, kernel
1025 String sessionName = "mysession2";
1026 String channelName = "mychannel";
1027 String eventName0 = "myevent0";
1028 String eventName1 = "myevent1";
1029 String functionProbe = "0xc0101340";
1030 String dynProbe = "init_post";
1031
1032 fShell.setScenario(SCEN_EVENT_HANDLING);
1033
1034 // 1) session name, channel = null, event name, function probe, probe
1035 fService.enableProbe(sessionName, null, eventName0, true, functionProbe, new NullProgressMonitor());
1036
1037 // 2) session name, channel = mychannel
1038 fService.enableProbe(sessionName, channelName, eventName1, false, dynProbe, new NullProgressMonitor());
1039
1040 } catch (ExecutionException e) {
1041 fail(e.toString());
1042 }
1043 }
1044
1045 @Test
1046 public void testEnableLogLevel() {
1047 try {
1048 // 1) session name, channel = null, 3 event names, kernel
1049 String sessionName = "mysession2";
1050 String channelName = "mychannel";
1051 String eventName4 = "myevent4";
1052 String eventName5 = "myevent5";
1053
1054 fShell.setScenario(SCEN_EVENT_HANDLING);
1055
1056 // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
1057 fService.enableLogLevel(sessionName, null, eventName4, LogLevelType.LOGLEVEL_ONLY, TraceLogLevel.TRACE_DEBUG, null, new NullProgressMonitor());
1058
1059 // 2) session name, channel = mychannel, null, loglevel, TRACE_DEBUG_FUNCTION
1060 fService.enableLogLevel(sessionName, channelName, eventName5, LogLevelType.LOGLEVEL, TraceLogLevel.TRACE_DEBUG_FUNCTION, null, new NullProgressMonitor());
1061
1062 // TODO add test with filters
1063
1064 } catch (ExecutionException e) {
1065 fail(e.toString());
1066 }
1067 }
1068
1069 @Test
1070 public void testAddContext() {
1071 try {
1072 // 1) session name, channel = null, 3 event names, kernel
1073 String sessionName = "mysession2";
1074 String channelName = "mychannel";
1075 String eventName = "ust_tests_hello:tptest_sighandler";
1076 List<String> contexts = new ArrayList<String>();
1077 contexts.add("prio");
1078 contexts.add("pid");
1079
1080 fShell.setScenario(SCEN_CONTEXT_HANDLING);
1081
1082 List<String> availContexts = fService.getContextList(new NullProgressMonitor());
1083 assertNotNull(availContexts);
1084 assertEquals(12, availContexts.size());
1085
1086 // A very "hard-coded" way to verify but it works ...
1087 Set<String> expectedContexts = new HashSet<String>();
1088 expectedContexts.add("pid");
1089 expectedContexts.add("procname");
1090 expectedContexts.add("prio");
1091 expectedContexts.add("nice");
1092 expectedContexts.add("vpid");
1093 expectedContexts.add("tid");
1094 expectedContexts.add("pthread_id");
1095 expectedContexts.add("vtid");
1096 expectedContexts.add("ppid");
1097 expectedContexts.add("vppid");
1098 expectedContexts.add("perf:cpu-cycles");
1099 expectedContexts.add("perf:cycles");
1100
1101 assertTrue(expectedContexts.containsAll(availContexts));
1102
1103 // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
1104 fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
1105
1106 } catch (ExecutionException e) {
1107 fail(e.toString());
1108 }
1109 }
1110
1111 @Test
1112 public void testAddContextFailure() {
1113
1114 // 1) session name, channel = null, 3 event names, kernel
1115 String sessionName = "mysession2";
1116 String channelName = "mychannel";
1117 String eventName = "ust_tests_hello:tptest_sighandler";
1118 List<String> contexts = new ArrayList<String>();
1119 contexts.add("prio");
1120 contexts.add("pid");
1121 fShell.setScenario(SCEN_CONTEXT_ERROR_HANDLING);
1122 try {
1123 fService.getContextList(new NullProgressMonitor());
1124 fail("No exeption generated");
1125 } catch (ExecutionException e) {
1126 // success
1127 }
1128 try {
1129 // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
1130 fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
1131 fail("No exeption generated");
1132 } catch (ExecutionException e) {
1133 // success
1134 }
1135 }
1136
1137 @Test
1138 public void testCalibrate() {
1139 try {
1140 fShell.setScenario(SCEN_CALIBRATE_HANDLING);
1141 fService.calibrate(true, new NullProgressMonitor());
1142
1143 } catch (ExecutionException e) {
1144 fail(e.toString());
1145 }
1146 }
1147
1148 @Test
1149 public void testCalibrateFailure() {
1150 try {
1151 fShell.setScenario(SCEN_CALIBRATE_HANDLING);
1152 fService.calibrate(false, new NullProgressMonitor());
1153 fail("No exeption generated");
1154 } catch (ExecutionException e) {
1155 // success
1156 }
1157 }
1158
1159 @Test
1160 public void testCreateSession2_1() {
1161
1162 try {
1163 fShell.setScenario(SCEN_CREATE_SESSION_2_1);
1164
1165 ISessionInfo info = fService.createSession("mysession", "net://172.0.0.1", null, null, new NullProgressMonitor());
1166 assertNotNull(info);
1167 assertEquals("mysession", info.getName());
1168 assertEquals("net://172.0.0.1", info.getSessionPath());
1169 assertTrue(info.isStreamedTrace());
1170 fService.destroySession("mysession", new NullProgressMonitor());
1171
1172 info = fService.createSession("mysession", "file:///tmp", null, null, new NullProgressMonitor());
1173 assertNotNull(info);
1174 assertEquals("mysession", info.getName());
1175 assertEquals("file:///tmp", info.getSessionPath());
1176 assertTrue(!info.isStreamedTrace());
1177 fService.destroySession("mysession", new NullProgressMonitor());
1178
1179 info = fService.createSession("mysession", "file:///tmp", null, null, new NullProgressMonitor());
1180 assertNotNull(info);
1181 assertEquals("mysession", info.getName());
1182 assertEquals("file:///tmp", info.getSessionPath());
1183 assertTrue(!info.isStreamedTrace());
1184 fService.destroySession("mysession", new NullProgressMonitor());
1185
1186 info = fService.createSession("mysession", null, "tcp://172.0.0.1", "tcp://172.0.0.1:5343", new NullProgressMonitor());
1187 assertNotNull(info);
1188 assertEquals("mysession", info.getName());
1189 assertEquals("", info.getSessionPath()); // the complete network path is not available at this point
1190 assertTrue(info.isStreamedTrace());
1191 fService.destroySession("mysession", new NullProgressMonitor());
1192
1193 info = fService.createSession("mysession", "net://172.0.0.1:1234:2345", null, null, new NullProgressMonitor());
1194 assertNotNull(info);
1195 assertEquals("mysession", info.getName());
1196 assertEquals("net://172.0.0.1:1234:2345", info.getSessionPath());
1197 assertTrue(info.isStreamedTrace());
1198 fService.destroySession("mysession", new NullProgressMonitor());
1199
1200 // verbose
1201 enableVerbose();
1202 info = fService.createSession("mysession", "net://172.0.0.1", null, null, new NullProgressMonitor());
1203 assertNotNull(info);
1204 assertEquals("mysession", info.getName());
1205 assertEquals("net://172.0.0.1", info.getSessionPath());
1206 assertTrue(info.isStreamedTrace());
1207 disableVerbose();
1208 fService.destroySession("mysession", new NullProgressMonitor());
1209
1210
1211 } catch (ExecutionException e) {
1212 fail(e.toString());
1213 }
1214 }
1215
1216 @Test
1217 public void testCreateSessionVerbose2_1() {
1218 try {
1219 fShell.setScenario(SCEN_CREATE_SESSION_VERBOSE_2_1);
1220
1221 enableVerbose();
1222 ISessionInfo info = fService.createSession("mysession", "net://172.0.0.1", null, null, new NullProgressMonitor());
1223 assertNotNull(info);
1224 assertEquals("mysession", info.getName());
1225 assertEquals("net://172.0.0.1", info.getSessionPath());
1226 assertTrue(info.isStreamedTrace());
1227 fService.destroySession("mysession", new NullProgressMonitor());
1228 } catch (ExecutionException e) {
1229 fail(e.toString());
1230 } finally {
1231 disableVerbose();
1232 }
1233 }
1234
1235 private static void enableVerbose() {
1236 // verbose
1237 ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), false);
1238 ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, true);
1239 ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE);
1240 }
1241
1242 private static void disableVerbose() {
1243 ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false);
1244 }
1245
1246
1247 }
This page took 0.072499 seconds and 5 git commands to generate.