]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
lttng: Default to not storing buffer content
authorAdam Crume <adamcrume@gmail.com>
Mon, 21 Jul 2014 22:35:32 +0000 (15:35 -0700)
committerAdam Crume <adamcrume@gmail.com>
Wed, 13 Aug 2014 20:58:18 +0000 (13:58 -0700)
Signed-off-by: Adam Crume <adamcrume@gmail.com>
src/tracing/tracing-common.h

index d6c0c417e6bbe1cf41e39fa06b7db544d862ea56..cb7a13e37bb51f1447b0ac675e4796a87b24328a 100644 (file)
@@ -1,7 +1,11 @@
 #if !defined(TRACING_COMMON_H)
 #define TRACING_COMMON_H
 
-#define CEPH_TRACE_BUF_TRUNC_LEN 32
+// Amount of buffer data to dump when using ceph_ctf_sequence or ceph_ctf_sequencep.
+// If 0, then *_data field is omitted entirely.
+#if !defined(CEPH_TRACE_BUF_TRUNC_LEN)
+#define CEPH_TRACE_BUF_TRUNC_LEN 0
+#endif
 
 // TODO: This is GCC-specific.  Replace CEPH_MAX and CEPH_MIN with standard macros, if possible.
 #define CEPH_MAX(a,b) \
 
 // val should have type type*
 // lenval should have type lentype
+#if CEPH_TRACE_BUF_TRUNC_LEN > 0
 #define ceph_ctf_sequence(type, field, val, lentype, lenval) \
     ctf_integer_hex(void*, field, val) \
     ctf_sequence(type, field##_data, (val) == NULL ? "" : (val), lentype, (val) == NULL ? 0 : CEPH_MIN((lenval), CEPH_TRACE_BUF_TRUNC_LEN)) \
     ctf_integer(uint8_t, field##_isnull, (val) == NULL) \
     ctf_integer(lentype, field##_len, lenval)
+#else
+#define ceph_ctf_sequence(type, field, val, lentype, lenval) \
+    ctf_integer_hex(void*, field, val) \
+    ctf_integer(uint8_t, field##_isnull, (val) == NULL) \
+    ctf_integer(lentype, field##_len, lenval)
+#endif
 
 // val should have type type**
 // lenval should have type lentype*
+#if CEPH_TRACE_BUF_TRUNC_LEN > 0
 #define ceph_ctf_sequencep(type, field, val, lentype, lenval) \
     ctf_integer_hex(void*, field, val) \
     ctf_sequence(type, \
     ctf_integer(uint8_t, field##_data_isnull, ((val) == NULL || *(val) == NULL)) \
     ctf_integer(lentype, field##_len, (lenval) == NULL ? 0 : *(lenval)) \
     ctf_integer(lentype, field##_len_isnull, (lenval) == NULL)
+#else
+#define ceph_ctf_sequencep(type, field, val, lentype, lenval) \
+    ctf_integer_hex(void*, field, val) \
+    ctf_integer(uint8_t, field##_isnull, (val) == NULL) \
+    ctf_integer(uint8_t, field##_data_isnull, ((val) == NULL || *(val) == NULL)) \
+    ctf_integer(lentype, field##_len, (lenval) == NULL ? 0 : *(lenval)) \
+    ctf_integer(lentype, field##_len_isnull, (lenval) == NULL)
+#endif
 
 // p should be of type struct timeval*
 #define ceph_ctf_timevalp(field, p) \