[PATCH 1/6] drm: trace: Make the vblank queued/delivered events classed
Sean Paul
sean at poorly.run
Thu Nov 7 21:03:00 UTC 2019
From: Sean Paul <seanpaul at chromium.org>
We can use an event class to remove some boilerplate for the event
queued/delivered trace events.
Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
drivers/gpu/drm/drm_trace.h | 27 +++++++++------------------
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/drm_trace.h b/drivers/gpu/drm/drm_trace.h
index 11c6dd577e8ed..487bc3478efec 100644
--- a/drivers/gpu/drm/drm_trace.h
+++ b/drivers/gpu/drm/drm_trace.h
@@ -32,7 +32,7 @@ TRACE_EVENT(drm_vblank_event,
__entry->high_prec ? "true" : "false")
);
-TRACE_EVENT(drm_vblank_event_queued,
+DECLARE_EVENT_CLASS(class_drm_vblank_event,
TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
TP_ARGS(file, crtc, seq),
TP_STRUCT__entry(
@@ -45,25 +45,16 @@ TRACE_EVENT(drm_vblank_event_queued,
__entry->crtc = crtc;
__entry->seq = seq;
),
- TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc, \
+ TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc,
__entry->seq)
);
-
-TRACE_EVENT(drm_vblank_event_delivered,
- TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
- TP_ARGS(file, crtc, seq),
- TP_STRUCT__entry(
- __field(struct drm_file *, file)
- __field(int, crtc)
- __field(unsigned int, seq)
- ),
- TP_fast_assign(
- __entry->file = file;
- __entry->crtc = crtc;
- __entry->seq = seq;
- ),
- TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc, \
- __entry->seq)
+DEFINE_EVENT(class_drm_vblank_event, drm_vblank_event_queued,
+ TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
+ TP_ARGS(file, crtc, seq)
+);
+DEFINE_EVENT(class_drm_vblank_event, drm_vblank_event_delivered,
+ TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
+ TP_ARGS(file, crtc, seq)
);
#endif /* _DRM_TRACE_H_ */
--
Sean Paul, Software Engineer, Google / Chromium OS
More information about the dri-devel
mailing list