pwc.h 1.7 KB

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