Merge branch 'dev'
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 5 Apr 2012 17:21:08 +0000 (13:21 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 5 Apr 2012 17:21:08 +0000 (13:21 -0400)
16 files changed:
1  2 
README
configure.ac
include/lttng/ust-events.h
liblttng-ust/compat.h
liblttng-ust/ltt-events.c
liblttng-ust/ltt-ring-buffer-client.h
liblttng-ust/ltt-ring-buffer-metadata-client.h
liblttng-ust/lttng-context-procname.c
liblttng-ust/lttng-context-vtid.c
liblttng-ust/lttng-ust-comm.c
libringbuffer/backend_internal.h
libringbuffer/getcpu.h
libringbuffer/ring_buffer_frontend.c
libringbuffer/shm.c
tests/ust-basic-tracing/ust-basic-tracing.c
tests/ust-multi-test/ust-multi-test.c

diff --combined README
index 78160a30f8210e0cdb9e8e6e8483aa3a6204e117,8193c6603837940ffc2cade120ef4dc867b638fe..52aebd8940c7cf01770f949beb944f2e63b54a1a
--- 1/README
--- 2/README
+++ b/README
@@@ -67,7 -67,7 +67,7 @@@ USAGE
        "TRACEPOINT_DEFINE" and include the tracepoint provider.
      - Use "-I." for the compilation unit containing the tracepoint
        provider include (e.g. tp.c).
-     - Link application with "-ldl".
+     - Link application with "-ldl" on Linux, with "-lc" on BSD.
      - If building the provider directly into the application,
        link the application with "-llttng-ust".
      - If building a static library for the provider, link the static
@@@ -75,7 -75,7 +75,7 @@@
      - Include the tracepoint provider header into all C files using
        the provider.
      - Example:
-         tests/hello/  hello.c tp.c ust_tests_hello.h Makefile.example
+         tests/hello/  hello.c tp.c ust_tests_hello.h Makefile.example.*
  
    2) Compile the Tracepoint Provider separately from the application,
       using dynamic linking:
@@@ -87,7 -87,7 +87,7 @@@
        files that use the provider.
      - Compile the tracepoint provider with "-I.".
      - Link the tracepoint provider with "-llttng-ust".
-     - Link application with "-ldl".
+     - Link application with "-ldl" on Linux, "-lc" on BSD.
      - Set a LD_PRELOAD environment to preload the tracepoint provider
        shared object before starting the application when tracing is
        needed. Another way is to dlopen the tracepoint probe when needed
@@@ -113,10 -113,6 +113,10 @@@ ENVIRONMENT VARIABLES
      recommended for applications with time constraints on the process
      startup time.
  
 +  - The compilation flag "-DLTTNG_UST_DEBUG_VALGRIND" should be enabled
 +    at build time to allow liblttng-ust to be used with valgrind
 +    (side-effect: disables per-cpu buffering).
 +
  
  TRACE VIEWER:
  
diff --combined configure.ac
index 5cb088300e41d13b638f53be2644b1919f619b26,6c21ac736c3c81e123cc617a70c38cdaf1fe9895..294d457524b153895200ed285f34d08df56810da
@@@ -1,7 -1,7 +1,7 @@@
  #                                               -*- Autoconf -*-
  # Process this file with autoconf to produce a configure script.
  
 -AC_INIT([lttng-ust],[2.0.0-rc2],[mathieu dot desnoyers at efficios dot com])
 +AC_INIT([lttng-ust],[2.0.1],[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
@@@ -13,7 -13,7 +13,7 @@@ AC_CONFIG_AUX_DIR([config]
  AC_CANONICAL_TARGET
  AC_CANONICAL_HOST
  AC_CONFIG_MACRO_DIR([config])
 -AM_INIT_AUTOMAKE([foreign])
 +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
  m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  AC_CONFIG_SRCDIR([include/lttng/tracepoint.h])
  
@@@ -34,10 -34,6 +34,10 @@@ AC_DEFINE_UNQUOTED([VERSION_MAJOR], $ma
  AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [UST minor version number])
  AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [UST patchlevel version number])
  
 +version_name="Annedd'ale"
 +version_description="New type of beer, 100% from Quebec, flavored with sapin beaumier needles, with a touch of hops."
 +AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], [UST version name])
 +AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], [UST version description])
  
  # Checks for programs.
  AC_PROG_CC
