drm/i915: Convert some trace events to DEFINE_TRACE
authorLi Zefan <lizf@cn.fujitsu.com>
Thu, 11 Mar 2010 08:41:45 +0000 (16:41 +0800)
committerEric Anholt <eric@anholt.net>
Fri, 9 Apr 2010 21:16:34 +0000 (14:16 -0700)
Use DECLARE_EVENT_CLASS to remove duplicate code:

   text    data     bss     dec     hex filename
  14655    2732      15   17402    43fa i915_trace_points.o.orig
  11625    2732      10   14367    381f i915_trace_points.o

8 events are converted:

  i915_gem_object:  i915_gem_object_{unbind, destroy}
  i915_gem_request: i915_gem_request_{complete, retire, wait_begin, wait_end}
  i915_ring:        i915_ring_{wait_begin, wait_end}

No functional change.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_trace.h

index 01840d9bc38fa8b58401841caf795301beb8b795..303815321c797afbe4072be00630e44037a7aaa8 100644 (file)
@@ -115,7 +115,7 @@ TRACE_EVENT(i915_gem_object_get_fence,
                      __entry->obj, __entry->fence, __entry->tiling_mode)
 );
 
-TRACE_EVENT(i915_gem_object_unbind,
+DECLARE_EVENT_CLASS(i915_gem_object,
 
            TP_PROTO(struct drm_gem_object *obj),
 
@@ -132,21 +132,18 @@ TRACE_EVENT(i915_gem_object_unbind,
            TP_printk("obj=%p", __entry->obj)
 );
 
-TRACE_EVENT(i915_gem_object_destroy,
+DEFINE_EVENT(i915_gem_object, i915_gem_object_unbind,
 
            TP_PROTO(struct drm_gem_object *obj),
 
-           TP_ARGS(obj),
+           TP_ARGS(obj)
+);
 
-           TP_STRUCT__entry(
-                            __field(struct drm_gem_object *, obj)
-                            ),
+DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy,
 
-           TP_fast_assign(
-                          __entry->obj = obj;
-                          ),
+           TP_PROTO(struct drm_gem_object *obj),
 
-           TP_printk("obj=%p", __entry->obj)
+           TP_ARGS(obj)
 );
 
 /* batch tracing */
@@ -197,8 +194,7 @@ TRACE_EVENT(i915_gem_request_flush,
                      __entry->flush_domains, __entry->invalidate_domains)
 );
 
-
-TRACE_EVENT(i915_gem_request_complete,
+DECLARE_EVENT_CLASS(i915_gem_request,
 
            TP_PROTO(struct drm_device *dev, u32 seqno),
 
@@ -217,64 +213,35 @@ TRACE_EVENT(i915_gem_request_complete,
            TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
 );
 
-TRACE_EVENT(i915_gem_request_retire,
+DEFINE_EVENT(i915_gem_request, i915_gem_request_complete,
 
            TP_PROTO(struct drm_device *dev, u32 seqno),
 
-           TP_ARGS(dev, seqno),
-
-           TP_STRUCT__entry(
-                            __field(u32, dev)
-                            __field(u32, seqno)
-                            ),
-
-           TP_fast_assign(
-                          __entry->dev = dev->primary->index;
-                          __entry->seqno = seqno;
-                          ),
-
-           TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
+           TP_ARGS(dev, seqno)
 );
 
-TRACE_EVENT(i915_gem_request_wait_begin,
+DEFINE_EVENT(i915_gem_request, i915_gem_request_retire,
 
            TP_PROTO(struct drm_device *dev, u32 seqno),
 
-           TP_ARGS(dev, seqno),
-
-           TP_STRUCT__entry(
-                            __field(u32, dev)
-                            __field(u32, seqno)
-                            ),
-
-           TP_fast_assign(
-                          __entry->dev = dev->primary->index;
-                          __entry->seqno = seqno;
-                          ),
-
-           TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
+           TP_ARGS(dev, seqno)
 );
 
-TRACE_EVENT(i915_gem_request_wait_end,
+DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_begin,
 
            TP_PROTO(struct drm_device *dev, u32 seqno),
 
-           TP_ARGS(dev, seqno),
+           TP_ARGS(dev, seqno)
+);
 
-           TP_STRUCT__entry(
-                            __field(u32, dev)
-                            __field(u32, seqno)
-                            ),
+DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end,
 
-           TP_fast_assign(
-                          __entry->dev = dev->primary->index;
-                          __entry->seqno = seqno;
-                          ),
+           TP_PROTO(struct drm_device *dev, u32 seqno),
 
-           TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
+           TP_ARGS(dev, seqno)
 );
 
-TRACE_EVENT(i915_ring_wait_begin,
+DECLARE_EVENT_CLASS(i915_ring,
 
            TP_PROTO(struct drm_device *dev),
 
@@ -291,21 +258,18 @@ TRACE_EVENT(i915_ring_wait_begin,
            TP_printk("dev=%u", __entry->dev)
 );
 
-TRACE_EVENT(i915_ring_wait_end,
+DEFINE_EVENT(i915_ring, i915_ring_wait_begin,
 
            TP_PROTO(struct drm_device *dev),
 
-           TP_ARGS(dev),
+           TP_ARGS(dev)
+);
 
-           TP_STRUCT__entry(
-                            __field(u32, dev)
-                            ),
+DEFINE_EVENT(i915_ring, i915_ring_wait_end,
 
-           TP_fast_assign(
-                          __entry->dev = dev->primary->index;
-                          ),
+           TP_PROTO(struct drm_device *dev),
 
-           TP_printk("dev=%u", __entry->dev)
+           TP_ARGS(dev)
 );
 
 #endif /* _I915_TRACE_H_ */