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