summaryrefslogtreecommitdiff
path: root/include/trace/events/pwc.h
blob: a2da764a3b41205d6b9062fd3535265c70647e5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* SPDX-License-Identifier: GPL-2.0 */
#if !defined(_TRACE_PWC_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_PWC_H

#include <linux/usb.h>
#include <linux/tracepoint.h>

#undef TRACE_SYSTEM
#define TRACE_SYSTEM pwc

TRACE_EVENT(pwc_handler_enter,
	TP_PROTO(struct urb *urb, struct pwc_device *pdev),
	TP_ARGS(urb, pdev),
	TP_STRUCT__entry(
		__field(struct urb*, urb)
		__field(struct pwc_frame_buf*, fbuf)
		__field(int, urb__status)
		__field(u32, urb__actual_length)
		__field(int, fbuf__filled)
		__string(name, pdev->v4l2_dev.name)
	),
	TP_fast_assign(
		__entry->urb = urb;
		__entry->fbuf = pdev->fill_buf;
		__entry->urb__status = urb->status;
		__entry->urb__actual_length = urb->actual_length;
		__entry->fbuf__filled = (pdev->fill_buf
					 ? pdev->fill_buf->filled : 0);
		__assign_str(name, pdev->v4l2_dev.name);
	),
	TP_printk("dev=%s (fbuf=%p filled=%d) urb=%p (status=%d actual_length=%u)",
		__get_str(name),
		__entry->fbuf,
		__entry->fbuf__filled,
		__entry->urb,
		__entry->urb__status,
		__entry->urb__actual_length)
);

TRACE_EVENT(pwc_handler_exit,
	TP_PROTO(struct urb *urb, struct pwc_device *pdev),
	TP_ARGS(urb, pdev),
	TP_STRUCT__entry(
		__field(struct urb*, urb)
		__field(struct pwc_frame_buf*, fbuf)
		__field(int, fbuf__filled)
		__string(name, pdev->v4l2_dev.name)
	),
	TP_fast_assign(
		__entry->urb = urb;
		__entry->fbuf = pdev->fill_buf;
		__entry->fbuf__filled = pdev->fill_buf->filled;
		__assign_str(name, pdev->v4l2_dev.name);
	),
	TP_printk(" dev=%s (fbuf=%p filled=%d) urb=%p",
		__get_str(name),
		__entry->fbuf,
		__entry->fbuf__filled,
		__entry->urb)
);

#endif /* _TRACE_PWC_H */

/* This part must be outside protection */
#include <trace/define_trace.h>