Skip to content

Commit f9aea91

Browse files
committed
tracing: Fix C type errors in librados tracing
This fixes type errors like this: In file included from /usr/include/lttng/tracepoint-event.h:69, from …-build/include/tracing/librados.h:4143, from …/src/tracing/librados.c:6 : …-build/include/tracing/librados.h: In function ‘lttng_ust__event_probe__librados___rados_mon_command_exit’: …-build/include/tracing/librados.h:477:9: error: initialization of ‘size_t’ {aka ‘long unsigned int’} from ‘size_t *’ {aka ‘long unsigned int *’} makes integer from pointer without a cast 477 | ceph_ctf_integerp(size_t, outslen, outslen) | ^~~~~~~~~~~~~~~~~ GCC 14 will likely treat these type mismatches as an error and fail the build. Signed-off-by: Florian Weimer <[email protected]>
1 parent e33ea91 commit f9aea91

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/tracing/librados.tp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@ TRACEPOINT_EVENT(librados, rados_watch3_enter,
26282628
TP_FIELDS(
26292629
ctf_integer_hex(rados_ioctx_t, ioctx, ioctx)
26302630
ctf_string(oid, oid)
2631-
ctf_integer_hex(uint64_t, phandle, phandle)
2631+
ctf_integer_hex(uint64_t*, phandle, phandle)
26322632
ctf_integer_hex(rados_watchcb2_t, callback, callback)
26332633
ctf_integer(uint32_t, timeout, timeout)
26342634
ctf_integer_hex(void*, arg, arg)
@@ -2658,7 +2658,7 @@ TRACEPOINT_EVENT(librados, rados_aio_watch2_enter,
26582658
ctf_integer_hex(rados_ioctx_t, ioctx, ioctx)
26592659
ctf_string(oid, oid)
26602660
ctf_integer_hex(rados_completion_t, completion, completion)
2661-
ctf_integer_hex(uint64_t, phandle, phandle)
2661+
ctf_integer_hex(uint64_t*, phandle, phandle)
26622662
ctf_integer_hex(rados_watchcb2_t, callback, callback)
26632663
ctf_integer(uint32_t, timeout, timeout)
26642664
ctf_integer_hex(void*, arg, arg)

src/tracing/tracing-common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// type should be an integer type
2222
// val should have type type*
2323
#define ceph_ctf_integerp(type, field, val) \
24-
ctf_integer(type, field, (val) == NULL ? 0 : (val)) \
24+
ctf_integer(type, field, (val) == NULL ? 0 : *(val)) \
2525
ctf_integer(uint8_t, field##_isnull, (val) == NULL)
2626

2727
// val should have type char*

0 commit comments

Comments
 (0)