Remove all remaining sessiond kernel command
[lttng-tools.git] / include / lttng / lttng.h
index 2b14231eb5534194f695b963c6c3caf2a87ce53a..eb34a73490615593ce8b7a4a0b0c0b82bd5ed0fe 100644 (file)
@@ -5,19 +5,19 @@
  *
  * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _LTTNG_H
  * Domain type are the different possible tracers.
  */
 enum lttng_domain_type {
-       LTTNG_DOMAIN_KERNEL,
-       LTTNG_DOMAIN_UST,
-       LTTNG_DOMAIN_UST_EXEC_NAME,
-       LTTNG_DOMAIN_UST_PID,
-       LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN,
-};
-
-struct lttng_domain {
-       enum lttng_domain_type type;
-       union {
-               pid_t pid;
-               char exec_name[NAME_MAX];
-       } attr;
+       LTTNG_DOMAIN_KERNEL                   = 1,
+       LTTNG_DOMAIN_UST                      = 2,
+       LTTNG_DOMAIN_UST_EXEC_NAME            = 3,
+       LTTNG_DOMAIN_UST_PID                  = 4,
+       LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN  = 5,
 };
 
 /*
@@ -73,6 +65,7 @@ enum lttng_event_type {
        LTTNG_EVENT_TRACEPOINT,
        LTTNG_EVENT_PROBE,
        LTTNG_EVENT_FUNCTION,
+       LTTNG_EVENT_FUNCTION_ENTRY,
 };
 
 /*
@@ -97,6 +90,14 @@ enum lttng_event_context_type {
        LTTNG_EVENT_CONTEXT_VPPID              = 9,
 };
 
+struct lttng_domain {
+       enum lttng_domain_type type;
+       union {
+               pid_t pid;
+               char exec_name[NAME_MAX];
+       } attr;
+};
+
 /* Perf counter attributes */
 struct lttng_event_perf_counter_ctx {
        uint32_t type;
@@ -137,6 +138,7 @@ struct lttng_event_function_attr {
 struct lttng_event {
        char name[LTTNG_SYMBOL_NAME_LEN];
        enum lttng_event_type type;
+       uint32_t enabled;
        /* Per event type configuration */
        union {
                struct lttng_event_probe_attr probe;
@@ -161,6 +163,7 @@ struct lttng_channel_attr {
  */
 struct lttng_channel {
        char name[NAME_MAX];
+       uint32_t enabled;
        struct lttng_channel_attr attr;
 };
 
@@ -197,7 +200,7 @@ struct lttng_session {
 /*
  * Create tracing session using a name and a path where trace will be written.
  */
-extern int lttng_create_session(char *name, char *path);
+extern int lttng_create_session(const char *name, const char *path);
 
 /*
  * Destroy tracing session.
@@ -205,16 +208,48 @@ extern int lttng_create_session(char *name, char *path);
  * The session will not be useable anymore, tracing will stopped for all
  * registered trace and tracing buffers will be flushed.
  */
-extern int lttng_destroy_session(char *name);
+extern int lttng_destroy_session(const char *name);
 
 /*
- * List tracing sessions.
+ * List all tracing sessions.
  *
- * Return the size of the "lttng_session" array. Caller must free(3) the
- * returned data.
+ * Return the size of the "lttng_session" array. Caller must free(3).
  */
 extern int lttng_list_sessions(struct lttng_session **sessions);
 
+/*
+ * List registered domain(s) of a session.
+ *
+ * Return the size of the "lttng_domain" array. Caller must free(3).
+ */
+extern int lttng_list_domains(const char *session_name,
+               struct lttng_domain **domains);
+
+/*
+ * List channel(s) of a session.
+ *
+ * Return the size of the "lttng_channel" array. Caller must free(3).
+ */
+extern int lttng_list_channels(struct lttng_domain *domain,
+               const char *session_name, struct lttng_channel **channels);
+
+/*
+ * List event(s) of a session channel.
+ *
+ * Return the size of the "lttng_event" array. Caller must free(3).
+ */
+extern int lttng_list_events(struct lttng_domain *domain,
+               const char *session_name, const char *channel_name,
+               struct lttng_event **events);
+
+/*
+ * List available tracepoints of domain.
+ *
+ * Return the size of the "lttng_event" array. Caller must free(3).
+ */
+extern int lttng_list_tracepoints(struct lttng_domain *domain,
+               struct lttng_event **events);
+
 /*
  * Check if a session daemon is alive.
  */
@@ -232,7 +267,7 @@ extern int lttng_set_tracing_group(const char *name);
  * it's not done, you'll get an error saying that the session is not found.
  * It avoids the use of a session name on every API call.
  */
-extern void lttng_set_session_name(char *name);
+extern void lttng_set_session_name(const char *name);
 
 /*
  * Return a human readable error message of a lttng-tools error code.
@@ -244,12 +279,12 @@ extern const char *lttng_get_readable_code(int code);
 /*
  * Start tracing for *all* registered trace (kernel and user-space).
  */
-extern int lttng_start_tracing(char *session_name);
+extern int lttng_start_tracing(const char *session_name);
 
 /*
  * Stop tracing for *all* registered trace (kernel and user-space).
  */
-extern int lttng_stop_tracing(char *session_name);
+extern int lttng_stop_tracing(const char *session_name);
 
 /*
  * Add context to event for a specific channel.
@@ -260,7 +295,8 @@ extern int lttng_stop_tracing(char *session_name);
  */
 
 extern int lttng_add_context(struct lttng_domain *domain,
-               struct lttng_event_context *ctx, char *event_name, char *channel_name);
+               struct lttng_event_context *ctx, const char *event_name,
+               const char *channel_name);
 
 /*
  * Create or enable a kernel event.
@@ -271,35 +307,30 @@ extern int lttng_add_context(struct lttng_domain *domain,
  * If channel_name is NULL, the default channel is used (channel0).
  */
 extern int lttng_enable_event(struct lttng_domain *domain, struct lttng_event *ev,
-               char *channel_name);
+               const char *channel_name);
 
 /*
  * Create or enable a kernel channel.
  *
  * If name is NULL, the default channel is enabled (channel0).
  */
-extern int lttng_enable_channel(struct lttng_domain *domain, struct lttng_channel *chan);
+extern int lttng_enable_channel(struct lttng_domain *domain,
+               struct lttng_channel *chan);
 
 /*
  * Disable kernel event.
  *
  * If channel_name is NULL, the default channel is used (channel0).
  */
-extern int lttng_disable_event(struct lttng_domain *domain, char *name,
-               char *channel_name);
+extern int lttng_disable_event(struct lttng_domain *domain, const char *name,
+               const char *channel_name);
 
 /*
  * Disable kernel channel.
  *
  * If channel_name is NULL, the default channel is disabled (channel0).
  */
-extern int lttng_disable_channel(struct lttng_domain *domain, char *name);
-
-/*
- * List kernel events.
- *
- * Return the size of the allocated event list. Caller must free(3) the data.
- */
-extern int lttng_list_events(struct lttng_domain *domain, char **event_list);
+extern int lttng_disable_channel(struct lttng_domain *domain,
+               const char *name);
 
 #endif /* _LTTNG_H */
This page took 0.026083 seconds and 4 git commands to generate.