]> Pileus Git - ~andy/linux/blob - include/trace/events/random.h
2ffcaec5860a36f6597aed339eeb3c226e2ab772
[~andy/linux] / include / trace / events / random.h
1 #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
10 TRACE_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
29 DECLARE_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
50 DEFINE_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
56 DEFINE_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
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),
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
90 DECLARE_EVENT_CLASS(random__get_random_bytes,
91         TP_PROTO(int nbytes, unsigned long IP),
92
93         TP_ARGS(nbytes, IP),
94
95         TP_STRUCT__entry(
96                 __field(          int,  nbytes                  )
97                 __field(unsigned long,  IP                      )
98         ),
99
100         TP_fast_assign(
101                 __entry->nbytes         = nbytes;
102                 __entry->IP             = IP;
103         ),
104
105         TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP)
106 );
107
108 DEFINE_EVENT(random__get_random_bytes, get_random_bytes,
109         TP_PROTO(int nbytes, unsigned long IP),
110
111         TP_ARGS(nbytes, IP)
112 );
113
114 DEFINE_EVENT(random__get_random_bytes, get_random_bytes_arch,
115         TP_PROTO(int nbytes, unsigned long IP),
116
117         TP_ARGS(nbytes, IP)
118 );
119
120 DECLARE_EVENT_CLASS(random__extract_entropy,
121         TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
122                  unsigned long IP),
123
124         TP_ARGS(pool_name, nbytes, entropy_count, IP),
125
126         TP_STRUCT__entry(
127                 __field( const char *,  pool_name               )
128                 __field(          int,  nbytes                  )
129                 __field(          int,  entropy_count           )
130                 __field(unsigned long,  IP                      )
131         ),
132
133         TP_fast_assign(
134                 __entry->pool_name      = pool_name;
135                 __entry->nbytes         = nbytes;
136                 __entry->entropy_count  = entropy_count;
137                 __entry->IP             = IP;
138         ),
139
140         TP_printk("%s pool: nbytes %d entropy_count %d caller %pF",
141                   __entry->pool_name, __entry->nbytes, __entry->entropy_count,
142                   (void *)__entry->IP)
143 );
144
145
146 DEFINE_EVENT(random__extract_entropy, extract_entropy,
147         TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
148                  unsigned long IP),
149
150         TP_ARGS(pool_name, nbytes, entropy_count, IP)
151 );
152
153 DEFINE_EVENT(random__extract_entropy, extract_entropy_user,
154         TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
155                  unsigned long IP),
156
157         TP_ARGS(pool_name, nbytes, entropy_count, IP)
158 );
159
160
161
162 #endif /* _TRACE_RANDOM_H */
163
164 /* This part must be outside protection */
165 #include <trace/define_trace.h>