2 * FUJITSU Extended Socket Network Device driver
3 * Copyright (c) 2015-2016 FUJITSU LIMITED
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, see <http://www.gnu.org/licenses/>.
17 * The full GNU General Public License is included in this distribution in
18 * the file called "COPYING".
22 #if !defined(FJES_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
25 #include <linux/types.h>
26 #include <linux/tracepoint.h>
29 #define TRACE_SYSTEM fjes
31 /* tracepoints for fjes_hw.c */
33 TRACE_EVENT(fjes_hw_issue_request_command
,
34 TP_PROTO(union REG_CR
*cr
, union REG_CS
*cs
, int timeout
,
35 enum fjes_dev_command_response_e ret
),
36 TP_ARGS(cr
, cs
, timeout
, ret
),
40 __field(u16
, cr_err_info
)
41 __field(u8
, cr_req_start
)
44 __field(u8
, cs_complete
)
49 __entry
->cr_req
= cr
->bits
.req_code
;
50 __entry
->cr_error
= cr
->bits
.error
;
51 __entry
->cr_err_info
= cr
->bits
.err_info
;
52 __entry
->cr_req_start
= cr
->bits
.req_start
;
53 __entry
->cs_req
= cs
->bits
.req_code
;
54 __entry
->cs_busy
= cs
->bits
.busy
;
55 __entry
->cs_complete
= cs
->bits
.complete
;
56 __entry
->timeout
= timeout
;
59 TP_printk("CR=[req=%04x, error=%u, err_info=%04x, req_start=%u], CS=[req=%04x, busy=%u, complete=%u], timeout=%d, ret=%d",
60 __entry
->cr_req
, __entry
->cr_error
, __entry
->cr_err_info
,
61 __entry
->cr_req_start
, __entry
->cs_req
, __entry
->cs_busy
,
62 __entry
->cs_complete
, __entry
->timeout
, __entry
->ret
)
65 TRACE_EVENT(fjes_hw_request_info
,
66 TP_PROTO(struct fjes_hw
*hw
, union fjes_device_command_res
*res_buf
),
71 __dynamic_array(u8
, zone
, hw
->max_epid
)
72 __dynamic_array(u8
, status
, hw
->max_epid
)
77 __entry
->length
= res_buf
->info
.length
;
78 __entry
->code
= res_buf
->info
.code
;
79 for (x
= 0; x
< hw
->max_epid
; x
++) {
80 *((u8
*)__get_dynamic_array(zone
) + x
) =
81 res_buf
->info
.info
[x
].zone
;
82 *((u8
*)__get_dynamic_array(status
) + x
) =
83 res_buf
->info
.info
[x
].es_status
;
86 TP_printk("res_buf=[length=%d, code=%d, es_zones=%s, es_status=%s]",
87 __entry
->length
, __entry
->code
,
88 __print_array(__get_dynamic_array(zone
),
89 __get_dynamic_array_len(zone
) / sizeof(u8
),
91 __print_array(__get_dynamic_array(status
),
92 __get_dynamic_array_len(status
) / sizeof(u8
),
96 TRACE_EVENT(fjes_hw_request_info_err
,
103 __assign_str(err
, err
);
105 TP_printk("%s", __get_str(err
))
108 TRACE_EVENT(fjes_hw_register_buff_addr_req
,
109 TP_PROTO(union fjes_device_command_req
*req_buf
,
110 struct ep_share_mem_info
*buf_pair
),
111 TP_ARGS(req_buf
, buf_pair
),
116 __field(size_t, tx_size
)
118 __field(size_t, rx_size
)
123 tx
= (void *)buf_pair
->tx
.buffer
;
124 rx
= (void *)buf_pair
->rx
.buffer
;
125 __entry
->length
= req_buf
->share_buffer
.length
;
126 __entry
->epid
= req_buf
->share_buffer
.epid
;
127 __entry
->tx_size
= buf_pair
->tx
.size
;
128 __entry
->rx_size
= buf_pair
->rx
.size
;
129 __entry
->tx
= page_to_phys(vmalloc_to_page(tx
)) +
131 __entry
->rx
= page_to_phys(vmalloc_to_page(rx
)) +
134 TP_printk("req_buf=[length=%d, epid=%d], TX=[phy=0x%016llx, size=%zu], RX=[phy=0x%016llx, size=%zu]",
135 __entry
->length
, __entry
->epid
, __entry
->tx
, __entry
->tx_size
,
136 __entry
->rx
, __entry
->rx_size
)
139 TRACE_EVENT(fjes_hw_register_buff_addr
,
140 TP_PROTO(union fjes_device_command_res
*res_buf
, int timeout
),
141 TP_ARGS(res_buf
, timeout
),
145 __field(int, timeout
)
148 __entry
->length
= res_buf
->share_buffer
.length
;
149 __entry
->code
= res_buf
->share_buffer
.code
;
150 __entry
->timeout
= timeout
;
152 TP_printk("res_buf=[length=%d, code=%d], timeout=%d",
153 __entry
->length
, __entry
->code
, __entry
->timeout
)
156 TRACE_EVENT(fjes_hw_register_buff_addr_err
,
163 __assign_str(err
, err
);
165 TP_printk("%s", __get_str(err
))
168 TRACE_EVENT(fjes_hw_unregister_buff_addr_req
,
169 TP_PROTO(union fjes_device_command_req
*req_buf
),
176 __entry
->length
= req_buf
->unshare_buffer
.length
;
177 __entry
->epid
= req_buf
->unshare_buffer
.epid
;
179 TP_printk("req_buf=[length=%d, epid=%d]",
180 __entry
->length
, __entry
->epid
)
183 TRACE_EVENT(fjes_hw_unregister_buff_addr
,
184 TP_PROTO(union fjes_device_command_res
*res_buf
, int timeout
),
185 TP_ARGS(res_buf
, timeout
),
189 __field(int, timeout
)
192 __entry
->length
= res_buf
->unshare_buffer
.length
;
193 __entry
->code
= res_buf
->unshare_buffer
.code
;
194 __entry
->timeout
= timeout
;
196 TP_printk("res_buf=[length=%d, code=%d], timeout=%d",
197 __entry
->length
, __entry
->code
, __entry
->timeout
)
200 TRACE_EVENT(fjes_hw_unregister_buff_addr_err
,
207 __assign_str(err
, err
);
209 TP_printk("%s", __get_str(err
))
212 TRACE_EVENT(fjes_hw_start_debug_req
,
213 TP_PROTO(union fjes_device_command_req
*req_buf
),
218 __field(phys_addr_t
, buffer
)
221 __entry
->length
= req_buf
->start_trace
.length
;
222 __entry
->mode
= req_buf
->start_trace
.mode
;
223 __entry
->buffer
= req_buf
->start_trace
.buffer
[0];
225 TP_printk("req_buf=[length=%d, mode=%d, buffer=%pap]",
226 __entry
->length
, __entry
->mode
, &__entry
->buffer
)
229 TRACE_EVENT(fjes_hw_start_debug
,
230 TP_PROTO(union fjes_device_command_res
*res_buf
),
237 __entry
->length
= res_buf
->start_trace
.length
;
238 __entry
->code
= res_buf
->start_trace
.code
;
240 TP_printk("res_buf=[length=%d, code=%d]", __entry
->length
, __entry
->code
)
243 TRACE_EVENT(fjes_hw_start_debug_err
,
250 __assign_str(err
, err
)
252 TP_printk("%s", __get_str(err
))
255 TRACE_EVENT(fjes_hw_stop_debug
,
256 TP_PROTO(union fjes_device_command_res
*res_buf
),
263 __entry
->length
= res_buf
->stop_trace
.length
;
264 __entry
->code
= res_buf
->stop_trace
.code
;
266 TP_printk("res_buf=[length=%d, code=%d]", __entry
->length
, __entry
->code
)
269 TRACE_EVENT(fjes_hw_stop_debug_err
,
276 __assign_str(err
, err
)
278 TP_printk("%s", __get_str(err
))
281 /* tracepoints for fjes_main.c */
283 TRACE_EVENT(fjes_txrx_stop_req_irq_pre
,
284 TP_PROTO(struct fjes_hw
*hw
, int src_epid
,
285 enum ep_partner_status status
),
286 TP_ARGS(hw
, src_epid
, status
),
288 __field(int, src_epid
)
289 __field(enum ep_partner_status
, status
)
290 __field(u8
, ep_status
)
291 __field(unsigned long, txrx_stop_req_bit
)
292 __field(u16
, rx_status
)
295 __entry
->src_epid
= src_epid
;
296 __entry
->status
= status
;
297 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
298 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
300 hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
302 TP_printk("epid=%d, partner_status=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
303 __entry
->src_epid
, __entry
->status
, __entry
->ep_status
,
304 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
307 TRACE_EVENT(fjes_txrx_stop_req_irq_post
,
308 TP_PROTO(struct fjes_hw
*hw
, int src_epid
),
309 TP_ARGS(hw
, src_epid
),
311 __field(int, src_epid
)
312 __field(u8
, ep_status
)
313 __field(unsigned long, txrx_stop_req_bit
)
314 __field(u16
, rx_status
)
317 __entry
->src_epid
= src_epid
;
318 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
319 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
320 __entry
->rx_status
= hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
322 TP_printk("epid=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
323 __entry
->src_epid
, __entry
->ep_status
,
324 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
327 TRACE_EVENT(fjes_stop_req_irq_pre
,
328 TP_PROTO(struct fjes_hw
*hw
, int src_epid
,
329 enum ep_partner_status status
),
330 TP_ARGS(hw
, src_epid
, status
),
332 __field(int, src_epid
)
333 __field(enum ep_partner_status
, status
)
334 __field(u8
, ep_status
)
335 __field(unsigned long, txrx_stop_req_bit
)
336 __field(u16
, rx_status
)
339 __entry
->src_epid
= src_epid
;
340 __entry
->status
= status
;
341 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
342 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
344 hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
346 TP_printk("epid=%d, partner_status=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
347 __entry
->src_epid
, __entry
->status
, __entry
->ep_status
,
348 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
351 TRACE_EVENT(fjes_stop_req_irq_post
,
352 TP_PROTO(struct fjes_hw
*hw
, int src_epid
),
353 TP_ARGS(hw
, src_epid
),
355 __field(int, src_epid
)
356 __field(u8
, ep_status
)
357 __field(unsigned long, txrx_stop_req_bit
)
358 __field(u16
, rx_status
)
361 __entry
->src_epid
= src_epid
;
362 __entry
->ep_status
= hw
->hw_info
.share
->ep_status
[src_epid
];
363 __entry
->txrx_stop_req_bit
= hw
->txrx_stop_req_bit
;
365 hw
->ep_shm_info
[src_epid
].tx
.info
->v1i
.rx_status
;
367 TP_printk("epid=%d, ep_status=%x, txrx_stop_req_bit=%016lx, tx.rx_status=%08x",
368 __entry
->src_epid
, __entry
->ep_status
,
369 __entry
->txrx_stop_req_bit
, __entry
->rx_status
)
372 #endif /* FJES_TRACE_H_ */
374 #undef TRACE_INCLUDE_PATH
375 #undef TRACE_INCLUDE_FILE
376 #define TRACE_INCLUDE_PATH ../../../drivers/net/fjes
377 #define TRACE_INCLUDE_FILE fjes_trace
379 /* This part must be outside protection */
380 #include <trace/define_trace.h>