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 TRACE_EVENT(add_device_randomness,
11 TP_PROTO(int bytes, unsigned long IP),
17 __field(unsigned long, IP )
21 __entry->bytes = bytes;
25 TP_printk("bytes %d caller %pF",
26 __entry->bytes, (void *)__entry->IP)
29 DECLARE_EVENT_CLASS(random__mix_pool_bytes,
30 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
32 TP_ARGS(pool_name, bytes, IP),
35 __field( const char *, pool_name )
37 __field(unsigned long, IP )
41 __entry->pool_name = pool_name;
42 __entry->bytes = bytes;
46 TP_printk("%s pool: bytes %d caller %pF",
47 __entry->pool_name, __entry->bytes, (void *)__entry->IP)
50 DEFINE_EVENT(random__mix_pool_bytes, mix_pool_bytes,
51 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
53 TP_ARGS(pool_name, bytes, IP)
56 DEFINE_EVENT(random__mix_pool_bytes, mix_pool_bytes_nolock,
57 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
59 TP_ARGS(pool_name, bytes, IP)
62 TRACE_EVENT(credit_entropy_bits,
63 TP_PROTO(const char *pool_name, int bits, int entropy_count,
64 int entropy_total, unsigned long IP),
66 TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP),
69 __field( const char *, pool_name )
71 __field( int, entropy_count )
72 __field( int, entropy_total )
73 __field(unsigned long, IP )
77 __entry->pool_name = pool_name;
79 __entry->entropy_count = entropy_count;
80 __entry->entropy_total = entropy_total;
84 TP_printk("%s pool: bits %d entropy_count %d entropy_total %d "
85 "caller %pF", __entry->pool_name, __entry->bits,
86 __entry->entropy_count, __entry->entropy_total,
90 TRACE_EVENT(push_to_pool,
91 TP_PROTO(const char *pool_name, int pool_bits, int input_bits),
93 TP_ARGS(pool_name, pool_bits, input_bits),
96 __field( const char *, pool_name )
97 __field( int, pool_bits )
98 __field( int, input_bits )
102 __entry->pool_name = pool_name;
103 __entry->pool_bits = pool_bits;
104 __entry->input_bits = input_bits;
107 TP_printk("%s: pool_bits %d input_pool_bits %d",
108 __entry->pool_name, __entry->pool_bits,
112 DECLARE_EVENT_CLASS(random__get_random_bytes,
113 TP_PROTO(int nbytes, unsigned long IP),
118 __field( int, nbytes )
119 __field(unsigned long, IP )
123 __entry->nbytes = nbytes;
127 TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP)
130 DEFINE_EVENT(random__get_random_bytes, get_random_bytes,
131 TP_PROTO(int nbytes, unsigned long IP),
136 DEFINE_EVENT(random__get_random_bytes, get_random_bytes_arch,
137 TP_PROTO(int nbytes, unsigned long IP),
142 DECLARE_EVENT_CLASS(random__extract_entropy,
143 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
146 TP_ARGS(pool_name, nbytes, entropy_count, IP),
149 __field( const char *, pool_name )
150 __field( int, nbytes )
151 __field( int, entropy_count )
152 __field(unsigned long, IP )
156 __entry->pool_name = pool_name;
157 __entry->nbytes = nbytes;
158 __entry->entropy_count = entropy_count;
162 TP_printk("%s pool: nbytes %d entropy_count %d caller %pF",
163 __entry->pool_name, __entry->nbytes, __entry->entropy_count,
168 DEFINE_EVENT(random__extract_entropy, extract_entropy,
169 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
172 TP_ARGS(pool_name, nbytes, entropy_count, IP)
175 DEFINE_EVENT(random__extract_entropy, extract_entropy_user,
176 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
179 TP_ARGS(pool_name, nbytes, entropy_count, IP)
184 #endif /* _TRACE_RANDOM_H */
186 /* This part must be outside protection */
187 #include <trace/define_trace.h>