X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Flttng%2Fust-tracepoint-event.h;h=d12afa0b84ea35f936407ac380eab216fdee3b6d;hb=879f9b0aa0c9a8ee31ba47bfaaf6539ef2e349b2;hp=fc327a689d1b777ce57a4f5e26d6faed69e07d2b;hpb=a2e4d05e924d4cb02b47430c2d0f39e6a6a89720;p=lttng-ust.git diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index fc327a68..d12afa0b 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -703,7 +704,10 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, \ _encoding, _nowrite, _elem_type_base) \ lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ - __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); + if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \ + __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \ + else \ + __chan->ops->event_pstrcpy_pad(&__ctx, (const char *) (_src), _length); \ #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type, \ @@ -714,8 +718,11 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\ } \ lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ - __chan->ops->event_write(&__ctx, _src, \ - sizeof(_type) * __get_dynamic_len(dest)); + if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \ + __chan->ops->event_write(&__ctx, _src, \ + sizeof(_type) * __get_dynamic_len(dest)); \ + else \ + __chan->ops->event_pstrcpy_pad(&__ctx, (const char *) (_src), __get_dynamic_len(dest)); \ #undef _ctf_string #define _ctf_string(_item, _src, _nowrite) \ @@ -766,11 +773,11 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define _TP_IP_PARAM(x) (x) #else /* TP_IP_PARAM */ -#if defined(__PPC__) && !defined(__PPC64__) +#if defined(LTTNG_UST_ARCH_PPC) && !defined(LTTNG_UST_ARCH_PPC64) #define _TP_IP_PARAM(x) NULL -#else /* #if defined(__PPC__) && !defined(__PPC64__) */ +#else #define _TP_IP_PARAM(x) __builtin_return_address(0) -#endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */ +#endif #endif /* TP_IP_PARAM */