18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#if !defined(_TRACE_PWC_H) || defined(TRACE_HEADER_MULTI_READ)
38c2ecf20Sopenharmony_ci#define _TRACE_PWC_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/usb.h>
68c2ecf20Sopenharmony_ci#include <linux/tracepoint.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#undef TRACE_SYSTEM
98c2ecf20Sopenharmony_ci#define TRACE_SYSTEM pwc
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciTRACE_EVENT(pwc_handler_enter,
128c2ecf20Sopenharmony_ci	TP_PROTO(struct urb *urb, struct pwc_device *pdev),
138c2ecf20Sopenharmony_ci	TP_ARGS(urb, pdev),
148c2ecf20Sopenharmony_ci	TP_STRUCT__entry(
158c2ecf20Sopenharmony_ci		__field(struct urb*, urb)
168c2ecf20Sopenharmony_ci		__field(struct pwc_frame_buf*, fbuf)
178c2ecf20Sopenharmony_ci		__field(int, urb__status)
188c2ecf20Sopenharmony_ci		__field(u32, urb__actual_length)
198c2ecf20Sopenharmony_ci		__field(int, fbuf__filled)
208c2ecf20Sopenharmony_ci		__string(name, pdev->v4l2_dev.name)
218c2ecf20Sopenharmony_ci	),
228c2ecf20Sopenharmony_ci	TP_fast_assign(
238c2ecf20Sopenharmony_ci		__entry->urb = urb;
248c2ecf20Sopenharmony_ci		__entry->fbuf = pdev->fill_buf;
258c2ecf20Sopenharmony_ci		__entry->urb__status = urb->status;
268c2ecf20Sopenharmony_ci		__entry->urb__actual_length = urb->actual_length;
278c2ecf20Sopenharmony_ci		__entry->fbuf__filled = (pdev->fill_buf
288c2ecf20Sopenharmony_ci					 ? pdev->fill_buf->filled : 0);
298c2ecf20Sopenharmony_ci		__assign_str(name, pdev->v4l2_dev.name);
308c2ecf20Sopenharmony_ci	),
318c2ecf20Sopenharmony_ci	TP_printk("dev=%s (fbuf=%p filled=%d) urb=%p (status=%d actual_length=%u)",
328c2ecf20Sopenharmony_ci		__get_str(name),
338c2ecf20Sopenharmony_ci		__entry->fbuf,
348c2ecf20Sopenharmony_ci		__entry->fbuf__filled,
358c2ecf20Sopenharmony_ci		__entry->urb,
368c2ecf20Sopenharmony_ci		__entry->urb__status,
378c2ecf20Sopenharmony_ci		__entry->urb__actual_length)
388c2ecf20Sopenharmony_ci);
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciTRACE_EVENT(pwc_handler_exit,
418c2ecf20Sopenharmony_ci	TP_PROTO(struct urb *urb, struct pwc_device *pdev),
428c2ecf20Sopenharmony_ci	TP_ARGS(urb, pdev),
438c2ecf20Sopenharmony_ci	TP_STRUCT__entry(
448c2ecf20Sopenharmony_ci		__field(struct urb*, urb)
458c2ecf20Sopenharmony_ci		__field(struct pwc_frame_buf*, fbuf)
468c2ecf20Sopenharmony_ci		__field(int, fbuf__filled)
478c2ecf20Sopenharmony_ci		__string(name, pdev->v4l2_dev.name)
488c2ecf20Sopenharmony_ci	),
498c2ecf20Sopenharmony_ci	TP_fast_assign(
508c2ecf20Sopenharmony_ci		__entry->urb = urb;
518c2ecf20Sopenharmony_ci		__entry->fbuf = pdev->fill_buf;
528c2ecf20Sopenharmony_ci		__entry->fbuf__filled = pdev->fill_buf->filled;
538c2ecf20Sopenharmony_ci		__assign_str(name, pdev->v4l2_dev.name);
548c2ecf20Sopenharmony_ci	),
558c2ecf20Sopenharmony_ci	TP_printk(" dev=%s (fbuf=%p filled=%d) urb=%p",
568c2ecf20Sopenharmony_ci		__get_str(name),
578c2ecf20Sopenharmony_ci		__entry->fbuf,
588c2ecf20Sopenharmony_ci		__entry->fbuf__filled,
598c2ecf20Sopenharmony_ci		__entry->urb)
608c2ecf20Sopenharmony_ci);
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#endif /* _TRACE_PWC_H */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/* This part must be outside protection */
658c2ecf20Sopenharmony_ci#include <trace/define_trace.h>
66