Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / lttng / instrumentation / events / lttng-module / 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 DECLARE_EVENT_CLASS(random__mix_pool_bytes,
11         TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
12
13         TP_ARGS(pool_name, bytes, IP),
14
15         TP_STRUCT__entry(
16                 __string(   pool_name,  pool_name               )
17                 __field(          int,  bytes                   )
18                 __field(unsigned long,  IP                      )
19         ),
20
21         TP_fast_assign(
22                 tp_strcpy(pool_name, pool_name)
23                 tp_assign(bytes, bytes)
24                 tp_assign(IP, IP)
25         ),
26
27         TP_printk("%s pool: bytes %d caller %pF",
28                   __get_str(pool_name), __entry->bytes, (void *)__entry->IP)
29 )
30
31 DEFINE_EVENT_MAP(random__mix_pool_bytes, mix_pool_bytes,
32
33         random_mix_pool_bytes,
34
35         TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
36
37         TP_ARGS(pool_name, bytes, IP)
38 )
39
40 DEFINE_EVENT_MAP(random__mix_pool_bytes, mix_pool_bytes_nolock,
41
42         random_mix_pool_bytes_nolock,
43
44         TP_PROTO(const char *pool_name, int bytes, unsigned long IP),
45
46         TP_ARGS(pool_name, bytes, IP)
47 )
48
49 TRACE_EVENT_MAP(credit_entropy_bits,
50
51         random_credit_entropy_bits,
52
53         TP_PROTO(const char *pool_name, int bits, int entropy_count,
54                  int entropy_total, unsigned long IP),
55
56         TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP),
57
58         TP_STRUCT__entry(
59                 __string(   pool_name,  pool_name               )
60                 __field(          int,  bits                    )
61                 __field(          int,  entropy_count           )
62                 __field(          int,  entropy_total           )
63                 __field(unsigned long,  IP                      )
64         ),
65
66         TP_fast_assign(
67                 tp_strcpy(pool_name, pool_name)
68                 tp_assign(bits, bits)
69                 tp_assign(entropy_count, entropy_count)
70                 tp_assign(entropy_total, entropy_total)
71                 tp_assign(IP, IP)
72         ),
73
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,
77                   (void *)__entry->IP)
78 )
79
80 TRACE_EVENT_MAP(get_random_bytes,
81
82         random_get_random_bytes,
83
84         TP_PROTO(int nbytes, unsigned long IP),
85
86         TP_ARGS(nbytes, IP),
87
88         TP_STRUCT__entry(
89                 __field(          int,  nbytes                  )
90                 __field(unsigned long,  IP                      )
91         ),
92
93         TP_fast_assign(
94                 tp_assign(nbytes, nbytes)
95                 tp_assign(IP, IP)
96         ),
97
98         TP_printk("nbytes %d caller %pF", __entry->nbytes, (void *)__entry->IP)
99 )
100
101 DECLARE_EVENT_CLASS(random__extract_entropy,
102         TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
103                  unsigned long IP),
104
105         TP_ARGS(pool_name, nbytes, entropy_count, IP),
106
107         TP_STRUCT__entry(
108                 __string(   pool_name,  pool_name               )
109                 __field(          int,  nbytes                  )
110                 __field(          int,  entropy_count           )
111                 __field(unsigned long,  IP                      )
112         ),
113
114         TP_fast_assign(
115                 tp_strcpy(pool_name, pool_name)
116                 tp_assign(nbytes, nbytes)
117                 tp_assign(entropy_count, entropy_count)
118                 tp_assign(IP, IP)
119         ),
120
121         TP_printk("%s pool: nbytes %d entropy_count %d caller %pF",
122                   __get_str(pool_name), __entry->nbytes, __entry->entropy_count,
123                   (void *)__entry->IP)
124 )
125
126
127 DEFINE_EVENT_MAP(random__extract_entropy, extract_entropy,
128
129         random_extract_entropy,
130
131         TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
132                  unsigned long IP),
133
134         TP_ARGS(pool_name, nbytes, entropy_count, IP)
135 )
136
137 DEFINE_EVENT_MAP(random__extract_entropy, extract_entropy_user,
138
139         random_extract_entropy_user,
140
141         TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
142                  unsigned long IP),
143
144         TP_ARGS(pool_name, nbytes, entropy_count, IP)
145 )
146
147
148
149 #endif /* _TRACE_RANDOM_H */
150
151 /* This part must be outside protection */
152 #include "../../../probes/define_trace.h"