2 * Copyright (C) 2015, EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 package org
.lttng
.tools
;
21 import java
.util
.List
;
24 * Java representation of a LTTng tracing session.
26 * @author Alexandre Montplaisir
28 public interface ILttngSession
extends AutoCloseable
{
31 * Tracing domains as they are defined by lttng-tools
34 /** The JUL (java.util.logging) domain */
35 JUL("-j"), /** The log4j (org.apache.log4j) domain */
38 private final String flag
;
40 private Domain(String flag
) {
45 * @return The corresponding command-line flag to pass to options like
46 * "lttng enable-event"
48 public String
flag() {
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
58 * Create a new LTTng tracing session using the default backend.
61 * The name of the session to use. It can be null, in which case
62 * we will provide a unique random name.
64 * The tracing domain of this session
65 * @return The new session object
67 static ILttngSession
createSession(String sessionName
, Domain domain
) {
68 return createCommandLineSession(sessionName
, domain
);
72 * Create a new LTTng tracing session, which will use the command-line
76 * The name of the session to use. It can be null, in which case
77 * we will provide a unique random name.
79 * The tracing domain of this session
80 * @return The new session object
82 static ILttngSession
createCommandLineSession(String sessionName
, Domain domain
) {
83 return new LttngCommandLineSession(sessionName
, domain
);
86 // ------------------------------------------------------------------------
88 // ------------------------------------------------------------------------
91 * Should be used to destroy the LTTng session.
96 // ------------------------------------------------------------------------
98 // ------------------------------------------------------------------------
101 * Enable all events in the session (as with "enable-event -a").
103 * @return If the command executed successfully (return code = 0).
105 boolean enableAllEvents();
108 * Enable individual event(s).
110 * @param enabledEvents
111 * The list of events to enable. Should not be null or empty
112 * @return If the command executed successfully (return code = 0).
114 boolean enableEvents(String
... enabledEvents
);
117 * Send a disable-event command. Used to disable events that were previously
120 * @param disabledEvents
121 * The list of disabled events. Should not be null or empty
122 * @return If the command executed successfully (return code = 0).
124 boolean disableEvents(String
... disabledEvents
);
129 * @return If the command executed successfully (return code = 0).
134 * Stop the tracing session
136 * @return If the command executed successfully (return code = 0).
141 * Issue a "lttng view" command on the session, and returns its output. This
142 * effectively returns the current content of the trace in text form.
144 * @return The output of Babeltrace on the session's current trace
This page took 0.034378 seconds and 5 git commands to generate.