From: Mathieu Desnoyers Date: Tue, 6 Mar 2012 23:07:24 +0000 (-0500) Subject: Merge branch 'master' into dev X-Git-Tag: v2.1.0-rc1~97^2~1 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=e3feda7db3de3530e7c9c511536c36cccf317013;hp=-c;p=lttng-ust.git Merge branch 'master' into dev --- e3feda7db3de3530e7c9c511536c36cccf317013 diff --combined configure.ac index d4f879eb,f70385e9..6c21ac73 --- a/configure.ac +++ b/configure.ac @@@ -1,7 -1,7 +1,7 @@@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. - AC_INIT([lttng-ust],[2.0.0-rc1],[mathieu dot desnoyers at efficios dot com]) + AC_INIT([lttng-ust],[2.0.0-rc2],[mathieu dot desnoyers at efficios dot com]) # Following the numbering scheme proposed by libtool for the library version # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html @@@ -42,45 -42,13 +42,45 @@@ AC_PROG_MAKE_SE LT_INIT ## Checks for libraries. -AC_CHECK_LIB([dl], [dlopen]) +AC_CHECK_LIB([dl], [dlopen], +[ + have_libdl=yes +], +[ + #libdl not found, check for dlopen in libc. + AC_CHECK_LIB([c], [dlopen], + [ + have_libc_dl=yes + ], + [ + AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) + ]) +]) +AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"]) +AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"]) + AC_CHECK_LIB([pthread], [pthread_create]) # Check for libuuid -AC_CHECK_LIB([uuid], [uuid_generate], [], - [AC_MSG_ERROR([Cannot find libuuid. Use [LDFLAGS]=-Ldir to specify its location.])] +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 their 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]) @@@ -175,7 -143,6 +175,7 @@@ changequote([,])dn fi ;; x86_64) LIBFORMAT="elf64-x86-64" ;; + amd64) LIBFORMAT="elf64-x86-64" ;; powerpc) LIBFORMAT="elf32-powerpc" ;; ppc64) LIBFORMAT="elf64-powerpc" ;; powerpc64) LIBFORMAT="elf64-powerpc" ;; diff --combined liblttng-ust/ltt-events.c index dcc64a55,b545b633..ac2b20f7 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@@ -10,9 -10,11 +10,9 @@@ #define _GNU_SOURCE #include -#include #include #include #include -#include #include #include #include @@@ -20,7 -22,7 +20,7 @@@ #include #include #include -#include +#include #include "clock.h" #include @@@ -34,8 -36,6 +34,8 @@@ #include #include #include "error.h" +#include "compat.h" +#include "lttng-ust-uuid.h" #include "tracepoint-internal.h" #include "ltt-tracer.h" @@@ -44,6 -44,8 +44,6 @@@ #include "../libringbuffer/shm.h" #include "jhash.h" -#define PROCNAME_LEN 17 - /* * The sessions mutex is the centralized mutex across UST tracing * control and probe registration. All operations within this file are @@@ -295,7 -297,6 +295,7 @@@ 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 -304,7 +303,10 @@@ CDS_INIT_LIST_HEAD(&session->chan); CDS_INIT_LIST_HEAD(&session->events); CDS_INIT_LIST_HEAD(&session->wildcards); - uuid_generate(session->uuid); + ret = lttng_ust_uuid_generate(session->uuid); + if (ret != 0) { + session->uuid[0] = '\0'; + } cds_list_add(&session->list, &sessions); return session; } @@@ -455,7 -453,7 +455,7 @@@ struct ltt_channel *ltt_channel_create( * headers. Therefore the "chan" information used as input * should be already accessible. */ - chan = transport->ops.channel_create("[lttng]", buf_addr, + chan = transport->ops.channel_create(transport_name, buf_addr, subbuf_size, num_subbuf, switch_timer_interval, read_timer_interval, shm_fd, wait_fd, memory_map_size, chan_priv_init); @@@ -1091,12 -1089,11 +1091,12 @@@ stati int _ltt_session_metadata_statedump(struct ltt_session *session) { unsigned char *uuid_c = session->uuid; - char uuid_s[37], clock_uuid_s[CLOCK_UUID_LEN]; + char uuid_s[LTTNG_UST_UUID_STR_LEN], + clock_uuid_s[LTTNG_UST_UUID_STR_LEN]; struct ltt_channel *chan; struct ltt_event *event; int ret = 0; - char procname[PROCNAME_LEN] = ""; + char procname[LTTNG_UST_PROCNAME_LEN] = ""; if (!CMM_ACCESS_ONCE(session->active)) return 0; @@@ -1150,8 -1147,8 +1150,8 @@@ goto end; /* ignore error, just use empty string if error. */ - (void) prctl(PR_GET_NAME, (unsigned long) procname, 0, 0, 0); - procname[PROCNAME_LEN - 1] = '\0'; + lttng_ust_getprocname(procname); + procname[LTTNG_UST_PROCNAME_LEN - 1] = '\0'; ret = lttng_metadata_printf(session, "env {\n" " vpid = %d;\n" @@@ -1467,7 -1464,7 +1467,7 @@@ int ltt_wildcard_disable(struct session */ void lttng_fixup_event_tls(void) { - unsigned char uuid[37]; + unsigned char uuid[LTTNG_UST_UUID_STR_LEN]; - (void) uuid_generate(uuid); + (void) lttng_ust_uuid_generate(uuid); } diff --combined libringbuffer/ring_buffer_frontend.c index 0ae3d72f,6d4a21ba..728cbf9b --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@@ -54,7 -54,6 +54,7 @@@ #include "frontend.h" #include "shm.h" #include "tlsfixup.h" +#include "../liblttng-ust/compat.h" /* For ENODATA */ #ifndef max #define max(a, b) ((a) > (b) ? (a) : (b)) @@@ -983,23 -982,30 +983,30 @@@ void lib_ring_buffer_print_errors(struc const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; void *priv = channel_get_private(chan); - DBG("ring buffer %s, cpu %d: %lu records written, " - "%lu records overrun\n", - chan->backend.name, cpu, - v_read(config, &buf->records_count), - v_read(config, &buf->records_overrun)); - - if (v_read(config, &buf->records_lost_full) - || v_read(config, &buf->records_lost_wrap) - || v_read(config, &buf->records_lost_big)) - DBG("ring buffer %s, cpu %d: records were lost. Caused by:\n" - " [ %lu buffer full, %lu nest buffer wrap-around, " - "%lu event too big ]\n", - chan->backend.name, cpu, - v_read(config, &buf->records_lost_full), - v_read(config, &buf->records_lost_wrap), - v_read(config, &buf->records_lost_big)); - + if (!strcmp(chan->backend.name, "relay-metadata-mmap")) { + DBG("ring buffer %s: %lu records written, " + "%lu records overrun\n", + chan->backend.name, + v_read(config, &buf->records_count), + v_read(config, &buf->records_overrun)); + } else { + DBG("ring buffer %s, cpu %d: %lu records written, " + "%lu records overrun\n", + chan->backend.name, cpu, + v_read(config, &buf->records_count), + v_read(config, &buf->records_overrun)); + + if (v_read(config, &buf->records_lost_full) + || v_read(config, &buf->records_lost_wrap) + || v_read(config, &buf->records_lost_big)) + DBG("ring buffer %s, cpu %d: records were lost. Caused by:\n" + " [ %lu buffer full, %lu nest buffer wrap-around, " + "%lu event too big ]\n", + chan->backend.name, cpu, + v_read(config, &buf->records_lost_full), + v_read(config, &buf->records_lost_wrap), + v_read(config, &buf->records_lost_big)); + } lib_ring_buffer_print_buffer_errors(buf, chan, priv, cpu, handle); }