Merge branch 'master' into dev
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Mar 2012 23:07:24 +0000 (18:07 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Mar 2012 23:07:24 +0000 (18:07 -0500)
1  2 
configure.ac
liblttng-ust/ltt-events.c
libringbuffer/ring_buffer_frontend.c

diff --combined configure.ac
index d4f879eb5f6f5d1664348fc728b9571a9555e3c4,f70385e9431b8106247200640d0e7b8ad1218db1..6c21ac736c3c81e123cc617a70c38cdaf1fe9895
@@@ -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" ;;
index dcc64a55044d6edadc9aacedec273fabe4545e81,b545b6338a0d4448e43648364fd68b3dcf4ceaaf..ac2b20f7938dbe8ff036b720d9be8427d6aba241
  
  #define _GNU_SOURCE
  #include <stdio.h>
 -#include <endian.h>
  #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>
@@@ -20,7 -22,7 +20,7 @@@
  #include <stddef.h>
  #include <inttypes.h>
  #include <time.h>
 -#include <sys/prctl.h>
 +#include <lttng/ust-endian.h>
  #include "clock.h"
  
  #include <urcu-bp.h>
@@@ -34,8 -36,6 +34,8 @@@
  #include <usterr-signal-safe.h>
  #include <helper.h>
  #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)
        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;
                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);
  }
index 0ae3d72f23a5b16b987d5b142fcb6964bd6f0c61,6d4a21bac101d0cfbc2809c4fce3a8489cdc1b41..728cbf9b72665036ccc0e275b9249cb00e591a01
@@@ -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);
  }
  
This page took 0.029077 seconds and 4 git commands to generate.