xref: /linux/drivers/usb/gadget/function/uvc_trace.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * trace.h - USB UVC Gadget Trace Support
4  *
5  * Copyright (C) 2024 Pengutronix e.K.
6  *
7  * Author: Michael Grzeschik <m.grzeschik@pengutronix.de>
8  */
9 
10 #undef TRACE_SYSTEM
11 #define TRACE_SYSTEM uvcg
12 
13 #if !defined(__UVCG_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
14 #define __UVCG_TRACE_H
15 
16 #include <linux/types.h>
17 #include <linux/tracepoint.h>
18 #include <linux/usb/gadget.h>
19 #include <asm/byteorder.h>
20 
21 DECLARE_EVENT_CLASS(uvcg_video_req,
22 	TP_PROTO(struct usb_request *req, u32 queued),
23 	TP_ARGS(req, queued),
24 	TP_STRUCT__entry(
25 		__field(struct usb_request *, req)
26 		__field(u32, length)
27 		__field(u32, queued)
28 	),
29 	TP_fast_assign(
30 		__entry->req = req;
31 		__entry->length = req->length;
32 		__entry->queued = queued;
33 	),
34 	TP_printk("req %p length %u queued %u",
35 		__entry->req,
36 		__entry->length,
37 		__entry->queued)
38 );
39 
40 DEFINE_EVENT(uvcg_video_req, uvcg_video_complete,
41 	TP_PROTO(struct usb_request *req, u32 queued),
42 	TP_ARGS(req, queued)
43 );
44 
45 DEFINE_EVENT(uvcg_video_req, uvcg_video_queue,
46 	TP_PROTO(struct usb_request *req, u32 queued),
47 	TP_ARGS(req, queued)
48 );
49 
50 #endif /* __UVCG_TRACE_H */
51 
52 /* this part has to be here */
53 
54 #undef TRACE_INCLUDE_PATH
55 #define TRACE_INCLUDE_PATH .
56 
57 #undef TRACE_INCLUDE_FILE
58 #define TRACE_INCLUDE_FILE uvc_trace
59 
60 #include <trace/define_trace.h>
61