PREREQUISITES:
- - libuuid
- Universally unique id library - headers and static libraries libuuid
- generates and parses 128-bit universally unique ids (UUIDs). See RFC
- 4122 for more information.
-
- * Debian/Ubuntu package: uuid-dev
-
- liburcu
Userspace RCU library, by Mathieu Desnoyers and Paul E. McKenney
[AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
)
-# Check libuuid
-AC_CHECK_LIB([uuid], [uuid_generate], [],
- [AC_MSG_ERROR([Cannot find libuuid. Use [LDFLAGS]=-Ldir to specify its location.])]
-)
-
# Check liburcu
AC_CHECK_DECL([cds_list_add], [],
[AC_MSG_ERROR([liburcu 0.5.4 or newer is needed])], [[#include <urcu/list.h>]]
}
}
-/*
- * find_session_by_uuid
- *
- * Return a ltt_session structure ptr that matches the uuid.
- */
-struct ltt_session *find_session_by_uuid(uuid_t session_id)
-{
- int found = 0;
- struct ltt_session *iter;
-
- /* Sanity check for NULL session_id */
- if (uuid_is_null(session_id)) {
- goto end;
- }
-
- cds_list_for_each_entry(iter, <t_session_list.head, list) {
- if (uuid_compare(iter->uuid, session_id) == 0) {
- found = 1;
- break;
- }
- }
-
-end:
- if (!found) {
- iter = NULL;
- }
- return iter;
-}
-
/*
* find_session_by_name
*
goto error;
}
- /* UUID generation */
- uuid_generate(new_session->uuid);
-
/*
* Set consumer (identifier) to 0. This means that there is
* NO consumer attach to that session yet.
#include <lttng/lttng.h>
#include <urcu/list.h>
-#include <uuid/uuid.h>
/* Global session list */
struct ltt_session_list {
struct cds_list_head list;
char *name;
char *path;
- uuid_t uuid;
struct cds_list_head ust_traces;
struct ltt_kernel_session *kernel_session;
unsigned int ust_trace_count;
int create_session(char *name, char *path);
int destroy_session(char *name);
void get_lttng_session(struct lttng_session *sessions);
-struct ltt_session *find_session_by_uuid(uuid_t session_id);
struct ltt_session *find_session_by_name(char *name);
unsigned int get_session_count(void);
struct ltt_session_list *get_session_list(void);