Migrate tracepoint instrumentation to TP_FIELDS
[lttng-modules.git] / instrumentation / events / lttng-module / random.h
index 910ea9149b133555a34f56aa47e1c62941e8f673..32737291a85510b32ce961ff17690a31dafe98c4 100644 (file)
@@ -12,20 +12,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(random__mix_pool_bytes,
 
        TP_ARGS(pool_name, bytes, IP),
 
-       TP_STRUCT__entry(
-               __string(   pool_name,  pool_name               )
-               __field(          int,  bytes                   )
-               __field(unsigned long,  IP                      )
-       ),
-
-       TP_fast_assign(
-               tp_strcpy(pool_name, pool_name)
-               tp_assign(bytes, bytes)
-               tp_assign(IP, IP)
-       ),
-
-       TP_printk("%s pool: bytes %d caller %pF",
-                 __get_str(pool_name), __entry->bytes, (void *)__entry->IP)
+       TP_FIELDS(
+               ctf_string(pool_name, pool_name)
+               ctf_integer(int, bytes, bytes)
+               ctf_integer(unsigned long, IP, IP)
+       )
 )
 
 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__mix_pool_bytes, mix_pool_bytes,
@@ -55,26 +46,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(credit_entropy_bits,
 
        TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP),
 
-       TP_STRUCT__entry(
-               __string(   pool_name,  pool_name               )
-               __field(          int,  bits                    )
-               __field(          int,  entropy_count           )
-               __field(          int,  entropy_total           )
-               __field(unsigned long,  IP                      )
-       ),
-
-       TP_fast_assign(
-               tp_strcpy(pool_name, pool_name)
-               tp_assign(bits, bits)
-               tp_assign(entropy_count, entropy_count)
-               tp_assign(entropy_total, entropy_total)
-               tp_assign(IP, IP)
-       ),
-
-       TP_printk("%s pool: bits %d entropy_count %d entropy_total %d "
-                 "caller %pF", __get_str(pool_name), __entry->bits,
-                 __entry->entropy_count, __entry->entropy_total,
-                 (void *)__entry->IP)
+       TP_FIELDS(
+               ctf_string(pool_name, pool_name)
+               ctf_integer(int, bits, bits)
+               ctf_integer(int, entropy_count, entropy_count)
+               ctf_integer(int, entropy_total, entropy_total)
+               ctf_integer(unsigned long, IP, IP)
+       )
 )
 
 LTTNG_TRACEPOINT_EVENT_MAP(get_random_bytes,
@@ -85,17 +63,10 @@ LTTNG_TRACEPOINT_EVENT_MAP(get_random_bytes,
 
        TP_ARGS(nbytes, IP),
 
-       TP_STRUCT__entry(
-               __field(          int,  nbytes                  )
-               __field(unsigned long,  IP                      )
-       ),
-
-       TP_fast_assign(
-               tp_assign(nbytes, nbytes)
-               tp_assign(IP, IP)
-       ),
-
-       TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP)
+       TP_FIELDS(
+               ctf_integer(int, nbytes, nbytes)
+               ctf_integer(unsigned long, IP, IP)
+       )
 )
 
 LTTNG_TRACEPOINT_EVENT_CLASS(random__extract_entropy,
@@ -104,23 +75,12 @@ LTTNG_TRACEPOINT_EVENT_CLASS(random__extract_entropy,
 
        TP_ARGS(pool_name, nbytes, entropy_count, IP),
 
-       TP_STRUCT__entry(
-               __string(   pool_name,  pool_name               )
-               __field(          int,  nbytes                  )
-               __field(          int,  entropy_count           )
-               __field(unsigned long,  IP                      )
-       ),
-
-       TP_fast_assign(
-               tp_strcpy(pool_name, pool_name)
-               tp_assign(nbytes, nbytes)
-               tp_assign(entropy_count, entropy_count)
-               tp_assign(IP, IP)
-       ),
-
-       TP_printk("%s pool: nbytes %d entropy_count %d caller %pF",
-                 __get_str(pool_name), __entry->nbytes, __entry->entropy_count,
-                 (void *)__entry->IP)
+       TP_FIELDS(
+               ctf_string(pool_name, pool_name)
+               ctf_integer(int, nbytes, nbytes)
+               ctf_integer(int, entropy_count, entropy_count)
+               ctf_integer(unsigned long, IP, IP)
+       )
 )
 
 
This page took 0.024258 seconds and 4 git commands to generate.