2 #define TRACE_SYSTEM random
4 #if !defined(_TRACE_RANDOM_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_RANDOM_H
7 #include <linux/writeback.h>
8 #include <linux/tracepoint.h>
10 DECLARE_EVENT_CLASS(random__mix_pool_bytes,
11 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
13 TP_ARGS(pool_name, bytes, IP),
16 __string( pool_name, pool_name )
18 __field(unsigned long, IP )
22 tp_strcpy(pool_name, pool_name)
23 tp_assign(bytes, bytes)
27 TP_printk("%s pool: bytes %d caller %pF",
28 __get_str(pool_name), __entry->bytes, (void *)__entry->IP)
31 DEFINE_EVENT_MAP(random__mix_pool_bytes, mix_pool_bytes,
33 random_mix_pool_bytes,
35 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
37 TP_ARGS(pool_name, bytes, IP)
40 DEFINE_EVENT_MAP(random__mix_pool_bytes, mix_pool_bytes_nolock,
42 random_mix_pool_bytes_nolock,
44 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
46 TP_ARGS(pool_name, bytes, IP)
49 TRACE_EVENT_MAP(credit_entropy_bits,
51 random_credit_entropy_bits,
53 TP_PROTO(const char *pool_name, int bits, int entropy_count,
54 int entropy_total, unsigned long IP),
56 TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP),
59 __string( pool_name, pool_name )
61 __field( int, entropy_count )
62 __field( int, entropy_total )
63 __field(unsigned long, IP )
67 tp_strcpy(pool_name, pool_name)
69 tp_assign(entropy_count, entropy_count)
70 tp_assign(entropy_total, entropy_total)
74 TP_printk("%s pool: bits %d entropy_count %d entropy_total %d "
75 "caller %pF", __get_str(pool_name), __entry->bits,
76 __entry->entropy_count, __entry->entropy_total,
80 TRACE_EVENT_MAP(get_random_bytes,
82 random_get_random_bytes,
84 TP_PROTO(int nbytes, unsigned long IP),
89 __field( int, nbytes )
90 __field(unsigned long, IP )
94 tp_assign(nbytes, nbytes)
98 TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP)
101 DECLARE_EVENT_CLASS(random__extract_entropy,
102 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
105 TP_ARGS(pool_name, nbytes, entropy_count, IP),
108 __string( pool_name, pool_name )
109 __field( int, nbytes )
110 __field( int, entropy_count )
111 __field(unsigned long, IP )
115 tp_strcpy(pool_name, pool_name)
116 tp_assign(nbytes, nbytes)
117 tp_assign(entropy_count, entropy_count)
121 TP_printk("%s pool: nbytes %d entropy_count %d caller %pF",
122 __get_str(pool_name), __entry->nbytes, __entry->entropy_count,
127 DEFINE_EVENT_MAP(random__extract_entropy, extract_entropy,
129 random_extract_entropy,
131 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
134 TP_ARGS(pool_name, nbytes, entropy_count, IP)
137 DEFINE_EVENT_MAP(random__extract_entropy, extract_entropy_user,
139 random_extract_entropy_user,
141 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
144 TP_ARGS(pool_name, nbytes, entropy_count, IP)
149 #endif /* _TRACE_RANDOM_H */
151 /* This part must be outside protection */
152 #include "../../../probes/define_trace.h"