#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) \