@@@ -46,13 -42,45 +46,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])
@@@ -147,6 -175,7 +179,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" ;;
@@@ -283,10 -312,6 +316,10 @@@ AC_CONFIG_FILES(
  
  AC_OUTPUT
  
 +AS_ECHO()
 +AS_ECHO("Version name: $version_name")
 +AS_ECHO("$version_description")
 +
  # Report on the configuration options
  AS_ECHO()
  AS_ECHO("LTTng-UST will be built with the following options:")
index 9508e7664f8601e112017bf0746032cce6c2e84c,f1ef8c91ee7f6f52cf6e7105147e0317c2dbc7a2..65f502360372638749d6ed77fcaa2d55d91b4344
@@@ -4,30 -4,30 +4,31 @@@
  /*
   * lttng/ust-events.h
   *
 - * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * Copyright 2010-2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
   *
   * Holds LTTng per-session event registry.
   *
 - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
 - * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
 + * Permission is hereby granted, free of charge, to any person obtaining a copy
 + * of this software and associated documentation files (the "Software"), to deal
 + * in the Software without restriction, including without limitation the rights
 + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 + * copies of the Software, and to permit persons to whom the Software is
 + * furnished to do so, subject to the following conditions:
   *
 - * 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.
 + * The above copyright notice and this permission notice shall be included in
 + * all copies or substantial portions of the Software.
   */
  
  #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 <endian.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;
@@@ -84,7 -84,7 +85,7 @@@ struct lttng_enum_entry 
                  .size = sizeof(_type) * CHAR_BIT,             \
                  .alignment = lttng_alignof(_type) * CHAR_BIT, \
                  .signedness = lttng_is_signed_type(_type),    \
-                 .reverse_byte_order = _byte_order != __BYTE_ORDER,    \
+                 .reverse_byte_order = _byte_order != BYTE_ORDER,      \
                  .base = _base,                                \
                  .encoding = lttng_encode_##_encoding,         \
                },                                              \
@@@ -119,7 -119,7 +120,7 @@@ struct lttng_integer_type 
                                - _float_mant_dig(_type),       \
                  .mant_dig = _float_mant_dig(_type),           \
                  .alignment = lttng_alignof(_type) * CHAR_BIT, \
-                 .reverse_byte_order = __BYTE_ORDER != __FLOAT_WORD_ORDER, \
+                 .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \
                },                                              \
        }                                                       \
  
@@@ -354,7 -354,7 +355,7 @@@ struct ltt_channel 
        /* Channel ID, available for consumer too */
        unsigned int id;
        /* Copy of session UUID for consumer (availability through shm) */
-       uuid_t uuid;                    /* Trace session unique ID */
+       unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
  };
  
  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 */
-       uuid_t uuid;                    /* Trace session unique ID */
+       unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
        unsigned int metadata_dumped:1;
  };
  
diff --combined liblttng-ust/compat.h
index 19d4da828b67cc793b056a46933d3b332c74b870,004e60ace8d86771652405c2076f555969bd12d8..58d8585c4823eb16c7343d256777d770f6773100
@@@ -2,34 -2,63 +2,68 @@@
  #define _UST_COMPAT_H
  
  /*
 - * Copyright (C) 2011   Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * 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.
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
   *
 - * 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.
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
- #include <sys/syscall.h>
+ /*
+  * lttng_ust_getprocname.
+  */
+ #ifdef __linux__
+ #include <sys/prctl.h>
+ #define LTTNG_UST_PROCNAME_LEN 17
+ static inline
+ void lttng_ust_getprocname(char *name)
+ {
+       (void) prctl(PR_GET_NAME, (unsigned long) name, 0, 0, 0);
+ }
+ #elif defined(__FreeBSD__)
+ #include <stdlib.h>
+ #include <string.h>
  
- #ifdef __UCLIBC__
- #define __getcpu(cpu, node, cache)    syscall(__NR_getcpu, cpu, node, cache)
+ /*
+  * Limit imposed by Linux UST-sessiond ABI.
+  */
+ #define LTTNG_UST_PROCNAME_LEN 17
+ /*
+  * Acts like linux prctl, the string is not necessarily 0-terminated if
+  * 16-byte long.
+  */
  static inline
int sched_getcpu(void)
void lttng_ust_getprocname(char *name)
  {
-       int c, s;
+       const char *bsd_name;
  
-       s = __getcpu(&c, NULL, NULL);
-       return (s == -1) ? s : c;
+       bsd_name = getprogname();
+       if (!bsd_name)
+               name[0] = '\0';
+       memcpy(name, bsd_name, LTTNG_UST_PROCNAME_LEN - 1);
  }
- #endif        /* __UCLIBC__ */
+ #endif
+ #include <errno.h>
+ #ifndef ENODATA
+ #define ENODATA       ENOMSG
+ #endif
  #endif /* _UST_COMPAT_H */
index 1e058b206c066825f81358ad04724c408aa710c1,ac2b20f7938dbe8ff036b720d9be8427d6aba241..aafa126c47a064ff5e368af93236d7f66a4790d4
@@@ -1,32 -1,18 +1,30 @@@
  /*
   * ltt-events.c
   *
 - * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 - *
   * Holds LTTng per-session event registry.
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #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>
@@@ -34,7 -20,7 +32,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>
@@@ -48,6 -34,8 +46,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"
@@@ -56,8 -44,6 +56,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
@@@ -181,20 -167,20 +179,20 @@@ int add_pending_probe(struct ltt_event 
  {
        struct cds_hlist_head *head;
        struct ust_pending_probe *e;
 -      size_t name_len = strlen(name);
 +      size_t name_len = strlen(name) + 1;
        uint32_t hash;
  
 -      if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) {
 -              WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1);
 -              name_len = LTTNG_UST_SYM_NAME_LEN - 1;
 +      if (name_len > LTTNG_UST_SYM_NAME_LEN) {
 +              WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN);
 +              name_len = LTTNG_UST_SYM_NAME_LEN;
        }
 -      hash = jhash(name, name_len, 0);
 +      hash = jhash(name, name_len - 1, 0);
        head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)];
        e = zmalloc(sizeof(struct ust_pending_probe) + name_len);
        if (!e)
                return -ENOMEM;
 -      memcpy(&e->name[0], name, name_len + 1);
 -      e->name[name_len] = '\0';
 +      memcpy(&e->name[0], name, name_len);
 +      e->name[name_len - 1] = '\0';
        e->loglevel_type = loglevel_type;
        e->loglevel = loglevel;
        cds_hlist_add_head(&e->node, head);
@@@ -230,7 -216,7 +228,7 @@@ int pending_probe_fix_events(const stru
        const char *name = desc->name;
        int ret = 0;
        struct lttng_ust_event event_param;
 -      size_t name_len = strlen(name);
 +      size_t name_len = strlen(name) + 1;
        uint32_t hash;
  
        /* Wildcard */
                }
        }
  
 -      if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) {
 -              WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1);
 -              name_len = LTTNG_UST_SYM_NAME_LEN - 1;
 +      if (name_len > LTTNG_UST_SYM_NAME_LEN) {
 +              WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN);
 +              name_len = LTTNG_UST_SYM_NAME_LEN;
        }
 -      hash = jhash(name, name_len, 0);
 +      hash = jhash(name, name_len - 1, 0);
        head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)];
        cds_hlist_for_each_entry_safe(e, node, p, head, node) {
                struct ltt_event *event;
@@@ -309,6 -295,7 +307,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;
  }
@@@ -1088,7 -1078,7 +1090,7 @@@ uint64_t measure_clock_offset(void
                return 0;
        monotonic[1] = trace_clock_read64();
        offset = (monotonic[0] + monotonic[1]) >> 1;
 -      realtime = rts.tv_sec * 1000000000ULL;
 +      realtime = (uint64_t) rts.tv_sec * 1000000000ULL;
        realtime += rts.tv_nsec;
        offset = realtime - offset;
        return offset;
@@@ -1101,11 -1091,12 +1103,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"
@@@ -1356,8 -1347,6 +1359,8 @@@ struct session_wildcard *add_wildcard(s
                if (!e)
                        return ERR_PTR(-ENOMEM);
                memcpy(&e->name[0], event_param->name, name_len);
 +              e->loglevel_type = event_param->loglevel_type;
 +              e->loglevel = event_param->loglevel;
                cds_list_add(&e->list, &wildcard_list);
                CDS_INIT_LIST_HEAD(&e->session_list);
        }
@@@ -1478,7 -1467,7 +1481,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 d64af55503994038cce8f0ffc510996bc4d483e8,cedbc31d94a819e13f9e11cea68621b99bda66f3..f18b4ed387cdf876dffebd4ae41b7a808b57b55d
@@@ -1,29 -1,18 +1,30 @@@
  /*
   * ltt-ring-buffer-client.h
   *
 - * Copyright (C) 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 - *
   * LTTng lib ring buffer client template.
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include <stdint.h>
  #include <lttng/ust-events.h>
  #include "lttng/bitfield.h"
  #include "clock.h"
+ #include "lttng-ust-uuid.h"
  #include "ltt-tracer.h"
  #include "../libringbuffer/frontend_types.h"
  
@@@ -43,7 -32,7 +44,7 @@@ struct packet_header 
                                         * Trace magic number.
                                         * contains endianness information.
                                         */
-       uint8_t uuid[16];
+       uint8_t uuid[LTTNG_UST_UUID_LEN];
        uint32_t stream_id;
  
        struct {
@@@ -366,8 -355,11 +367,8 @@@ static void client_buffer_end(struct lt
        header->ctx.timestamp_end = tsc;
        header->ctx.content_size = data_size * CHAR_BIT;        /* in bits */
        header->ctx.packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */
 -      /*
 -       * We do not care about the records lost count, because the metadata
 -       * channel waits and retry.
 -       */
 -      (void) lib_ring_buffer_get_records_lost_full(&client_config, buf);
 +
 +      records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf);
        records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf);
        records_lost += lib_ring_buffer_get_records_lost_big(&client_config, buf);
        header->ctx.events_discarded = records_lost;
index 1e18df9d33a14fa4dd3969faf5bd17f4d9d0477b,dcbaacb61c1c1d583473ed367d4396e5de72bea9..acc56fddb890d172b8e2386977df7ce56f501adb
@@@ -1,23 -1,11 +1,23 @@@
  /*
   * ltt-ring-buffer-client.h
   *
 - * Copyright (C) 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 - *
   * LTTng lib ring buffer client template.
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include <stdint.h>
@@@ -28,7 -16,7 +28,7 @@@
  
  struct metadata_packet_header {
        uint32_t magic;                 /* 0x75D11D57 */
-       uint8_t  uuid[16];              /* Unique Universal Identifier */
+       uint8_t  uuid[LTTNG_UST_UUID_LEN]; /* Unique Universal Identifier */
        uint32_t checksum;              /* 0 if unused */
        uint32_t content_size;          /* in bits */
        uint32_t packet_size;           /* in bits */
@@@ -131,11 -119,7 +131,11 @@@ static void client_buffer_end(struct lt
  
        header->content_size = data_size * CHAR_BIT;            /* in bits */
        header->packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */
 -      records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf);
 +      /*
 +       * We do not care about the records lost count, because the metadata
 +       * channel waits and retry.
 +       */
 +      (void) lib_ring_buffer_get_records_lost_full(&client_config, buf);
        records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf);
        records_lost += lib_ring_buffer_get_records_lost_big(&client_config, buf);
        WARN_ON_ONCE(records_lost != 0);
index caf86a95b65a509cb650e43a8c2ce10691d31dee,b737084bf69aae013cee43c11e7ffa3484067ce5..d165be88277daada8bbb616c2db60572050f9aa2
@@@ -1,32 -1,17 +1,30 @@@
  /*
 - * (C) Copyright      2009-2011 -
 - *            Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * lttng-context-procname.c
   *
   * LTTng UST procname context.
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * Copyright (C) 2009-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
- #include <sys/prctl.h>
  #include <lttng/ust-events.h>
  #include <lttng/ust-tracer.h>
  #include <lttng/ringbuffer-config.h>
  #include <assert.h>
- #define PROCNAME_LEN  17      /* includes \0 */
+ #include "compat.h"
  
  /*
   * We cache the result to ensure we don't trigger a system call for
@@@ -39,12 -24,9 +37,9 @@@ static char cached_procname[17]
  static inline
  char *wrapper_getprocname(void)
  {
-       int ret;
        if (caa_unlikely(!cached_procname[0])) {
-               ret = prctl(PR_GET_NAME, (unsigned long) cached_procname,
-                       0, 0, 0);
-               assert(!ret);
+               lttng_ust_getprocname(cached_procname);
+               cached_procname[LTTNG_UST_PROCNAME_LEN - 1] = '\0';
        }
        return cached_procname;
  }
@@@ -59,7 -41,7 +54,7 @@@ size_t procname_get_size(size_t offset
  {
        size_t size = 0;
  
-       size += PROCNAME_LEN;
+       size += LTTNG_UST_PROCNAME_LEN;
        return size;
  }
  
@@@ -71,7 -53,7 +66,7 @@@ void procname_record(struct lttng_ctx_f
        char *procname;
  
        procname = wrapper_getprocname();
-       chan->ops->event_write(ctx, procname, PROCNAME_LEN);
+       chan->ops->event_write(ctx, procname, LTTNG_UST_PROCNAME_LEN);
  }
  
  int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
@@@ -94,7 -76,7 +89,7 @@@
        field->event_field.type.u.array.elem_type.u.basic.integer.reverse_byte_order = 0;
        field->event_field.type.u.array.elem_type.u.basic.integer.base = 10;
        field->event_field.type.u.array.elem_type.u.basic.integer.encoding = lttng_encode_UTF8;
-       field->event_field.type.u.array.length = PROCNAME_LEN;
+       field->event_field.type.u.array.length = LTTNG_UST_PROCNAME_LEN;
        field->get_size = procname_get_size;
        field->record = procname_record;
        return 0;
index d5664c951cf708ff2b7ac6e9be4ca3b61fbbe87b,c419d18b3ede7db666d2c5ea3cada82df6dafcbd..81508515ba56c3dee817c92f34b4c5513a3df444
@@@ -1,23 -1,10 +1,23 @@@
  /*
 - * (C) Copyright      2009-2011 -
 - *            Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * lttng-context-vtid.c
   *
   * LTTng UST vtid context.
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * Copyright (C) 2009-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include <sys/types.h>
  #include <lttng/ust-events.h>
  #include <lttng/ust-tracer.h>
  #include <lttng/ringbuffer-config.h>
+ #include <lttng/ust-tid.h>
  #include "ltt-tracer-core.h"
  
- #ifdef __linux__
- #include <syscall.h>
- #endif
- #if defined(_syscall0)
- _syscall0(pid_t, gettid)
- #elif defined(__NR_gettid)
- static inline pid_t gettid(void)
- {
-       return syscall(__NR_gettid);
- }
- #else
- #warning "use pid as tid"
- static inline pid_t gettid(void)
- {
-       return getpid();
- }
- #endif
  /*
   * We cache the result to ensure we don't trigger a system call for
   * each event.
index e3afe6af562cb8a22207ca90210b3450b8d2453d,1815801a8fe08a06df22b6d1614efc969ca75b4d..099a6c85f1959ddc98e1cde72059f64d5cecaa42
@@@ -22,7 -22,6 +22,6 @@@
  #define _LGPL_SOURCE
  #include <sys/types.h>
  #include <sys/socket.h>
- #include <sys/prctl.h>
  #include <sys/mman.h>
  #include <sys/stat.h>
  #include <sys/types.h>
@@@ -46,6 -45,7 +45,7 @@@
  #include <usterr-signal-safe.h>
  #include "tracepoint-internal.h"
  #include "ltt-tracer-core.h"
+ #include "compat.h"
  #include "../libringbuffer/tlsfixup.h"
  
  /*
@@@ -160,7 -160,6 +160,6 @@@ stati
  int register_app_to_sessiond(int socket)
  {
        ssize_t ret;
-       int prctl_ret;
        struct {
                uint32_t major;
                uint32_t minor;
        reg_msg.uid = getuid();
        reg_msg.gid = getgid();
        reg_msg.bits_per_long = CAA_BITS_PER_LONG;
-       prctl_ret = prctl(PR_GET_NAME, (unsigned long) reg_msg.name, 0, 0, 0);
-       if (prctl_ret) {
-               ERR("Error executing prctl");
-               return -errno;
-       }
+       lttng_ust_getprocname(reg_msg.name);
  
        ret = ustcomm_send_unix_sock(socket, &reg_msg, sizeof(reg_msg));
        if (ret >= 0 && ret != sizeof(reg_msg))
@@@ -396,7 -391,7 +391,7 @@@ void cleanup_sock_info(struct sock_inf
        int ret;
  
        if (sock_info->socket != -1) {
 -              ret = close(sock_info->socket);
 +              ret = ustcomm_close_unix_sock(sock_info->socket);
                if (ret) {
                        ERR("Error closing apps socket");
                }
@@@ -676,7 -671,7 +671,7 @@@ restart
        }
  
        if (sock_info->socket != -1) {
 -              ret = close(sock_info->socket);
 +              ret = ustcomm_close_unix_sock(sock_info->socket);
                if (ret) {
                        ERR("Error closing %s apps socket", sock_info->name);
                }
index 373e3147e383c143dc7273253d584f922a421a50,c9ed81be0e5b5c559ba8de23846a6052ecc8ddea..050c98ac530dfc34f267ff9f23cb9bf8db84bbfd
@@@ -1,26 -1,14 +1,26 @@@
 -#ifndef _LINUX_RING_BUFFER_BACKEND_INTERNAL_H
 -#define _LINUX_RING_BUFFER_BACKEND_INTERNAL_H
 +#ifndef _LTTNG_RING_BUFFER_BACKEND_INTERNAL_H
 +#define _LTTNG_RING_BUFFER_BACKEND_INTERNAL_H
  
  /*
 - * linux/ringbuffer/backend_internal.h
 - *
 - * Copyright (C) 2008-2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * libringbuffer/backend_internal.h
   *
   * Ring buffer backend (internal helpers).
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * Copyright (C) 2005-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include <unistd.h>
@@@ -448,7 -436,7 +448,7 @@@ do {                                                               
  
  /* arch-agnostic implementation */
  
- static inline int fls(unsigned int x)
+ static inline int lttng_ust_fls(unsigned int x)
  {
        int r = 32;
  
@@@ -481,10 -469,26 +481,10 @@@ static inline int get_count_order(unsig
  {
        int order;
  
-       order = fls(count) - 1;
+       order = lttng_ust_fls(count) - 1;
        if (count & (count - 1))
                order++;
        return order;
  }
  
 -static inline
 -unsigned int hweight32(unsigned int value)
 -{
 -      unsigned int r;
 -
 -      r = value;
 -      r = r - ((r >> 1) & 0x55555555);
 -      r = (r & 0x33333333) + ((r >> 2) & 0x33333333);
 -      r += r >> 4;
 -      r &= 0x0F0F0F0F;
 -      r += r >> 8;
 -      r += r >> 16;
 -      r &= 0x000000FF;
 -      return r;
 -}
 -
 -#endif /* _LINUX_RING_BUFFER_BACKEND_INTERNAL_H */
 +#endif /* _LTTNG_RING_BUFFER_BACKEND_INTERNAL_H */
diff --combined libringbuffer/getcpu.h
index 44d0d5594f04641029bb70116d6784b8f8ef0ff0,3474bfe0c04f9f218eac190b001b08600f9d8272..0a61941728a5de814ca5e5339d30fa945d3ed9fc
@@@ -20,9 -20,8 +20,8 @@@
   */
  
  #include <urcu/compiler.h>
- #include <sched.h>
  
 -#ifdef UST_VALGRIND
 +#ifdef LTTNG_UST_DEBUG_VALGRIND
  
  /*
   * Fallback on cpu 0 if liblttng-ust is build with Valgrind support.
@@@ -37,6 -36,30 +36,30 @@@ int lttng_ust_get_cpu(void
  
  #else
  
+ /*
+  * sched_getcpu.
+  */
+ #ifdef __linux__
+ #ifdef __UCLIBC__
+ #include <sys/syscall.h>
+ #define __getcpu(cpu, node, cache)    syscall(__NR_getcpu, cpu, node, cache)
+ /*
+  * If getcpu is not implemented in the kernel, use cpu 0 as fallback.
+  */
+ static inline
+ int lttng_ust_get_cpu(void)
+ {
+       int cpu, ret;
+       ret = __getcpu(&cpu, NULL, NULL);
+       if (caa_unlikely(ret < 0))
+               return 0;
+       return c;
+ }
+ #else /* __UCLIBC__ */
+ #include <sched.h>
  /*
   * If getcpu is not implemented in the kernel, use cpu 0 as fallback.
   */
@@@ -50,6 -73,23 +73,23 @@@ int lttng_ust_get_cpu(void
                return 0;
        return cpu;
  }
+ #endif        /* __UCLIBC__ */
+ #elif defined(__FreeBSD__)
+ /*
+  * FreeBSD does not allow query of CPU ID. Always use CPU number 0, with
+  * the assocated performance degradation on SMP.
+  */
+ static inline
+ int lttng_ust_get_cpu(void)
+ {
+       return 0;
+ }
+ #else
+ #error "Please add support for your OS into liblttng-ust/compat.h."
+ #endif
  
  #endif
  
index 5913f78d70a899fa78fd2409aded4f10723686b9,728cbf9b72665036ccc0e275b9249cb00e591a01..d1704dbf2e0f2b6fa75e400ee534e901970f91d1
@@@ -1,22 -1,7 +1,22 @@@
  /*
   * ring_buffer_frontend.c
   *
 - * (C) Copyright 2005-2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * Copyright (C) 2005-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 + *
   *
   * Ring buffer wait-free buffer synchronization. Producer-consumer and flight
   * recorder (overwrite) modes. See thesis:
@@@ -49,6 -34,8 +49,6 @@@
   *   - splice one subbuffer worth of data to a pipe
   *   - splice the data from pipe to disk/network
   *   - put_subbuf
 - *
 - * Dual LGPL v2.1/GPL v2 license.
   */
  
  #define _GNU_SOURCE
@@@ -67,6 -54,7 +67,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))
diff --combined libringbuffer/shm.c
index e9fe12ec8853400051672ef89b6480995458fee8,c10e58a23cc281fb06128c93d16697efc2d0b019..d1e50449678f7e6092e2a9d37c3279f767f51aa7
@@@ -1,21 -1,9 +1,21 @@@
  /*
   * libringbuffer/shm.c
   *
 - * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 + * Copyright (C) 2005-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
   *
 - * Dual LGPL v2.1/GPL v2 license.
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; only
 + * version 2.1 of the License.
 + *
 + * This library 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
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include "shm.h"
@@@ -48,7 -36,7 +48,7 @@@ struct shm_object *shm_object_table_app
        int shmfd, waitfd[2], ret, i, sigblocked = 0;
        struct shm_object *obj;
        char *memory_map;
-       char tmp_name[NAME_MAX] = "ust-shm-tmp-XXXXXX";
+       char tmp_name[NAME_MAX] = "/ust-shm-tmp-XXXXXX";
        sigset_t all_sigs, orig_sigs;
  
        if (table->allocated_len >= table->size)
index 57c025ee15e59081cadf0d2c401e0059f7b0fa46,0705a48c5975f3934229ec02ae1edc6846ae4a7d..004974b53d6080fea71732657391a0003af2febf
@@@ -4,18 -4,18 +4,18 @@@
   * Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
   * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
   *
 - * 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; version 2 of the License only.
   *
 - * 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.,
 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   */
  
  #define _LARGEFILE64_SOURCE
