]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tracing: Fix C type errors in librados tracing
authorFlorian Weimer <fweimer@redhat.com>
Wed, 20 Dec 2023 13:16:19 +0000 (14:16 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 8 Jan 2024 11:02:38 +0000 (12:02 +0100)
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 <fweimer@redhat.com>
src/tracing/librados.tp
src/tracing/tracing-common.h

index 8b5e78ef15d65410131ac0d4cbdfe8564660bbdc..8e116124b83d5938fa710887bc12f3da4c8c99d0 100644 (file)
@@ -2628,7 +2628,7 @@ TRACEPOINT_EVENT(librados, rados_watch3_enter,
     TP_FIELDS(
         ctf_integer_hex(rados_ioctx_t, ioctx, ioctx)
         ctf_string(oid, oid)
-        ctf_integer_hex(uint64_t, phandle, phandle)
+        ctf_integer_hex(uint64_t*, phandle, phandle)
         ctf_integer_hex(rados_watchcb2_t, callback, callback)
         ctf_integer(uint32_t, timeout, timeout)
         ctf_integer_hex(void*, arg, arg)
@@ -2658,7 +2658,7 @@ TRACEPOINT_EVENT(librados, rados_aio_watch2_enter,
         ctf_integer_hex(rados_ioctx_t, ioctx, ioctx)
         ctf_string(oid, oid)
         ctf_integer_hex(rados_completion_t, completion, completion)
-        ctf_integer_hex(uint64_t, phandle, phandle)
+        ctf_integer_hex(uint64_t*, phandle, phandle)
         ctf_integer_hex(rados_watchcb2_t, callback, callback)
         ctf_integer(uint32_t, timeout, timeout)
         ctf_integer_hex(void*, arg, arg)
index 3e07f9de8e85cef6f26c645170a2696355dcdf6b..03449ab588615a2e77a8dc1a4273984fce77fb3e 100644 (file)
@@ -21,7 +21,7 @@
 // type should be an integer type
 // val should have type type*
 #define ceph_ctf_integerp(type, field, val) \
-    ctf_integer(type, field, (val) == NULL ? 0 : (val)) \
+    ctf_integer(type, field, (val) == NULL ? 0 : *(val)) \
     ctf_integer(uint8_t, field##_isnull, (val) == NULL)
 
 // val should have type char*