summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/uvc_trace.h
blob: 04c33cf43cc2d4915befbd0e29aee2baaa701ea8 (plain) (blame)
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
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * trace.h - USB UVC Gadget Trace Support
 *
 * Copyright (C) 2024 Pengutronix e.K.
 *
 * Author: Michael Grzeschik <m.grzeschik@pengutronix.de>
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM uvcg

#if !defined(__UVCG_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define __UVCG_TRACE_H

#include <linux/types.h>
#include <linux/tracepoint.h>
#include <linux/usb/gadget.h>
#include <asm/byteorder.h>

DECLARE_EVENT_CLASS(uvcg_video_req,
	TP_PROTO(struct usb_request *req, u32 queued),
	TP_ARGS(req, queued),
	TP_STRUCT__entry(
		__field(struct usb_request *, req)
		__field(u32, length)
		__field(u32, queued)
	),
	TP_fast_assign(
		__entry->req = req;
		__entry->length = req->length;
		__entry->queued = queued;
	),
	TP_printk("req %p length %u queued %u",
		__entry->req,
		__entry->length,
		__entry->queued)
);

DEFINE_EVENT(uvcg_video_req, uvcg_video_complete,
	TP_PROTO(struct usb_request *req, u32 queued),
	TP_ARGS(req, queued)
);

DEFINE_EVENT(uvcg_video_req, uvcg_video_queue,
	TP_PROTO(struct usb_request *req, u32 queued),
	TP_ARGS(req, queued)
);

#endif /* __UVCG_TRACE_H */

/* this part has to be here */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .

#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE uvc_trace

#include <trace/define_trace.h>