blob: 527b5dc1b4166a981dd34ec732e123b5a851b0ce [file] [log] [blame]
Theodore Ts'o00ce1db2012-07-04 16:19:30 -04001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM random
3
4#if !defined(_TRACE_RANDOM_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_RANDOM_H
6
7#include <linux/writeback.h>
8#include <linux/tracepoint.h>
9
Theodore Ts'o59108952013-09-12 14:10:25 -040010TRACE_EVENT(add_device_randomness,
11 TP_PROTO(int bytes, unsigned long IP),
12
13 TP_ARGS(bytes, IP),
14
15 TP_STRUCT__entry(
16 __field( int, bytes )
17 __field(unsigned long, IP )
18 ),
19
20 TP_fast_assign(
21 __entry->bytes = bytes;
22 __entry->IP = IP;
23 ),
24
25 TP_printk("bytes %d caller %pF",
26 __entry->bytes, (void *)__entry->IP)
27);
28
Theodore Ts'o00ce1db2012-07-04 16:19:30 -040029DECLARE_EVENT_CLASS(random__mix_pool_bytes,
30 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
31
32 TP_ARGS(pool_name, bytes, IP),
33
34 TP_STRUCT__entry(
35 __field( const char *, pool_name )
36 __field( int, bytes )
37 __field(unsigned long, IP )
38 ),
39
40 TP_fast_assign(
41 __entry->pool_name = pool_name;
42 __entry->bytes = bytes;
43 __entry->IP = IP;
44 ),
45
46 TP_printk("%s pool: bytes %d caller %pF",
47 __entry->pool_name, __entry->bytes, (void *)__entry->IP)
48);
49
50DEFINE_EVENT(random__mix_pool_bytes, mix_pool_bytes,
51 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
52
53 TP_ARGS(pool_name, bytes, IP)
54);
55
56DEFINE_EVENT(random__mix_pool_bytes, mix_pool_bytes_nolock,
57 TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
58
59 TP_ARGS(pool_name, bytes, IP)
60);
61
62TRACE_EVENT(credit_entropy_bits,
63 TP_PROTO(const char *pool_name, int bits, int entropy_count,
64 int entropy_total, unsigned long IP),
65
66 TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP),
67
68 TP_STRUCT__entry(
69 __field( const char *, pool_name )
70 __field( int, bits )
71 __field( int, entropy_count )
72 __field( int, entropy_total )
73 __field(unsigned long, IP )
74 ),
75
76 TP_fast_assign(
77 __entry->pool_name = pool_name;
78 __entry->bits = bits;
79 __entry->entropy_count = entropy_count;
80 __entry->entropy_total = entropy_total;
81 __entry->IP = IP;
82 ),
83
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,
87 (void *)__entry->IP)
88);
89
Theodore Ts'o6265e162013-10-03 01:08:15 -040090TRACE_EVENT(push_to_pool,
91 TP_PROTO(const char *pool_name, int pool_bits, int input_bits),
92
93 TP_ARGS(pool_name, pool_bits, input_bits),
94
95 TP_STRUCT__entry(
96 __field( const char *, pool_name )
97 __field( int, pool_bits )
98 __field( int, input_bits )
99 ),
100
101 TP_fast_assign(
102 __entry->pool_name = pool_name;
103 __entry->pool_bits = pool_bits;
104 __entry->input_bits = input_bits;
105 ),
106
107 TP_printk("%s: pool_bits %d input_pool_bits %d",
108 __entry->pool_name, __entry->pool_bits,
109 __entry->input_bits)
110);
111
Theodore Ts'o59108952013-09-12 14:10:25 -0400112DECLARE_EVENT_CLASS(random__get_random_bytes,
Theodore Ts'o00ce1db2012-07-04 16:19:30 -0400113 TP_PROTO(int nbytes, unsigned long IP),
114
115 TP_ARGS(nbytes, IP),
116
117 TP_STRUCT__entry(
118 __field( int, nbytes )
119 __field(unsigned long, IP )
120 ),
121
122 TP_fast_assign(
123 __entry->nbytes = nbytes;
124 __entry->IP = IP;
125 ),
126
127 TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP)
128);
129
Theodore Ts'o59108952013-09-12 14:10:25 -0400130DEFINE_EVENT(random__get_random_bytes, get_random_bytes,
131 TP_PROTO(int nbytes, unsigned long IP),
132
133 TP_ARGS(nbytes, IP)
134);
135
136DEFINE_EVENT(random__get_random_bytes, get_random_bytes_arch,
137 TP_PROTO(int nbytes, unsigned long IP),
138
139 TP_ARGS(nbytes, IP)
140);
141
Theodore Ts'o00ce1db2012-07-04 16:19:30 -0400142DECLARE_EVENT_CLASS(random__extract_entropy,
143 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
144 unsigned long IP),
145
146 TP_ARGS(pool_name, nbytes, entropy_count, IP),
147
148 TP_STRUCT__entry(
149 __field( const char *, pool_name )
150 __field( int, nbytes )
151 __field( int, entropy_count )
152 __field(unsigned long, IP )
153 ),
154
155 TP_fast_assign(
156 __entry->pool_name = pool_name;
157 __entry->nbytes = nbytes;
158 __entry->entropy_count = entropy_count;
159 __entry->IP = IP;
160 ),
161
162 TP_printk("%s pool: nbytes %d entropy_count %d caller %pF",
163 __entry->pool_name, __entry->nbytes, __entry->entropy_count,
164 (void *)__entry->IP)
165);
166
167
168DEFINE_EVENT(random__extract_entropy, extract_entropy,
169 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
170 unsigned long IP),
171
172 TP_ARGS(pool_name, nbytes, entropy_count, IP)
173);
174
175DEFINE_EVENT(random__extract_entropy, extract_entropy_user,
176 TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
177 unsigned long IP),
178
179 TP_ARGS(pool_name, nbytes, entropy_count, IP)
180);
181
182
183
184#endif /* _TRACE_RANDOM_H */
185
186/* This part must be outside protection */
187#include <trace/define_trace.h>