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>
This commit is contained in:
parent
f7eb0c5541
commit
99ee7fac18
|
@ -65,10 +65,13 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \
|
|||
rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \
|
||||
r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \
|
||||
r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \
|
||||
evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o
|
||||
evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o \
|
||||
radeon_trace_points.o
|
||||
|
||||
radeon-$(CONFIG_COMPAT) += radeon_ioc32.o
|
||||
radeon-$(CONFIG_VGA_SWITCHEROO) += radeon_atpx_handler.o
|
||||
radeon-$(CONFIG_ACPI) += radeon_acpi.o
|
||||
|
||||
obj-$(CONFIG_DRM_RADEON)+= radeon.o
|
||||
|
||||
CFLAGS_radeon_trace_points.o := -I$(src)
|
|
@ -38,6 +38,7 @@
|
|||
#include "drm.h"
|
||||
#include "radeon_reg.h"
|
||||
#include "radeon.h"
|
||||
#include "radeon_trace.h"
|
||||
|
||||
int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence)
|
||||
{
|
||||
|
@ -57,6 +58,7 @@ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence)
|
|||
} else
|
||||
radeon_fence_ring_emit(rdev, fence);
|
||||
|
||||
trace_radeon_fence_emit(rdev->ddev, fence->seq);
|
||||
fence->emited = true;
|
||||
list_del(&fence->list);
|
||||
list_add_tail(&fence->list, &rdev->fence_drv.emited);
|
||||
|
@ -213,6 +215,7 @@ int radeon_fence_wait(struct radeon_fence *fence, bool intr)
|
|||
retry:
|
||||
/* save current sequence used to check for GPU lockup */
|
||||
seq = rdev->fence_drv.last_seq;
|
||||
trace_radeon_fence_wait_begin(rdev->ddev, seq);
|
||||
if (intr) {
|
||||
radeon_irq_kms_sw_irq_get(rdev);
|
||||
r = wait_event_interruptible_timeout(rdev->fence_drv.queue,
|
||||
|
@ -227,6 +230,7 @@ retry:
|
|||
radeon_fence_signaled(fence), timeout);
|
||||
radeon_irq_kms_sw_irq_put(rdev);
|
||||
}
|
||||
trace_radeon_fence_wait_end(rdev->ddev, seq);
|
||||
if (unlikely(!radeon_fence_signaled(fence))) {
|
||||
/* we were interrupted for some reason and fence isn't
|
||||
* isn't signaled yet, resume wait
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <drm/drmP.h>
|
||||
#include "radeon_drm.h"
|
||||
#include "radeon.h"
|
||||
#include "radeon_trace.h"
|
||||
|
||||
|
||||
int radeon_ttm_init(struct radeon_device *rdev);
|
||||
|
@ -137,6 +138,7 @@ retry:
|
|||
list_add_tail(&bo->list, &rdev->gem.objects);
|
||||
mutex_unlock(&bo->rdev->gem.mutex);
|
||||
}
|
||||
trace_radeon_bo_create(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
82
drivers/gpu/drm/radeon/radeon_trace.h
Normal file
82
drivers/gpu/drm/radeon/radeon_trace.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
#if !defined(_RADEON_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _RADEON_TRACE_H_
|
||||
|
||||
#include <linux/stringify.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#include <drm/drmP.h>
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM radeon
|
||||
#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
|
||||
#define TRACE_INCLUDE_FILE radeon_trace
|
||||
|
||||
TRACE_EVENT(radeon_bo_create,
|
||||
TP_PROTO(struct radeon_bo *bo),
|
||||
TP_ARGS(bo),
|
||||
TP_STRUCT__entry(
|
||||
__field(struct radeon_bo *, bo)
|
||||
__field(u32, pages)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->bo = bo;
|
||||
__entry->pages = bo->tbo.num_pages;
|
||||
),
|
||||
TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages)
|
||||
);
|
||||
|
||||
DECLARE_EVENT_CLASS(radeon_fence_request,
|
||||
|
||||
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)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(radeon_fence_request, radeon_fence_emit,
|
||||
|
||||
TP_PROTO(struct drm_device *dev, u32 seqno),
|
||||
|
||||
TP_ARGS(dev, seqno)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(radeon_fence_request, radeon_fence_retire,
|
||||
|
||||
TP_PROTO(struct drm_device *dev, u32 seqno),
|
||||
|
||||
TP_ARGS(dev, seqno)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_begin,
|
||||
|
||||
TP_PROTO(struct drm_device *dev, u32 seqno),
|
||||
|
||||
TP_ARGS(dev, seqno)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_end,
|
||||
|
||||
TP_PROTO(struct drm_device *dev, u32 seqno),
|
||||
|
||||
TP_ARGS(dev, seqno)
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH .
|
||||
#include <trace/define_trace.h>
|
9
drivers/gpu/drm/radeon/radeon_trace_points.c
Normal file
9
drivers/gpu/drm/radeon/radeon_trace_points.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
/* Copyright Red Hat Inc 2010.
|
||||
* Author : Dave Airlie <airlied@redhat.com>
|
||||
*/
|
||||
#include <drm/drmP.h>
|
||||
#include "radeon_drm.h"
|
||||
#include "radeon.h"
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include "radeon_trace.h"
|
Loading…
Reference in a new issue