Revert "Create libuuid/libc uuid wrapper"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Feb 2012 22:10:26 +0000 (17:10 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Feb 2012 22:10:26 +0000 (17:10 -0500)
This reverts commit 67107619135ff344f0de2783ec2d48e558deaf9a.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
include/lttng/ust-events.h
liblttng-ust/Makefile.am
liblttng-ust/clock.h
liblttng-ust/ltt-events.c
liblttng-ust/ltt-ring-buffer-client.h
liblttng-ust/ltt-ring-buffer-metadata-client.h
liblttng-ust/uuid.h [deleted file]

index aa0fac34a6b8af3f10fdac8c65ea98cc711e53ee..f9738a7e460a5970a3b2cac1e7b8ea8c88268787 100644 (file)
@@ -49,22 +49,18 @@ AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_LIB([uuid], [uuid_generate],
 [
        AC_DEFINE_UNQUOTED([LTTNG_UST_HAVE_LIBUUID], 1, [Has libuuid support.])
-       have_libuuid=yes
 ],
 [
        # libuuid not found, check for uuid_create in libc.
        AC_CHECK_LIB([c], [uuid_create],
        [
                AC_DEFINE_UNQUOTED([LTTNG_UST_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
-               have_libc_uuid=yes
        ],
        [
                AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify its location.])
        ])
 ]
 )
-AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
-AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
 
 # Checks for header files.
 #AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
index 2049e53501a95f1ac6ed386f7e3255c060f2b519..2bbe785e6850e8c5c21bf54f6ad81011168bfb09 100644 (file)
 
 #include <urcu/list.h>
 #include <urcu/hlist.h>
+#include <uuid/uuid.h>
 #include <stdint.h>
 #include <lttng/ust-abi.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ust-endian.h>
 #include <float.h>
 
-#define LTTNG_UST_UUID_LEN             16
-
 struct ltt_channel;
 struct ltt_session;
 struct lttng_ust_lib_ring_buffer_ctx;
@@ -324,7 +323,7 @@ struct ltt_channel {
        /* Channel ID, available for consumer too */
        unsigned int id;
        /* Copy of session UUID for consumer (availability through shm) */
-       unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
+       uuid_t uuid;                    /* Trace session unique ID */
 };
 
 struct ltt_session {
@@ -337,7 +336,7 @@ struct ltt_session {
        struct cds_list_head wildcards; /* Wildcard list head */
        struct cds_list_head list;      /* Session list */
        unsigned int free_chan_id;      /* Next chan ID to allocate */
-       unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
+       uuid_t uuid;                    /* Trace session unique ID */
        unsigned int metadata_dumped:1;
 };
 
index 628e56fba9043f700580101bbc055db81a148501..9d9477b9eaad88f84c463b2d8359cb00d9c12f1c 100644 (file)
@@ -33,8 +33,7 @@ liblttng_ust_runtime_la_SOURCES = \
        compat.h \
        wait.h \
        jhash.h \
-       error.h \
-       uuid.h
+       error.h
 
 liblttng_ust_support_la_SOURCES = \
        ltt-tracer.h \
@@ -56,16 +55,10 @@ liblttng_ust_support_la_LIBADD = \
 liblttng_ust_la_LIBADD = \
        -lpthread \
        -lrt \
+       -luuid \
        -llttng-ust-tracepoint \
        $(top_builddir)/snprintf/libustsnprintf.la \
        $(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \
        liblttng-ust-runtime.la liblttng-ust-support.la
 
-if LTTNG_UST_BUILD_WITH_LIBUUID
-liblttng_ust_la_LIBADD += -luuid
-endif
-if LTTNG_UST_BUILD_WITH_LIBC_UUID
-liblttng_ust_la_LIBADD += -lc
-endif
-
 liblttng_ust_la_CFLAGS = -DUST_COMPONENT="liblttng_ust" -fno-strict-aliasing
index b4d17e785e164e3ae9a59c89fd7a897853754bc8..82a7b45cd5294a3f35c63e172ea8105d0e5c2e0d 100644 (file)
 #include <stdint.h>
 #include <stddef.h>
 #include <stdio.h>
-#include "uuid.h"
+
+/*
+ * Includes final \0.
+ */
+#define CLOCK_UUID_LEN         37
 
 /* TRACE CLOCK */
 
@@ -67,12 +71,12 @@ const int trace_clock_uuid(char *uuid)
        if (!fp) {
                return -ENOENT;
        }
-       len = fread(uuid, 1, LTTNG_UST_UUID_STR_LEN - 1, fp);
-       if (len < LTTNG_UST_UUID_STR_LEN - 1) {
+       len = fread(uuid, 1, CLOCK_UUID_LEN - 1, fp);
+       if (len < CLOCK_UUID_LEN - 1) {
                ret = -EINVAL;
                goto end;
        }
-       uuid[LTTNG_UST_UUID_STR_LEN - 1] = '\0';
+       uuid[CLOCK_UUID_LEN - 1] = '\0';
 end:
        fclose(fp);
        return ret;
index b79eea518d1e6852776f28482902bcc1fd337014..c9d35dde199e11929e6307cfe3eb31c1dc272406 100644 (file)
@@ -13,6 +13,7 @@
 #include <urcu/list.h>
 #include <urcu/hlist.h>
 #include <pthread.h>
+#include <uuid/uuid.h>
 #include <errno.h>
 #include <sys/shm.h>
 #include <sys/ipc.h>
@@ -35,7 +36,6 @@
 #include <helper.h>
 #include "error.h"
 #include "compat.h"
-#include "uuid.h"
 
 #include "tracepoint-internal.h"
 #include "ltt-tracer.h"
@@ -295,7 +295,6 @@ void synchronize_trace(void)
 struct ltt_session *ltt_session_create(void)
 {
        struct ltt_session *session;
-       int ret;
 
        session = zmalloc(sizeof(struct ltt_session));
        if (!session)
@@ -303,10 +302,7 @@ struct ltt_session *ltt_session_create(void)
        CDS_INIT_LIST_HEAD(&session->chan);
        CDS_INIT_LIST_HEAD(&session->events);
        CDS_INIT_LIST_HEAD(&session->wildcards);
-       ret = lttng_ust_uuid_generate(session->uuid);
-       if (ret != 0) {
-               session->uuid[0] = '\0';
-       }
+       uuid_generate(session->uuid);
        cds_list_add(&session->list, &sessions);
        return session;
 }
@@ -1091,8 +1087,7 @@ static
 int _ltt_session_metadata_statedump(struct ltt_session *session)
 {
        unsigned char *uuid_c = session->uuid;
-       char uuid_s[LTTNG_UST_UUID_STR_LEN],
-               clock_uuid_s[LTTNG_UST_UUID_STR_LEN];
+       char uuid_s[37], clock_uuid_s[CLOCK_UUID_LEN];
        struct ltt_channel *chan;
        struct ltt_event *event;
        int ret = 0;
index 825db71271cba02880946bbcdce08a09ad17599b..ce9d263ce6c7be248c534564973de1ce0ce1a5f7 100644 (file)
@@ -12,7 +12,6 @@
 #include <lttng/ust-events.h>
 #include "lttng/bitfield.h"
 #include "clock.h"
-#include "uuid.h"
 #include "ltt-tracer.h"
 #include "../libringbuffer/frontend_types.h"
 
@@ -32,7 +31,7 @@ struct packet_header {
                                         * Trace magic number.
                                         * contains endianness information.
                                         */
-       uint8_t uuid[LTTNG_UST_UUID_LEN];
+       uint8_t uuid[16];
        uint32_t stream_id;
 
        struct {
index dcbaacb61c1c1d583473ed367d4396e5de72bea9..7e79b116fa613a672be0efaeb0a2c1987536c762 100644 (file)
@@ -16,7 +16,7 @@
 
 struct metadata_packet_header {
        uint32_t magic;                 /* 0x75D11D57 */
-       uint8_t  uuid[LTTNG_UST_UUID_LEN]; /* Unique Universal Identifier */
+       uint8_t  uuid[16];              /* Unique Universal Identifier */
        uint32_t checksum;              /* 0 if unused */
        uint32_t content_size;          /* in bits */
        uint32_t packet_size;           /* in bits */
diff --git a/liblttng-ust/uuid.h b/liblttng-ust/uuid.h
deleted file mode 100644 (file)
index 1027acb..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef _LTTNG_UST_UUID_H
-#define _LTTNG_UST_UUID_H
-
-/*
- * Copyright (C) 2011   Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
- * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
- *
- * Permission is hereby granted to use or copy this program
- * for any purpose,  provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is granted,
- * provided the above notices are retained, and a notice that the code was
- * modified is included with the above copyright notice.
- */
-
-#include <config.h>
-#include <lttng/ust-events.h> /* For LTTNG_UST_UUID_LEN */
-/*
- * Includes final \0.
- */
-#define LTTNG_UST_UUID_STR_LEN         37
-
-#include <uuid/uuid.h>
-
-#ifdef LTTNG_UST_HAVE_LIBUUID
-static inline
-int lttng_ust_uuid_generate(unsigned char *uuid_out)
-{
-       uuid_generate(uuid_out);
-       return 0;
-}
-
-#elif defined(LTTNG_UST_HAVE_LIBC_UUID)
-#include <uuid.h>
-#include <stdint.h>
-
-static inline
-int lttng_ust_uuid_generate(unsigned char *uuid_out)
-{
-       uint32_t status;
-
-       uuid_create(uuid_out, &status);
-       if (status == uuid_s_ok)
-               return 0;
-       else
-               return -1;
-}
-
-#else
-#error "LTTng-UST needs to have a UUID generator configured."
-#endif
-
-#endif /* _LTTNG_UST_UUID_H */
This page took 0.03023 seconds and 4 git commands to generate.