1*c1d5fb01SMatwey V. Kornilov /* SPDX-License-Identifier: GPL-2.0 */ 2*c1d5fb01SMatwey V. Kornilov #if !defined(_TRACE_PWC_H) || defined(TRACE_HEADER_MULTI_READ) 3*c1d5fb01SMatwey V. Kornilov #define _TRACE_PWC_H 4*c1d5fb01SMatwey V. Kornilov 5*c1d5fb01SMatwey V. Kornilov #include <linux/usb.h> 6*c1d5fb01SMatwey V. Kornilov #include <linux/tracepoint.h> 7*c1d5fb01SMatwey V. Kornilov 8*c1d5fb01SMatwey V. Kornilov #undef TRACE_SYSTEM 9*c1d5fb01SMatwey V. Kornilov #define TRACE_SYSTEM pwc 10*c1d5fb01SMatwey V. Kornilov 11*c1d5fb01SMatwey V. Kornilov TRACE_EVENT(pwc_handler_enter, 12*c1d5fb01SMatwey V. Kornilov TP_PROTO(struct urb *urb, struct pwc_device *pdev), 13*c1d5fb01SMatwey V. Kornilov TP_ARGS(urb, pdev), 14*c1d5fb01SMatwey V. Kornilov TP_STRUCT__entry( 15*c1d5fb01SMatwey V. Kornilov __field(struct urb*, urb) 16*c1d5fb01SMatwey V. Kornilov __field(struct pwc_frame_buf*, fbuf) 17*c1d5fb01SMatwey V. Kornilov __field(int, urb__status) 18*c1d5fb01SMatwey V. Kornilov __field(u32, urb__actual_length) 19*c1d5fb01SMatwey V. Kornilov __field(int, fbuf__filled) 20*c1d5fb01SMatwey V. Kornilov __string(name, pdev->v4l2_dev.name) 21*c1d5fb01SMatwey V. Kornilov ), 22*c1d5fb01SMatwey V. Kornilov TP_fast_assign( 23*c1d5fb01SMatwey V. Kornilov __entry->urb = urb; 24*c1d5fb01SMatwey V. Kornilov __entry->fbuf = pdev->fill_buf; 25*c1d5fb01SMatwey V. Kornilov __entry->urb__status = urb->status; 26*c1d5fb01SMatwey V. Kornilov __entry->urb__actual_length = urb->actual_length; 27*c1d5fb01SMatwey V. Kornilov __entry->fbuf__filled = (pdev->fill_buf 28*c1d5fb01SMatwey V. Kornilov ? pdev->fill_buf->filled : 0); 29*c1d5fb01SMatwey V. Kornilov __assign_str(name, pdev->v4l2_dev.name); 30*c1d5fb01SMatwey V. Kornilov ), 31*c1d5fb01SMatwey V. Kornilov TP_printk("dev=%s (fbuf=%p filled=%d) urb=%p (status=%d actual_length=%u)", 32*c1d5fb01SMatwey V. Kornilov __get_str(name), 33*c1d5fb01SMatwey V. Kornilov __entry->fbuf, 34*c1d5fb01SMatwey V. Kornilov __entry->fbuf__filled, 35*c1d5fb01SMatwey V. Kornilov __entry->urb, 36*c1d5fb01SMatwey V. Kornilov __entry->urb__status, 37*c1d5fb01SMatwey V. Kornilov __entry->urb__actual_length) 38*c1d5fb01SMatwey V. Kornilov ); 39*c1d5fb01SMatwey V. Kornilov 40*c1d5fb01SMatwey V. Kornilov TRACE_EVENT(pwc_handler_exit, 41*c1d5fb01SMatwey V. Kornilov TP_PROTO(struct urb *urb, struct pwc_device *pdev), 42*c1d5fb01SMatwey V. Kornilov TP_ARGS(urb, pdev), 43*c1d5fb01SMatwey V. Kornilov TP_STRUCT__entry( 44*c1d5fb01SMatwey V. Kornilov __field(struct urb*, urb) 45*c1d5fb01SMatwey V. Kornilov __field(struct pwc_frame_buf*, fbuf) 46*c1d5fb01SMatwey V. Kornilov __field(int, fbuf__filled) 47*c1d5fb01SMatwey V. Kornilov __string(name, pdev->v4l2_dev.name) 48*c1d5fb01SMatwey V. Kornilov ), 49*c1d5fb01SMatwey V. Kornilov TP_fast_assign( 50*c1d5fb01SMatwey V. Kornilov __entry->urb = urb; 51*c1d5fb01SMatwey V. Kornilov __entry->fbuf = pdev->fill_buf; 52*c1d5fb01SMatwey V. Kornilov __entry->fbuf__filled = pdev->fill_buf->filled; 53*c1d5fb01SMatwey V. Kornilov __assign_str(name, pdev->v4l2_dev.name); 54*c1d5fb01SMatwey V. Kornilov ), 55*c1d5fb01SMatwey V. Kornilov TP_printk(" dev=%s (fbuf=%p filled=%d) urb=%p", 56*c1d5fb01SMatwey V. Kornilov __get_str(name), 57*c1d5fb01SMatwey V. Kornilov __entry->fbuf, 58*c1d5fb01SMatwey V. Kornilov __entry->fbuf__filled, 59*c1d5fb01SMatwey V. Kornilov __entry->urb) 60*c1d5fb01SMatwey V. Kornilov ); 61*c1d5fb01SMatwey V. Kornilov 62*c1d5fb01SMatwey V. Kornilov #endif /* _TRACE_PWC_H */ 63*c1d5fb01SMatwey V. Kornilov 64*c1d5fb01SMatwey V. Kornilov /* This part must be outside protection */ 65*c1d5fb01SMatwey V. Kornilov #include <trace/define_trace.h> 66