History

rxrpc: Automatically generate trace tag enums

Automatically generate trace tag enums from the symbol -> string mapping tables rather than having the enums as well, thereby reducing duplicated data.

David Howells committed 4 years ago

Commit dc9fd091 parent ad25f5c1 file · +42 −219Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/trace/events/rxrpc.h+42−219
@@ -13,215 +13,6 @@ · 12 unmodified lines
1313 #include <linux/tracepoint.h>
1414 #include <linux/errqueue.h>
1515
16−/*
17− * Define enums for tracing information.
18− *
19− * These should all be kept sorted, making it easier to match the string
20− * mapping tables further on.
21− */
22−#ifndef __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
23−#define __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
24−
25−enum rxrpc_skb_trace {
26− rxrpc_skb_cleaned,
27− rxrpc_skb_freed,
28− rxrpc_skb_got,
29− rxrpc_skb_lost,
30− rxrpc_skb_new,
31− rxrpc_skb_purged,
32− rxrpc_skb_received,
33− rxrpc_skb_rotated,
34− rxrpc_skb_seen,
35− rxrpc_skb_unshared,
36− rxrpc_skb_unshared_nomem,
37−};
38−
39−enum rxrpc_local_trace {
40− rxrpc_local_got,
41− rxrpc_local_new,
42− rxrpc_local_processing,
43− rxrpc_local_put,
44− rxrpc_local_queued,
45−};
46−
47−enum rxrpc_peer_trace {
48− rxrpc_peer_got,
49− rxrpc_peer_new,
50− rxrpc_peer_processing,
51− rxrpc_peer_put,
52−};
53−
54−enum rxrpc_conn_trace {
55− rxrpc_conn_got,
56− rxrpc_conn_new_client,
57− rxrpc_conn_new_service,
58− rxrpc_conn_put_client,
59− rxrpc_conn_put_service,
60− rxrpc_conn_queued,
61− rxrpc_conn_reap_service,
62− rxrpc_conn_seen,
63−};
64−
65−enum rxrpc_client_trace {
66− rxrpc_client_activate_chans,
67− rxrpc_client_alloc,
68− rxrpc_client_chan_activate,
69− rxrpc_client_chan_disconnect,
70− rxrpc_client_chan_pass,
71− rxrpc_client_chan_wait_failed,
72− rxrpc_client_cleanup,
73− rxrpc_client_discard,
74− rxrpc_client_duplicate,
75− rxrpc_client_exposed,
76− rxrpc_client_replace,
77− rxrpc_client_to_active,
78− rxrpc_client_to_idle,
79−};
80−
81−enum rxrpc_call_trace {
82− rxrpc_call_connected,
83− rxrpc_call_error,
84− rxrpc_call_got,
85− rxrpc_call_got_kernel,
86− rxrpc_call_got_timer,
87− rxrpc_call_got_userid,
88− rxrpc_call_new_client,
89− rxrpc_call_new_service,
90− rxrpc_call_put,
91− rxrpc_call_put_kernel,
92− rxrpc_call_put_noqueue,
93− rxrpc_call_put_notimer,
94− rxrpc_call_put_timer,
95− rxrpc_call_put_userid,
96− rxrpc_call_queued,
97− rxrpc_call_queued_ref,
98− rxrpc_call_release,
99− rxrpc_call_seen,
100−};
101−
102−enum rxrpc_transmit_trace {
103− rxrpc_transmit_await_reply,
104− rxrpc_transmit_end,
105− rxrpc_transmit_queue,
106− rxrpc_transmit_queue_last,
107− rxrpc_transmit_rotate,
108− rxrpc_transmit_rotate_last,
109− rxrpc_transmit_wait,
110−};
111−
112−enum rxrpc_receive_trace {
113− rxrpc_receive_end,
114− rxrpc_receive_front,
115− rxrpc_receive_incoming,
116− rxrpc_receive_queue,
117− rxrpc_receive_queue_last,
118− rxrpc_receive_rotate,
119−};
120−
121−enum rxrpc_recvmsg_trace {
122− rxrpc_recvmsg_cont,
123− rxrpc_recvmsg_data_return,
124− rxrpc_recvmsg_dequeue,
125− rxrpc_recvmsg_enter,
126− rxrpc_recvmsg_full,
127− rxrpc_recvmsg_hole,
128− rxrpc_recvmsg_next,
129− rxrpc_recvmsg_requeue,
130− rxrpc_recvmsg_return,
131− rxrpc_recvmsg_terminal,
132− rxrpc_recvmsg_to_be_accepted,
133− rxrpc_recvmsg_wait,
134−};
135−
136−enum rxrpc_rtt_tx_trace {
137− rxrpc_rtt_tx_cancel,
138− rxrpc_rtt_tx_data,
139− rxrpc_rtt_tx_no_slot,
140− rxrpc_rtt_tx_ping,
141−};
142−
143−enum rxrpc_rtt_rx_trace {
144− rxrpc_rtt_rx_cancel,
145− rxrpc_rtt_rx_lost,
146− rxrpc_rtt_rx_obsolete,
147− rxrpc_rtt_rx_ping_response,
148− rxrpc_rtt_rx_requested_ack,
149−};
150−
151−enum rxrpc_timer_trace {
152− rxrpc_timer_begin,
153− rxrpc_timer_exp_ack,
154− rxrpc_timer_exp_hard,
155− rxrpc_timer_exp_idle,
156− rxrpc_timer_exp_keepalive,
157− rxrpc_timer_exp_lost_ack,
158− rxrpc_timer_exp_normal,
159− rxrpc_timer_exp_ping,
160− rxrpc_timer_exp_resend,
161− rxrpc_timer_expired,
162− rxrpc_timer_init_for_reply,
163− rxrpc_timer_init_for_send_reply,
164− rxrpc_timer_restart,
165− rxrpc_timer_set_for_ack,
166− rxrpc_timer_set_for_hard,
167− rxrpc_timer_set_for_idle,
168− rxrpc_timer_set_for_keepalive,
169− rxrpc_timer_set_for_lost_ack,
170− rxrpc_timer_set_for_normal,
171− rxrpc_timer_set_for_ping,
172− rxrpc_timer_set_for_resend,
173− rxrpc_timer_set_for_send,
174−};
175−
176−enum rxrpc_propose_ack_trace {
177− rxrpc_propose_ack_client_tx_end,
178− rxrpc_propose_ack_input_data,
179− rxrpc_propose_ack_ping_for_check_life,
180− rxrpc_propose_ack_ping_for_keepalive,
181− rxrpc_propose_ack_ping_for_lost_ack,
182− rxrpc_propose_ack_ping_for_lost_reply,
183− rxrpc_propose_ack_ping_for_params,
184− rxrpc_propose_ack_processing_op,
185− rxrpc_propose_ack_respond_to_ack,
186− rxrpc_propose_ack_respond_to_ping,
187− rxrpc_propose_ack_retry_tx,
188− rxrpc_propose_ack_rotate_rx,
189− rxrpc_propose_ack_terminal_ack,
190−};
191−
192−enum rxrpc_propose_ack_outcome {
193− rxrpc_propose_ack_subsume,
194− rxrpc_propose_ack_update,
195− rxrpc_propose_ack_use,
196−};
197−
198−enum rxrpc_congest_change {
199− rxrpc_cong_begin_retransmission,
200− rxrpc_cong_cleared_nacks,
201− rxrpc_cong_new_low_nack,
202− rxrpc_cong_no_change,
203− rxrpc_cong_progress,
204− rxrpc_cong_retransmit_again,
205− rxrpc_cong_rtt_window_end,
206− rxrpc_cong_saw_nack,
207−};
208−
209−enum rxrpc_tx_point {
210− rxrpc_tx_point_call_abort,
211− rxrpc_tx_point_call_ack,
212− rxrpc_tx_point_call_data_frag,
213− rxrpc_tx_point_call_data_nofrag,
214− rxrpc_tx_point_call_final_resend,
215− rxrpc_tx_point_conn_abort,
216− rxrpc_tx_point_rxkad_challenge,
217− rxrpc_tx_point_rxkad_response,
218− rxrpc_tx_point_reject,
219− rxrpc_tx_point_version_keepalive,
220− rxrpc_tx_point_version_reply,
221−};
222−
223−#endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
224−
22516 /*
22617 * Declare tracing information enums and their string mappings for display.
22718 */
@@ -451,6 +242,36 @@ enum rxrpc_tx_point { · 223 unmodified lines
451242 EM(rxrpc_tx_point_version_keepalive, "VerKeepalive") \
452243 E_(rxrpc_tx_point_version_reply, "VerReply")
453244
245+/*
246+ * Generate enums for tracing information.
247+ */
248+#ifndef __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
249+#define __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
250+
251+#undef EM
252+#undef E_
253+#define EM(a, b) a,
254+#define E_(a, b) a
255+
256+enum rxrpc_call_trace { rxrpc_call_traces } __mode(byte);
257+enum rxrpc_client_trace { rxrpc_client_traces } __mode(byte);
258+enum rxrpc_congest_change { rxrpc_congest_changes } __mode(byte);
259+enum rxrpc_conn_trace { rxrpc_conn_traces } __mode(byte);
260+enum rxrpc_local_trace { rxrpc_local_traces } __mode(byte);
261+enum rxrpc_peer_trace { rxrpc_peer_traces } __mode(byte);
262+enum rxrpc_propose_ack_outcome { rxrpc_propose_ack_outcomes } __mode(byte);
263+enum rxrpc_propose_ack_trace { rxrpc_propose_ack_traces } __mode(byte);
264+enum rxrpc_receive_trace { rxrpc_receive_traces } __mode(byte);
265+enum rxrpc_recvmsg_trace { rxrpc_recvmsg_traces } __mode(byte);
266+enum rxrpc_rtt_rx_trace { rxrpc_rtt_rx_traces } __mode(byte);
267+enum rxrpc_rtt_tx_trace { rxrpc_rtt_tx_traces } __mode(byte);
268+enum rxrpc_skb_trace { rxrpc_skb_traces } __mode(byte);
269+enum rxrpc_timer_trace { rxrpc_timer_traces } __mode(byte);
270+enum rxrpc_transmit_trace { rxrpc_transmit_traces } __mode(byte);
271+enum rxrpc_tx_point { rxrpc_tx_points } __mode(byte);
272+
273+#endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
274+
454275 /*
455276 * Export enum symbols via userspace.
456277 */
@@ -459,21 +280,21 @@ enum rxrpc_tx_point { · 2 unmodified lines
459280 #define EM(a, b) TRACE_DEFINE_ENUM(a);
460281 #define E_(a, b) TRACE_DEFINE_ENUM(a);
461282
462−rxrpc_skb_traces;
463−rxrpc_local_traces;
464−rxrpc_conn_traces;
465−rxrpc_client_traces;
466283 rxrpc_call_traces;
467−rxrpc_transmit_traces;
284+rxrpc_client_traces;
285+rxrpc_congest_changes;
286+rxrpc_congest_modes;
287+rxrpc_conn_traces;
288+rxrpc_local_traces;
289+rxrpc_propose_ack_outcomes;
290+rxrpc_propose_ack_traces;
468291 rxrpc_receive_traces;
469292 rxrpc_recvmsg_traces;
470−rxrpc_rtt_tx_traces;
471293 rxrpc_rtt_rx_traces;
294+rxrpc_rtt_tx_traces;
295+rxrpc_skb_traces;
472296 rxrpc_timer_traces;
473−rxrpc_propose_ack_traces;
474−rxrpc_propose_ack_outcomes;
475−rxrpc_congest_modes;
476−rxrpc_congest_changes;
297+rxrpc_transmit_traces;
477298 rxrpc_tx_points;
478299
479300 /*
@@ -1574,6 +1395,8 @@ TRACE_EVENT(rxrpc_rx_discard_ack, · 1094 unmodified lines
15741395 __entry->call_ackr_prev)
15751396 );
15761397
1398+#undef EM
1399+#undef E_
15771400 #endif /* _TRACE_RXRPC_H */
15781401
15791402 /* This part must be outside protection */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t