From 4109879f4e96da671c06a70e85fb4ecfb485d4b9 Mon Sep 17 00:00:00 2001 From: Adam Crume Date: Mon, 21 Jul 2014 15:35:32 -0700 Subject: [PATCH] lttng: Default to not storing buffer content Signed-off-by: Adam Crume --- src/tracing/tracing-common.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/tracing/tracing-common.h b/src/tracing/tracing-common.h index d6c0c417e6b..cb7a13e37bb 100644 --- a/src/tracing/tracing-common.h +++ b/src/tracing/tracing-common.h @@ -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) \ @@ -33,14 +37,22 @@ // 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, \ @@ -52,6 +64,14 @@ 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) \