diff mbox series

[1/6] drm: trace: Make the vblank queued/delivered events classed

Message ID 20191107210316.143216-2-sean@poorly.run (mailing list archive)
State New, archived
Headers show
Series drm: trace: Introduce drm_trace() and instrument drm_atomic.c | expand

Commit Message

Sean Paul Nov. 7, 2019, 9:03 p.m. UTC
From: Sean Paul <seanpaul@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@chromium.org>
---
 drivers/gpu/drm/drm_trace.h | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)
diff mbox series

Patch

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_ */