diff options
author | Dave Airlie <airlied@redhat.com> | 2010-11-22 20:47:49 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-12-15 23:37:47 -0500 |
commit | 99ee7fac189893c90145a22b86bbcfdc98f69a9c (patch) | |
tree | 2719e044984e4d8cceb93e7e18f79ded48c7b685 | |
parent | f7eb0c55416aba7478932cedbaccc2bdacd8a95d (diff) |
drm/radeon: add initial tracepoint support.
this adds a bo create, and fence seq tracking tracepoints.
This is just an initial set to play around with, we should investigate
what others we need would be useful.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/Makefile | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fence.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_trace.h | 82 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_trace_points.c | 9 |
5 files changed, 101 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile index 6cae4f2028d..e97e6f84269 100644 --- a/drivers/gpu/drm/radeon/Makefile +++ b/drivers/gpu/drm/radeon/Makefile | |||
@@ -65,10 +65,13 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \ | |||
65 | rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ | 65 | rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ |
66 | r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ | 66 | r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ |
67 | r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ | 67 | r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ |
68 | evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o | 68 | evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o \ |
69 | radeon_trace_points.o | ||
69 | 70 | ||
70 | radeon-$(CONFIG_COMPAT) += radeon_ioc32.o | 71 | radeon-$(CONFIG_COMPAT) += radeon_ioc32.o |
71 | radeon-$(CONFIG_VGA_SWITCHEROO) += radeon_atpx_handler.o | 72 | radeon-$(CONFIG_VGA_SWITCHEROO) += radeon_atpx_handler.o |
72 | radeon-$(CONFIG_ACPI) += radeon_acpi.o | 73 | radeon-$(CONFIG_ACPI) += radeon_acpi.o |
73 | 74 | ||
74 | obj-$(CONFIG_DRM_RADEON)+= radeon.o | 75 | obj-$(CONFIG_DRM_RADEON)+= radeon.o |
76 | |||
77 | CFLAGS_radeon_trace_points.o := -I$(src) \ No newline at end of file | ||
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index daacb281dfa..171b0b2e3a6 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "drm.h" | 38 | #include "drm.h" |
39 | #include "radeon_reg.h" | 39 | #include "radeon_reg.h" |
40 | #include "radeon.h" | 40 | #include "radeon.h" |
41 | #include "radeon_trace.h" | ||
41 | 42 | ||
42 | int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence) | 43 | int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence) |
43 | { | 44 | { |
@@ -57,6 +58,7 @@ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence) | |||
57 | } else | 58 | } else |
58 | radeon_fence_ring_emit(rdev, fence); | 59 | radeon_fence_ring_emit(rdev, fence); |
59 | 60 | ||
61 | trace_radeon_fence_emit(rdev->ddev, fence->seq); | ||
60 | fence->emited = true; | 62 | fence->emited = true; |
61 | list_del(&fence->list); | 63 | list_del(&fence->list); |
62 | list_add_tail(&fence->list, &rdev->fence_drv.emited); | 64 | list_add_tail(&fence->list, &rdev->fence_drv.emited); |
@@ -213,6 +215,7 @@ int radeon_fence_wait(struct radeon_fence *fence, bool intr) | |||
213 | retry: | 215 | retry: |
214 | /* save current sequence used to check for GPU lockup */ | 216 | /* save current sequence used to check for GPU lockup */ |
215 | seq = rdev->fence_drv.last_seq; | 217 | seq = rdev->fence_drv.last_seq; |
218 | trace_radeon_fence_wait_begin(rdev->ddev, seq); | ||
216 | if (intr) { | 219 | if (intr) { |
217 | radeon_irq_kms_sw_irq_get(rdev); | 220 | radeon_irq_kms_sw_irq_get(rdev); |
218 | r = wait_event_interruptible_timeout(rdev->fence_drv.queue, | 221 | r = wait_event_interruptible_timeout(rdev->fence_drv.queue, |
@@ -227,6 +230,7 @@ retry: | |||
227 | radeon_fence_signaled(fence), timeout); | 230 | radeon_fence_signaled(fence), timeout); |
228 | radeon_irq_kms_sw_irq_put(rdev); | 231 | radeon_irq_kms_sw_irq_put(rdev); |
229 | } | 232 | } |
233 | trace_radeon_fence_wait_end(rdev->ddev, seq); | ||
230 | if (unlikely(!radeon_fence_signaled(fence))) { | 234 | if (unlikely(!radeon_fence_signaled(fence))) { |
231 | /* we were interrupted for some reason and fence isn't | 235 | /* we were interrupted for some reason and fence isn't |
232 | * isn't signaled yet, resume wait | 236 | * isn't signaled yet, resume wait |
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index a8594d289bc..8bdf0ba2983 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <drm/drmP.h> | 34 | #include <drm/drmP.h> |
35 | #include "radeon_drm.h" | 35 | #include "radeon_drm.h" |
36 | #include "radeon.h" | 36 | #include "radeon.h" |
37 | #include "radeon_trace.h" | ||
37 | 38 | ||
38 | 39 | ||
39 | int radeon_ttm_init(struct radeon_device *rdev); | 40 | int radeon_ttm_init(struct radeon_device *rdev); |
@@ -137,6 +138,7 @@ retry: | |||
137 | list_add_tail(&bo->list, &rdev->gem.objects); | 138 | list_add_tail(&bo->list, &rdev->gem.objects); |
138 | mutex_unlock(&bo->rdev->gem.mutex); | 139 | mutex_unlock(&bo->rdev->gem.mutex); |
139 | } | 140 | } |
141 | trace_radeon_bo_create(bo); | ||
140 | return 0; | 142 | return 0; |
141 | } | 143 | } |
142 | 144 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_trace.h b/drivers/gpu/drm/radeon/radeon_trace.h new file mode 100644 index 00000000000..eafd8160a15 --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_trace.h | |||
@@ -0,0 +1,82 @@ | |||
1 | #if !defined(_RADEON_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _RADEON_TRACE_H_ | ||
3 | |||
4 | #include <linux/stringify.h> | ||
5 | #include <linux/types.h> | ||
6 | #include <linux/tracepoint.h> | ||
7 | |||
8 | #include <drm/drmP.h> | ||
9 | |||
10 | #undef TRACE_SYSTEM | ||
11 | #define TRACE_SYSTEM radeon | ||
12 | #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM) | ||
13 | #define TRACE_INCLUDE_FILE radeon_trace | ||
14 | |||
15 | TRACE_EVENT(radeon_bo_create, | ||
16 | TP_PROTO(struct radeon_bo *bo), | ||
17 | TP_ARGS(bo), | ||
18 | TP_STRUCT__entry( | ||
19 | __field(struct radeon_bo *, bo) | ||
20 | __field(u32, pages) | ||
21 | ), | ||
22 | |||
23 | TP_fast_assign( | ||
24 | __entry->bo = bo; | ||
25 | __entry->pages = bo->tbo.num_pages; | ||
26 | ), | ||
27 | TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages) | ||
28 | ); | ||
29 | |||
30 | DECLARE_EVENT_CLASS(radeon_fence_request, | ||
31 | |||
32 | TP_PROTO(struct drm_device *dev, u32 seqno), | ||
33 | |||
34 | TP_ARGS(dev, seqno), | ||
35 | |||
36 | TP_STRUCT__entry( | ||
37 | __field(u32, dev) | ||
38 | __field(u32, seqno) | ||
39 | ), | ||
40 | |||
41 | TP_fast_assign( | ||
42 | __entry->dev = dev->primary->index; | ||
43 | __entry->seqno = seqno; | ||
44 | ), | ||
45 | |||
46 | TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno) | ||
47 | ); | ||
48 | |||
49 | DEFINE_EVENT(radeon_fence_request, radeon_fence_emit, | ||
50 | |||
51 | TP_PROTO(struct drm_device *dev, u32 seqno), | ||
52 | |||
53 | TP_ARGS(dev, seqno) | ||
54 | ); | ||
55 | |||
56 | DEFINE_EVENT(radeon_fence_request, radeon_fence_retire, | ||
57 | |||
58 | TP_PROTO(struct drm_device *dev, u32 seqno), | ||
59 | |||
60 | TP_ARGS(dev, seqno) | ||
61 | ); | ||
62 | |||
63 | DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_begin, | ||
64 | |||
65 | TP_PROTO(struct drm_device *dev, u32 seqno), | ||
66 | |||
67 | TP_ARGS(dev, seqno) | ||
68 | ); | ||
69 | |||
70 | DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_end, | ||
71 | |||
72 | TP_PROTO(struct drm_device *dev, u32 seqno), | ||
73 | |||
74 | TP_ARGS(dev, seqno) | ||
75 | ); | ||
76 | |||
77 | #endif | ||
78 | |||
79 | /* This part must be outside protection */ | ||
80 | #undef TRACE_INCLUDE_PATH | ||
81 | #define TRACE_INCLUDE_PATH . | ||
82 | #include <trace/define_trace.h> | ||
diff --git a/drivers/gpu/drm/radeon/radeon_trace_points.c b/drivers/gpu/drm/radeon/radeon_trace_points.c new file mode 100644 index 00000000000..8175993df84 --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_trace_points.c | |||
@@ -0,0 +1,9 @@ | |||
1 | /* Copyright Red Hat Inc 2010. | ||
2 | * Author : Dave Airlie <airlied@redhat.com> | ||
3 | */ | ||
4 | #include <drm/drmP.h> | ||
5 | #include "radeon_drm.h" | ||
6 | #include "radeon.h" | ||
7 | |||
8 | #define CREATE_TRACE_POINTS | ||
9 | #include "radeon_trace.h" | ||