1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * FUJITSU Extended Socket Network Device driver
4 * Copyright (c) 2015-2016 FUJITSU LIMITED
7 #if !defined(FJES_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
10 #include <linux/types.h>
11 #include <linux/tracepoint.h>
14 #define TRACE_SYSTEM fjes
16 /* tracepoints for fjes_hw.c */
18 TRACE_EVENT(fjes_hw_issue_request_command
,
19 TP_PROTO(union REG_CR
*cr
, union REG_CS
*cs
, int timeout
,
20 enum fjes_dev_command_response_e ret
),
21 TP_ARGS(cr
, cs
, timeout
, ret
),
25 __field(u16
, cr_err_info
)
26 __field(u8
, cr_req_start
)
29 __field(u8
, cs_complete
)
34 __entry
->cr_req
= cr
->bits
.req_code
;
35 __entry
->cr_error
= cr
->bits
.error
;
36 __entry
->cr_err_info
= cr
->bits
.err_info
;
37 __entry
->cr_req_start
= cr
->bits
.req_start
;
38 __entry
->cs_req
= cs
->bits
.req_code
;
39 __entry
->cs_busy
= cs
->bits
.busy
;
40 __entry
->cs_complete
= cs
->bits
.complete
;
41 __entry
->timeout
= timeout
;
44 TP_printk("CR=[req=%04x, error=%u, err_info=%04x, req_start=%u], CS=[req=%04x, busy=%u, complete=%u], timeout=%d, ret=%d",
45 __entry
->cr_req
, __entry
->cr_error
, __entry
->cr_err_info
,
46 __entry
->cr_req_start
, __entry
->cs_req
, __entry
->cs_busy
,
47 __entry
->cs_complete
, __entry
->timeout
, __entry
->ret
)
50 TRACE_EVENT(fjes_hw_request_info
,
51 TP_PROTO(struct fjes_hw
*hw
, union fjes_device_command_res
*res_buf
),
56 __dynamic_array(u8
, zone
, hw
->max_epid
)
57 __dynamic_array(u8
, status
, hw
->max_epid
)
62 __entry
->length
= res_buf
->info
.length
;
63 __entry
->code
= res_buf
->info
.code
;
64 for (x
= 0; x
< hw
->max_epid
; x
++) {
65 *((u8
*)__get_dynamic_array(zone
) + x
) =
66 res_buf
->info
.info
[x
].zone
;
67 *((u8
*)__get_dynamic_array(status
) + x
) =
68 res_buf
->info
.info
[x
].es_status
;
71 TP_printk("res_buf=[length=%d, code=%d, es_zones=%s, es_status=%s]",
72 __entry
->length
, __entry
->code
,
73 __print_array(__get_dynamic_array(zone
),
74 __get_dynamic_array_len(zone
) / sizeof(u8
),
76 __print_array(__get_dynamic_array(status
),
77 __get_dynamic_array_len(status
) / sizeof(u8
),
81 TRACE_EVENT(fjes_hw_request_info_err
,
88 __assign_str(err
, err
);
90 TP_printk("%s", __get_str(err
))
93 TRACE_EVENT(fjes_hw_register_buff_addr_req
,
94 TP_PROTO(union fjes_device_command_req
*req_buf
,
95 struct ep_share_mem_info
*buf_pair
),
96 TP_ARGS(req_buf
, buf_pair
),
101 __field(size_t, tx_size
)
103 __field(size_t, rx_size
)
108 tx
= (void *)buf_pair
->tx
.buffer
;
109 rx
= (void *)buf_pair
->rx
.buffer
;
110 __entry
->length
= req_buf
->share_buffer
.length
;
111 __entry
->epid
= req_buf
->share_buffer
.epid
;
112 __entry
->tx_size
= buf_pair
->tx
.size
;
113 __entry
->rx_size
= buf_pair
->rx
.size
;
114 __entry
->tx
= page_to_phys(vmalloc_to_page(tx
)) +
116 __entry
->rx
= page_to_phys(vmalloc_to_page(rx
)) +
119 TP_printk("req_buf=[length=%d, epid=%d], TX=[phy=0x%016llx, size=%zu], RX=[phy=0x%016llx, size=%zu]",
120 __entry
->length
, __entry
->epid
, __entry
->tx
, __entry
->tx_size
,
121 __entry
->rx
, __entry
->rx_size
)
124 TRACE_EVENT(fjes_hw_register_buff_addr
,
125 TP_PROTO(union fjes_device_command_res
*res_buf
, int timeout
),
126 TP_ARGS(res_buf
, timeout
),
130 __field(int, timeout
)
133 __entry
->length
= res_buf
->share_buffer
.length
;
134 __entry
->code
= res_buf
->share_buffer
.code
;
135 __entry
->timeout
= timeout
;
137 TP_printk("res_buf=[length=%d, code=%d], timeout=%d",
138 __entry
->length
, __entry
->code
, __entry
->timeout
)
141 TRACE_EVENT(fjes_hw_register_buff_addr_err
,
148 __assign_str(err
, err
);
150 TP_printk("%s", __get_str(err
))
153 TRACE_EVENT(fjes_hw_unregister_buff_addr_req
,
154 TP_PROTO(union fjes_device_command_req
*req_buf
),
161 __entry
->length
= req_buf
->unshare_buffer
.length
;
162 __entry
->epid
= req_buf
->unshare_buffer
.epid
;
164 TP_printk("req_buf=[length=%d, epid=%d]",
165 __entry
->length
, __entry
->epid
)
168 TRACE_EVENT(fjes_hw_unregister_buff_addr
,
169 TP_PROTO(union fjes_device_command_res
*res_buf
, int timeout
),
170 TP_ARGS(res_buf
, timeout
),
174 __field(int, timeout
)
177 __entry
->length
= res_buf
->unshare_buffer
.length
;
178 __entry
->code
= res_buf
->unshare_buffer
.code
;
179 __entry
->timeout
= timeout
;
181 TP_printk("res_buf=[length=%d, code=%d], timeout=%d",
182 __entry
->length
, __entry
->code
, __entry
->timeout
)
185 TRACE_EVENT(fjes_hw_unregister_buff_addr_err
,
192 __assign_str(err
, err
);
194 TP_printk("%s", __get_str(err
))
197 TRACE_EVENT(fjes_hw_start_debug_req
,
198 TP_PROTO(union fjes_device_command_req
*req_buf
),
203 __field(phys_addr_t
, buffer
)
206 __entry
->length
= req_buf
->start_trace
.length
;
207 __entry
->mode
= req_buf
->start_trace
.mode
;
208 __entry
->buffer
= req_buf
->start_trace
.buffer
[0];
210 TP_printk("req_buf=[length=%d, mode=%d, buffer=%pap]",
211 __entry
->length
, __entry
->mode
, &__entry
->buffer
)
214 TRACE_EVENT(fjes_hw_start_debug
,
215 TP_PROTO(union fjes_device_command_res
*res_buf
),
222 __entry
->length
= res_buf
->start_trace
.length
;
223 __entry
->code
= res_buf
->start_trace
.code
;
225 TP_printk("res_buf=[length=%d, code=%d]", __entry
->length
, __entry
->code
)
228 TRACE_EVENT(fjes_hw_start_debug_err
,
235 __assign_str(err
, err
)
237 TP_printk("%s", __get_str(err
))
240 TRACE_EVENT(fjes_hw_stop_debug
,
241 TP_PROTO(union fjes_device_command_res
*res_buf
),
248 __entry
->length
= res_buf
->stop_trace
.length
;
249 __entry
->code
= res_buf
->stop_trace
.code
;
251 TP_printk("res_buf=[length=%d, code=%d]", __entry
->length
, __entry
->code
)
254 TRACE_EVENT(fjes_hw_stop_debug_err
,
261 __assign_str(err
, err
)
263 TP_printk("%s", __get_str(err
))
266 /* tracepoints for fjes_main.c */
268 TRACE_EVENT(fjes_txrx_stop_req_irq_pre
,
269 TP_PROTO(struct fjes_hw
*hw
, int src_epid
,
270 enum ep_partner_status status
),
271 TP_ARGS(hw
, src_epid
, status
),
273 __field(int, src_epid
)
274 __field(enum ep_partner_status
, status
)
275 __field(u8
, ep_status
)
276 __field(unsigned long, txrx_stop_req_bit
)
277 __field(u16
, rx_status
)
280 __entry
->src_epid
= src_epid
;
281 __entry
->status
= status
;
282 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
283 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
285 hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
287 TP_printk("epid=%d, partner_status=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
288 __entry
->src_epid
, __entry
->status
, __entry
->ep_status
,
289 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
292 TRACE_EVENT(fjes_txrx_stop_req_irq_post
,
293 TP_PROTO(struct fjes_hw
*hw
, int src_epid
),
294 TP_ARGS(hw
, src_epid
),
296 __field(int, src_epid
)
297 __field(u8
, ep_status
)
298 __field(unsigned long, txrx_stop_req_bit
)
299 __field(u16
, rx_status
)
302 __entry
->src_epid
= src_epid
;
303 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
304 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
305 __entry
->rx_status
= hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
307 TP_printk("epid=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
308 __entry
->src_epid
, __entry
->ep_status
,
309 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
312 TRACE_EVENT(fjes_stop_req_irq_pre
,
313 TP_PROTO(struct fjes_hw
*hw
, int src_epid
,
314 enum ep_partner_status status
),
315 TP_ARGS(hw
, src_epid
, status
),
317 __field(int, src_epid
)
318 __field(enum ep_partner_status
, status
)
319 __field(u8
, ep_status
)
320 __field(unsigned long, txrx_stop_req_bit
)
321 __field(u16
, rx_status
)
324 __entry
->src_epid
= src_epid
;
325 __entry
->status
= status
;
326 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
327 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
329 hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
331 TP_printk("epid=%d, partner_status=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
332 __entry
->src_epid
, __entry
->status
, __entry
->ep_status
,
333 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
336 TRACE_EVENT(fjes_stop_req_irq_post
,
337 TP_PROTO(struct fjes_hw
*hw
, int src_epid
),
338 TP_ARGS(hw
, src_epid
),
340 __field(int, src_epid
)
341 __field(u8
, ep_status
)
342 __field(unsigned long, txrx_stop_req_bit
)
343 __field(u16
, rx_status
)
346 __entry
->src_epid
= src_epid
;
347 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
348 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
350 hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
352 TP_printk("epid=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
353 __entry
->src_epid
, __entry
->ep_status
,
354 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
357 #endif /* FJES_TRACE_H_ */
359 #undef TRACE_INCLUDE_PATH
360 #undef TRACE_INCLUDE_FILE
361 #define TRACE_INCLUDE_PATH ../../../drivers/net/fjes
362 #define TRACE_INCLUDE_FILE fjes_trace
364 /* This part must be outside protection */
365 #include <trace/define_trace.h>