#include "kernel-ctl.h"
/*
- * kernel_add_channel_context
- *
- * Add context on a kernel channel.
+ * Add context on a kernel channel.
*/
int kernel_add_channel_context(struct ltt_kernel_channel *chan,
struct lttng_kernel_context *ctx)
}
/*
- * kernel_add_event_context
- *
- * Add context on a kernel event.
+ * Add context on a kernel event.
*/
int kernel_add_event_context(struct ltt_kernel_event *event,
struct lttng_kernel_context *ctx)
}
/*
- * kernel_create_session
- *
- * Create a new kernel session, register it to the kernel tracer and add it to
- * the session daemon session.
+ * Create a new kernel session, register it to the kernel tracer and add it to
+ * the session daemon session.
*/
int kernel_create_session(struct ltt_session *session, int tracer_fd)
{
}
/*
- * kernel_create_channel
- *
- * Create a kernel channel, register it to the kernel tracer and add it to the
- * kernel session.
+ * Create a kernel channel, register it to the kernel tracer and add it to the
+ * kernel session.
*/
-int kernel_create_channel(struct ltt_kernel_session *session, struct lttng_channel *chan, char *path)
+int kernel_create_channel(struct ltt_kernel_session *session,
+ struct lttng_channel *chan, char *path)
{
int ret;
struct ltt_kernel_channel *lkc;
}
/*
- * kernel_create_event
- *
- * Create a kernel event, enable it to the kernel tracer and add it to the
- * channel event list of the kernel session.
+ * Create a kernel event, enable it to the kernel tracer and add it to the
+ * channel event list of the kernel session.
*/
-int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel)
+int kernel_create_event(struct lttng_event *ev,
+ struct ltt_kernel_channel *channel)
{
int ret;
struct ltt_kernel_event *event;
}
/*
- * kernel_disable_channel
- *
- * Disable a kernel channel.
+ * Disable a kernel channel.
*/
int kernel_disable_channel(struct ltt_kernel_channel *chan)
{
}
/*
- * kernel_enable_channel
- *
- * Enable a kernel channel.
+ * Enable a kernel channel.
*/
int kernel_enable_channel(struct ltt_kernel_channel *chan)
{
}
/*
- * kernel_enable_event
- *
- * Enable a kernel event.
+ * Enable a kernel event.
*/
int kernel_enable_event(struct ltt_kernel_event *event)
{
}
/*
- * kernel_disable_event
- *
- * Disable a kernel event.
+ * Disable a kernel event.
*/
int kernel_disable_event(struct ltt_kernel_event *event)
{
}
/*
- * kernel_open_metadata
- *
- * Create kernel metadata, open from the kernel tracer and add it to the
- * kernel session.
+ * Create kernel metadata, open from the kernel tracer and add it to the
+ * kernel session.
*/
int kernel_open_metadata(struct ltt_kernel_session *session, char *path)
{
}
/*
- * kernel_start_session
- *
- * Start tracing session.
+ * Start tracing session.
*/
int kernel_start_session(struct ltt_kernel_session *session)
{
}
/*
- * kernel_wait_quiescent
- *
- * Make a kernel wait to make sure in-flight probe have completed.
+ * Make a kernel wait to make sure in-flight probe have completed.
*/
void kernel_wait_quiescent(int fd)
{
}
/*
- * kernel_calibrate
+ * Kernel calibrate
*/
int kernel_calibrate(int fd, struct lttng_kernel_calibrate *calibrate)
{
/*
- * kernel_metadata_flush_buffer
- *
* Force flush buffer of metadata.
*/
int kernel_metadata_flush_buffer(int fd)
}
/*
- * kernel_flush_buffer
- *
- * Force flush buffer for channel.
+ * Force flush buffer for channel.
*/
int kernel_flush_buffer(struct ltt_kernel_channel *channel)
{
}
/*
- * kernel_stop_session
- *
- * Stop tracing session.
+ * Stop tracing session.
*/
int kernel_stop_session(struct ltt_kernel_session *session)
{
}
/*
- * kernel_open_channel_stream
+ * Open stream of channel, register it to the kernel tracer and add it
+ * to the stream list of the channel.
*
- * Open stream of channel, register it to the kernel tracer and add it
- * to the stream list of the channel.
- *
- * Return the number of created stream. Else, a negative value.
+ * Return the number of created stream. Else, a negative value.
*/
int kernel_open_channel_stream(struct ltt_kernel_channel *channel)
{
}
/*
- * kernel_open_metadata_stream
- *
- * Open the metadata stream and set it to the kernel session.
+ * Open the metadata stream and set it to the kernel session.
*/
int kernel_open_metadata_stream(struct ltt_kernel_session *session)
{
*
* This program 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
+ * 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
/*
* Default size for the event list when kernel_list_events is called. This size
- * value is based on the initial LTTng 2.0 version set of tracepoints. This is
- * NOT an upper bound because if the real event list size is bigger, dynamic
- * reallocation is performed.
+ * value is based on the initial LTTng 2.0 version set of tracepoints.
+ *
+ * This is NOT an upper bound because if the real event list size is bigger,
+ * dynamic reallocation is performed.
*/
-#define KERNEL_EVENT_LIST_SIZE 2000
+#define KERNEL_EVENT_LIST_SIZE 80
int kernel_add_channel_context(struct ltt_kernel_channel *chan,
struct lttng_kernel_context *ctx);
*
* This program 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
+ * 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
#ifndef _LTT_SESSIOND_H
#define _LTT_SESSIOND_H
-#define DEFAULT_HOME_DIR "/tmp"
-#define DEFAULT_UST_SOCK_DIR DEFAULT_HOME_DIR "/ust-app-socks"
-#define DEFAULT_GLOBAL_APPS_PIPE DEFAULT_UST_SOCK_DIR "/global"
-#define DEFAULT_TRACE_OUTPUT DEFAULT_HOME_DIR "/lttng"
+#define DEFAULT_HOME_DIR "/tmp"
+#define DEFAULT_UST_SOCK_DIR DEFAULT_HOME_DIR "/ust-app-socks"
+#define DEFAULT_GLOBAL_APPS_PIPE DEFAULT_UST_SOCK_DIR "/global"
+#define DEFAULT_TRACE_OUTPUT DEFAULT_HOME_DIR "/lttng"
struct module_param {
const char *name;
*
* This program 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
+ * 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
};
/*
- * add_session_list
+ * Add a ltt_session structure to the global list.
*
- * Add a ltt_session structure to the global list.
- *
- * The caller MUST acquire the session list lock before.
+ * The caller MUST acquire the session list lock before.
*/
static void add_session_list(struct ltt_session *ls)
{
}
/*
- * del_session_list
- *
- * Delete a ltt_session structure to the global list.
+ * Delete a ltt_session structure to the global list.
*
- * The caller MUST acquire the session list lock before.
+ * The caller MUST acquire the session list lock before.
*/
static void del_session_list(struct ltt_session *ls)
{
}
/*
- * get_session_list
- *
- * Return a pointer to the session list.
+ * Return a pointer to the session list.
*/
struct ltt_session_list *get_session_list(void)
{
}
/*
- * find_session_by_name
- *
- * Return a ltt_session structure ptr that matches name.
- * If no session found, NULL is returned.
+ * Return a ltt_session structure ptr that matches name.
+ * If no session found, NULL is returned.
*/
struct ltt_session *find_session_by_name(char *name)
{
}
/*
- * destroy_session
- *
- * Delete session from the session list and free the memory.
+ * Delete session from the session list and free the memory.
*
- * Return -1 if no session is found. On success, return 1;
+ * Return -1 if no session is found. On success, return 1;
*/
int destroy_session(char *name)
{
}
/*
- * create_session
- *
- * Create a brand new session and add it to the session list.
+ * Create a brand new session and add it to the session list.
*/
int create_session(char *name, char *path)
{
#ifndef _LTT_SESSION_H
#define _LTT_SESSION_H
-//#include <lttng/lttng.h>
#include <urcu/list.h>
/*
#include "trace.h"
/*
- * get_kernel_channel_by_name
- *
- * Find the channel name for the given kernel session.
+ * Find the channel name for the given kernel session.
*/
struct ltt_kernel_channel *get_kernel_channel_by_name(
char *name, struct ltt_kernel_session *session)
}
/*
- * get_kernel_event_by_name
- *
- * Find the event name for the given channel.
+ * Find the event name for the given channel.
*/
struct ltt_kernel_event *get_kernel_event_by_name(
char *name, struct ltt_kernel_channel *channel)
}
/*
- * trace_create_kernel_session
- *
- * Allocate and initialize a kernel session data structure.
+ * Allocate and initialize a kernel session data structure.
*
- * Return pointer to structure or NULL.
+ * Return pointer to structure or NULL.
*/
struct ltt_kernel_session *trace_create_kernel_session(void)
{
}
/*
- * trace_create_kernel_channel
+ * Allocate and initialize a kernel channel data structure.
*
- * Allocate and initialize a kernel channel data structure.
- *
- * Return pointer to structure or NULL.
+ * Return pointer to structure or NULL.
*/
struct ltt_kernel_channel *trace_create_kernel_channel(struct lttng_channel *chan, char *path)
{
}
/*
- * trace_create_kernel_event
- *
- * Allocate and initialize a kernel event. Set name and event type.
+ * Allocate and initialize a kernel event. Set name and event type.
*
- * Return pointer to structure or NULL.
+ * Return pointer to structure or NULL.
*/
struct ltt_kernel_event *trace_create_kernel_event(struct lttng_event *ev)
{
}
/*
- * trace_create_kernel_metadata
+ * Allocate and initialize a kernel metadata.
*
- * Allocate and initialize a kernel metadata.
- *
- * Return pointer to structure or NULL.
+ * Return pointer to structure or NULL.
*/
struct ltt_kernel_metadata *trace_create_kernel_metadata(char *path)
{
}
/*
- * trace_create_kernel_stream
- *
- * Allocate and initialize a kernel stream. The stream is set to ACTIVE_FD by
- * default.
+ * Allocate and initialize a kernel stream. The stream is set to ACTIVE_FD by
+ * default.
*
- * Return pointer to structure or NULL.
+ * Return pointer to structure or NULL.
*/
struct ltt_kernel_stream *trace_create_kernel_stream(void)
{
return NULL;
}
+/*
+ * Cleanup kernel stream structure.
+ */
void trace_destroy_kernel_stream(struct ltt_kernel_stream *stream)
{
DBG("[trace] Closing stream fd %d", stream->fd);
free(stream);
}
+/*
+ * Cleanup kernel event structure.
+ */
void trace_destroy_kernel_event(struct ltt_kernel_event *event)
{
DBG("[trace] Closing event fd %d", event->fd);
free(event);
}
+/*
+ * Cleanup kernel channel structure.
+ */
void trace_destroy_kernel_channel(struct ltt_kernel_channel *channel)
{
struct ltt_kernel_stream *stream, *stmp;
free(channel);
}
+/*
+ * Cleanup kernel metadata structure.
+ */
void trace_destroy_kernel_metadata(struct ltt_kernel_metadata *metadata)
{
DBG("[trace] Closing metadata fd %d", metadata->fd);
free(metadata);
}
+/*
+ * Cleanup kernel session structure
+ */
void trace_destroy_kernel_session(struct ltt_kernel_session *session)
{
struct ltt_kernel_channel *channel, *ctmp;
char *channel;
};
-/*
- * Get functions.
- */
struct ltt_kernel_event *get_kernel_event_by_name(
char *name, struct ltt_kernel_channel *channel);
struct ltt_kernel_channel *get_kernel_channel_by_name(
static void del_traceable_app(struct ltt_traceable_app *lta);
/*
- * add_traceable_app
- *
- * Add a traceable application structure to the global
- * list protected by a mutex.
+ * Add a traceable application structure to the global list protected by a
+ * mutex.
*/
static void add_traceable_app(struct ltt_traceable_app *lta)
{
}
/*
- * del_traceable_app
- *
- * Delete a traceable application structure from the
- * global list protected by a mutex.
+ * Delete a traceable application structure from the global list protected by a
+ * mutex.
*/
static void del_traceable_app(struct ltt_traceable_app *lta)
{
}
/*
- * register_traceable_app
+ * Using pid and uid (of the app), allocate a new ltt_traceable_app struct and
+ * add it to the global traceable app list.
*
- * Using pid and uid (of the app), allocate
- * a new ltt_traceable_app struct and add it
- * to the global traceable app list.
- *
- * On success, return 0, else return malloc ENOMEM.
+ * On success, return 0, else return malloc ENOMEM.
*/
int register_traceable_app(pid_t pid, uid_t uid)
{
}
/*
- * unregister_traceable_app
- *
- * Unregister app by removing it from the global
- * traceable app list and freeing the data struct.
+ * Unregister app by removing it from the global traceable app list and freeing
+ * the data struct.
*/
void unregister_traceable_app(pid_t pid)
{
}
/*
- * get_app_count
- *
- * Return traceable_app_count
+ * Return traceable_app_count
*/
unsigned int get_app_count(void)
{
}
/*
- * find_app_by_pid
- *
- * Iterate over the traceable apps list and
- * return a pointer or NULL if not found.
+ * Iterate over the traceable apps list and return a pointer or NULL if not
+ * found.
*/
struct ltt_traceable_app *find_app_by_pid(pid_t pid)
{
}
/*
- * get_app_list_pids
- *
- * List traceable user-space application and fill an
- * array of pids.
+ * List traceable user-space application and fill an array of pids.
*/
void get_app_list_pids(pid_t *pids)
{
struct cds_list_head head;
};
-/* Registered traceable applications. Libust registers
- * to the session daemon and a linked list is kept
- * of all running traceable app.
+/* Registered traceable applications. Libust registers to the session daemon
+ * and a linked list is kept of all running traceable app.
*/
struct ltt_traceable_app {
struct cds_list_head list;
#include "utils.h"
/*
- * get_home_dir
+ * Return pointer to home directory path using the env variable HOME.
*
- * Return pointer to home directory path using the env variable HOME.
- * No home, NULL is returned.
+ * No home, NULL is returned.
*/
const char *get_home_dir(void)
{
}
/*
- * mkdir_recursive
- *
- * Create recursively directory using the FULL path.
+ * Create recursively directory using the FULL path.
*/
int mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid)
{
}
} else if (ret == 0) {
/*
- * We created the directory. Set its
- * ownership to the user/group
- * specified.
+ * We created the directory. Set its ownership to the
+ * user/group specified.
*/
ret = chown(tmp, uid, gid);
if (ret < 0) {
ret = -errno;
} else if (ret == 0) {
/*
- * We created the directory. Set its ownership to the
- * user/group specified.
+ * We created the directory. Set its ownership to the user/group
+ * specified.
*/
ret = chown(tmp, uid, gid);
if (ret < 0) {
* Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
* Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
- * 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; only version 2
- * of the License.
+ * 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; only version 2 of the License.
*
- * This program 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.
+ * This program 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.
+ * 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.
*/
#include <unistd.h>
#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(array) (sizeof(array) / (sizeof((array)[0])))
+#define ARRAY_SIZE(array) (sizeof(array) / (sizeof((array)[0])))
#endif
int mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid);