Add UST_DEBUG env. var. support
[lttng-ust.git] / libust / buffers.c
index c8976c7841834e82bd8fae53e0dbe8ca2783d51b..c4eddb068cdb72d0ba4855b1eafcbd350c91913b 100644 (file)
@@ -7,8 +7,8 @@
  *
  * 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; either
- * version 2.1 of the License, or (at your option) any later version.
+ * License as published by the Free Software Foundation; 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
@@ -22,7 +22,9 @@
 
 /*
  * Note: this code does not support the ref/noref flag and reader-owned
- * subbuffer scheme needed for flight recorder mode.
+ * subbuffer scheme. Therefore, flight recorder mode uses a mechanism
+ * where the reader can read corrupted data (and detect this), thus
+ * returning -EIO.
  */
 
 #include <unistd.h>
@@ -53,31 +55,6 @@ static CDS_LIST_HEAD(ust_buffers_channels);
 static void ltt_force_switch(struct ust_buffer *buf,
                enum force_switch_mode mode);
 
-static int get_n_cpus(void)
-{
-       int result;
-       static int n_cpus = 0;
-
-       if(!n_cpus) {
-               /* On Linux, when some processors are offline
-                * _SC_NPROCESSORS_CONF counts the offline
-                * processors, whereas _SC_NPROCESSORS_ONLN
-                * does not. If we used _SC_NPROCESSORS_ONLN,
-                * getcpu() could return a value greater than
-                * this sysconf, in which case the arrays
-                * indexed by processor would overflow.
-                */
-               result = sysconf(_SC_NPROCESSORS_CONF);
-               if(result == -1) {
-                       return -1;
-               }
-
-               n_cpus = result;
-       }
-
-       return n_cpus;
-}
-
 /**
  * _ust_buffers_strncpy_fixup - Fix an incomplete string in a ltt_relay buffer.
  * @buf : buffer
@@ -1079,6 +1056,7 @@ static char initialized = 0;
 
 void __attribute__((constructor)) init_ustrelay_transport(void)
 {
+       init_usterr();
        if(!initialized) {
                ltt_transport_register(&ust_relay_transport);
                initialized = 1;
This page took 0.024207 seconds and 4 git commands to generate.