@@@ -42,6 -42,7 +42,7 @@@
  #include <ust-comm.h>
  #include "../../libringbuffer/backend.h"
  #include "../../libringbuffer/frontend.h"
+ #include "../../liblttng-ust/compat.h"        /* For ENODATA */
  
  #define MAX_NR_STREAMS        64
  #define MAX_NR_EVENTS 128
@@@ -222,7 -223,7 +223,7 @@@ int consume_stream(struct lttng_ust_shm
        }
  
        /* copy */
-       outfd = open(outfile, O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC,
+       outfd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC,
                        S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
        if (outfd < 0) {
                perror("open output");
index f2deefa40158c0f7d78bbac18fe01e30b7605625,dc91b847e39abbc5a210eb3a318c8c990d0f1425..3f0cf1d565cfc21b674da14e9fbedec26b5e5e12
@@@ -4,18 -4,18 +4,18 @@@
   * Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
   * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
   *
 - * 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; version 2 of the License only.
   *
 - * 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.,
 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   */
  
  #define _LARGEFILE64_SOURCE
@@@ -42,6 -42,7 +42,7 @@@
  #include <ust-comm.h>
  #include <../../libringbuffer/backend.h>
  #include <../../libringbuffer/frontend.h>
+ #include "../../liblttng-ust/compat.h"        /* For ENODATA */
  
  #define NR_SESSIONS   4
  #define NR_CHANNELS   1
@@@ -229,7 -230,7 +230,7 @@@ int consume_stream(struct lttng_ust_shm
        }
  
        /* copy */
-       outfd = open(outfile, O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC,
+       outfd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC,
                        S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
        if (outfd < 0) {
                perror("open output");
This page took 0.044864 seconds and 4 git commands to generate.