1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_VIRTGPU_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
3 #define _VIRTGPU_TRACE_H_
5 #include <linux/tracepoint.h>
8 #define TRACE_SYSTEM virtio_gpu
9 #define TRACE_INCLUDE_FILE virtgpu_trace
11 DECLARE_EVENT_CLASS(virtio_gpu_cmd
,
12 TP_PROTO(struct virtqueue
*vq
, struct virtio_gpu_ctrl_hdr
*hdr
),
16 __field(unsigned int, vq
)
17 __field(const char *, name
)
20 __field(u64
, fence_id
)
24 __entry
->dev
= vq
->vdev
->index
;
25 __entry
->vq
= vq
->index
;
26 __entry
->name
= vq
->name
;
27 __entry
->type
= le32_to_cpu(hdr
->type
);
28 __entry
->flags
= le32_to_cpu(hdr
->flags
);
29 __entry
->fence_id
= le64_to_cpu(hdr
->fence_id
);
30 __entry
->ctx_id
= le32_to_cpu(hdr
->ctx_id
);
32 TP_printk("vdev=%d vq=%u name=%s type=0x%x flags=0x%x fence_id=%llu ctx_id=%u",
33 __entry
->dev
, __entry
->vq
, __entry
->name
,
34 __entry
->type
, __entry
->flags
, __entry
->fence_id
,
38 DEFINE_EVENT(virtio_gpu_cmd
, virtio_gpu_cmd_queue
,
39 TP_PROTO(struct virtqueue
*vq
, struct virtio_gpu_ctrl_hdr
*hdr
),
43 DEFINE_EVENT(virtio_gpu_cmd
, virtio_gpu_cmd_response
,
44 TP_PROTO(struct virtqueue
*vq
, struct virtio_gpu_ctrl_hdr
*hdr
),
50 #undef TRACE_INCLUDE_PATH
51 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/virtio
52 #include <trace/define_trace.h>