More amdgpu trace patches
Subsystems (2)
PATCH 1/1 More amdgpu trace patches
These are some of the extra changes Christian was requesting in the previous ftrace thread.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170310022554.4509-1-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 1/5 drm/amd/sched: add a unique job id to amd_sched_job
A unique id is useful for debugging and tracing. Intended to replace pointers in ftrace output.
--- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 2 ++ drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +2 -0
@@ -452,20 +452,21 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job)/* init a sched_job with basic field */ int amd_sched_job_init (struct amd_sched_job *job,struct amd_gpu_scheduler *sched,struct amd_sched_entity *entity,void *owner) { job->sched = sched; job->s_entity = entity; job->s_fence =amd_sched_fence_create (entity, owner); + job->id =atomic64_inc_return (&sched->job_id_count);if (!job->s_fence)return -ENOMEM ;INIT_WORK (&job->finish_work, amd_sched_job_finish);INIT_LIST_HEAD (&job->node);INIT_DELAYED_WORK (&job->work_tdr, amd_sched_job_timedout);return 0 ; }
@@ -609,20 +610,21 @@ int amd_sched_init(struct amd_gpu_scheduler *sched, sched->name = name; sched->timeout = timeout;for (i =0 ; i <AMD_SCHED_MAX_PRIORITY ; i++)amd_sched_rq_init (&sched->sched_rq[i]);init_waitqueue_head (&sched->wake_up_worker);init_waitqueue_head (&sched->job_scheduled);INIT_LIST_HEAD (&sched->ring_mirror_list);spin_lock_init (&sched->job_list_lock);atomic_set (&sched->hw_rq_count,0 ); +atomic64_set (&sched->job_id_count,0 );/* Each scheduler will run on a seperate kernel thread */ sched->thread =kthread_run (amd_sched_main, sched, sched->name);if (IS_ERR (sched->thread)) {DRM_ERROR ("Failed to create scheduler for %s.\n" , name);return PTR_ERR (sched->thread); }return 0 ; }
drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +2 -0
@@ -73,20 +73,21 @@ struct amd_sched_fence { };struct amd_sched_job {struct amd_gpu_scheduler *sched;struct amd_sched_entity *s_entity;struct amd_sched_fence *s_fence;struct dma_fence_cb finish_cb;struct work_struct finish_work;struct list_head node;struct delayed_work work_tdr; +uint64_t id; };extern const struct dma_fence_ops amd_sched_fence_ops_scheduled;extern const struct dma_fence_ops amd_sched_fence_ops_finished;static inline struct amd_sched_fence *to_amd_sched_fence (struct dma_fence *f) {if (f->ops == &amd_sched_fence_ops_scheduled) return container_of(f, struct amd_sched_fence, scheduled);if (f->ops == &amd_sched_fence_ops_finished)
@@ -117,20 +118,21 @@ enum amd_sched_priority {*/ struct amd_gpu_scheduler {const struct amd_sched_backend_ops *ops;uint32_t hw_submission_limit;long timeout;const char *name;struct amd_sched_rq sched_rq[AMD_SCHED_MAX_PRIORITY ];wait_queue_head_t wake_up_worker;wait_queue_head_t job_scheduled;atomic_t hw_rq_count; +atomic64_t job_id_count;struct task_struct *thread;struct list_head ring_mirror_list;spinlock_t job_list_lock; };int amd_sched_init (struct amd_gpu_scheduler *sched,const struct amd_sched_backend_ops *ops,uint32_t hw_submission,long timeout,const char *name);void amd_sched_fini (struct amd_gpu_scheduler *sched);
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/5 drm/amdgpu: more ftrace formatting consistency fixes
In reply to a message not in the archiveConsistent formatting makes it easier to read the logs and apply simple awk oneliners.
I missed some of these on my last patch.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +5 -5
@@ -63,21 +63,21 @@ TRACE_EVENT(amdgpu_bo_create,TP_fast_assign ( __entry->bo = bo; __entry->pages = bo->tbo.num_pages; __entry->type = bo->tbo.mem.mem_type; __entry->prefer = bo->prefered_domains; __entry->allow = bo->allowed_domains; __entry->visible = bo->flags; ), -TP_printk ("bo=%p,pages=%u,type=%d,prefered=%d,allowed=%d,visible=%d" , +TP_printk ("bo=%p, pages=%u, type=%d, prefered=%d, allowed=%d, visible=%d" , __entry->bo, __entry->pages, __entry->type, __entry->prefer, __entry->allow, __entry->visible) ); TRACE_EVENT(amdgpu_cs, TP_PROTO(struct amdgpu_cs_parser *p, int i), TP_ARGS(p, i), TP_STRUCT__entry( __field(struct amdgpu_bo_list *, bo_list) __field(u32, ring)
@@ -110,21 +110,21 @@ TRACE_EVENT(amdgpu_cs_ioctl, ), TP_fast_assign( __entry->adev = job->adev; __entry->sched_job = &job->base; __entry->ib = job->ibs; __entry->fence = &job->base.s_fence->finished; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("adev=%p, sched_job=%p, first ib=%p, sched fence=%p, ring name:%s, num_ibs:%u" , +TP_printk ("adev=%p, sched_job=%p, first_ib=%p, sched_fence=%p, ring_name=%s, num_ibs=%u" , __entry->adev, __entry->sched_job, __entry->ib, __entry->fence, __entry->ring_name, __entry->num_ibs) ); TRACE_EVENT(amdgpu_sched_run_job, TP_PROTO(struct amdgpu_job *job), TP_ARGS(job), TP_STRUCT__entry( __field(struct amdgpu_device *, adev) __field(struct amd_sched_job *, sched_job)
@@ -141,21 +141,21 @@ TRACE_EVENT(amdgpu_sched_run_job, __entry->adev = job->adev; __entry->sched_job = &job->base; __entry->ib = job->ibs; __entry->fence = &job->base.s_fence->finished;__assign_str (timeline, job->base.s_fence->finished.ops->get_timeline_name (&job->base.s_fence->finished)) __entry->context = job->base.s_fence->finished.context; __entry->seqno = job->base.s_fence->finished.seqno; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("adev=%p, sched_job=%p, first ib=%p, sched fence=%p, timeline=%s, context=%u, seqno=%u, ring name=%s, num_ibs=%u" , +TP_printk ("adev=%p, sched_job=%p, first_ib=%p, sched_fence=%p, timeline=%s, context=%u, seqno=%u, ring_name=%s, num_ibs=%u" , __entry->adev, __entry->sched_job, __entry->ib, __entry->fence,__get_str (timeline), __entry->context, __entry->seqno, __entry->ring_name, __entry->num_ibs) ); TRACE_EVENT(amdgpu_vm_grab_id, TP_PROTO(struct amdgpu_vm *vm, int ring, struct amdgpu_job *job), TP_ARGS(vm, ring, job), TP_STRUCT__entry(
@@ -321,39 +321,39 @@ TRACE_EVENT(amdgpu_bo_list_set, __field(struct amdgpu_bo_list *, list) __field(struct amdgpu_bo *, bo) __field(u64, bo_size) ),TP_fast_assign ( __entry->list = list; __entry->bo = bo; __entry->bo_size =amdgpu_bo_size (bo); ), -TP_printk ("list=%p, bo=%p, bo_size = %Ld" , +TP_printk ("list=%p, bo=%p, bo_size=%Ld" , __entry->list, __entry->bo, __entry->bo_size) );TRACE_EVENT (amdgpu_cs_bo_status, TP_PROTO(uint64_t total_bo, uint64_t total_size),TP_ARGS (total_bo, total_size),TP_STRUCT__entry ( __field(u64, total_bo)__field (u64, total_size) ),TP_fast_assign ( __entry->total_bo = total_bo; __entry->total_size = total_size; ), -TP_printk ("total bo size = %Ld, total bo count = %Ld" , +TP_printk ("total_bo_size=%Ld, total_bo_count=%Ld" , __entry->total_bo, __entry->total_size) ); TRACE_EVENT(amdgpu_ttm_bo_move, TP_PROTO(struct amdgpu_bo* bo, uint32_t new_placement, uint32_t old_placement), TP_ARGS(bo, new_placement, old_placement), TP_STRUCT__entry( __field(struct amdgpu_bo *, bo) __field(u64, bo_size) __field(u32, new_placement)
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/5 drm/amdgpu: use sched_job id instead of pointer for tracing
In reply to a message not in the archivePointers get reallocated and they are hard to read for humans. Use ids instead.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +8 -8
@@ -95,68 +95,68 @@ TRACE_EVENT(amdgpu_cs,TP_printk ("bo_list=%p, ring=%u, dw=%u, fences=%u" , __entry->bo_list, __entry->ring, __entry->dw, __entry->fences) );TRACE_EVENT (amdgpu_cs_ioctl, TP_PROTO(struct amdgpu_job *job),TP_ARGS (job),TP_STRUCT__entry ( __field(struct amdgpu_device *, adev) - __field(struct amd_sched_job *, sched_job) + __field(uint64_t, sched_job_id) __field(struct amdgpu_ib *, ib) __field(struct dma_fence *, fence) __field(char *, ring_name)__field (u32, num_ibs) ),TP_fast_assign ( __entry->adev = job->adev; - __entry->sched_job = &job->base; + __entry->sched_job_id = job->base.id; __entry->ib = job->ibs; __entry->fence = &job->base.s_fence->finished; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("adev=%p, sched_job=%p, first_ib=%p, sched_fence=%p, ring_name=%s, num_ibs=%u" , - __entry->adev, __entry->sched_job, __entry->ib, +TP_printk ("adev=%p, sched_job=%llu, first_ib=%p, sched_fence=%p, ring_name=%s, num_ibs=%u" , + __entry->adev, __entry->sched_job_id, __entry->ib, __entry->fence, __entry->ring_name, __entry->num_ibs) );TRACE_EVENT (amdgpu_sched_run_job, TP_PROTO(struct amdgpu_job *job),TP_ARGS (job),TP_STRUCT__entry ( __field(struct amdgpu_device *, adev) - __field(struct amd_sched_job *, sched_job) + __field(uint64_t, sched_job_id) __field(struct amdgpu_ib *, ib) __field(struct dma_fence *, fence) __string(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno) __field(char *, ring_name)__field (u32, num_ibs) ),TP_fast_assign ( __entry->adev = job->adev; - __entry->sched_job = &job->base; + __entry->sched_job_id = job->base.id; __entry->ib = job->ibs; __entry->fence = &job->base.s_fence->finished; __assign_str(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) __entry->context = job->base.s_fence->finished.context; __entry->seqno = job->base.s_fence->finished.seqno; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("adev=%p, sched_job=%p, first_ib=%p, sched_fence=%p, timeline=%s, context=%u, seqno=%u, ring_name=%s, num_ibs=%u" , - __entry->adev, __entry->sched_job, __entry->ib, +TP_printk ("adev=%p, sched_job=%llu, first_ib=%p, sched_fence=%p, timeline=%s, context=%u, seqno=%u, ring_name=%s, num_ibs=%u" , + __entry->adev, __entry->sched_job_id, __entry->ib, __entry->fence,__get_str (timeline), __entry->context, __entry->seqno, __entry->ring_name, __entry->num_ibs) ); TRACE_EVENT(amdgpu_vm_grab_id, TP_PROTO(struct amdgpu_vm *vm, int ring, struct amdgpu_job *job), TP_ARGS(vm, ring, job), TP_STRUCT__entry( __field(struct amdgpu_vm *, vm)
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/5 drm/amdgpu: remove useless pointers from traces
In reply to a message not in the archiveRemove pointers which provide redundant information which is already easier to deduce from other fields.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +5 -16
@@ -94,71 +94,60 @@ TRACE_EVENT(amdgpu_cs, ),TP_printk ("bo_list=%p, ring=%u, dw=%u, fences=%u" , __entry->bo_list, __entry->ring, __entry->dw, __entry->fences) );TRACE_EVENT (amdgpu_cs_ioctl, TP_PROTO(struct amdgpu_job *job),TP_ARGS (job),TP_STRUCT__entry ( - __field(struct amdgpu_device *, adev) __field(uint64_t, sched_job_id) - __field(struct amdgpu_ib *, ib) __field(struct dma_fence *, fence) __field(char *, ring_name)__field (u32, num_ibs) ),TP_fast_assign ( - __entry->adev = job->adev; __entry->sched_job_id = job->base.id; - __entry->ib = job->ibs; __entry->fence = &job->base.s_fence->finished; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("adev=%p, sched_job=%llu, first_ib=%p, sched_fence=%p, ring_name=%s, num_ibs=%u" , - __entry->adev, __entry->sched_job_id, __entry->ib, +TP_printk ("sched_job=%llu, sched_fence=%p, ring_name=%s, num_ibs=%u" , + __entry->sched_job_id, __entry->fence, __entry->ring_name, __entry->num_ibs) );TRACE_EVENT (amdgpu_sched_run_job, TP_PROTO(struct amdgpu_job *job),TP_ARGS (job),TP_STRUCT__entry ( - __field(struct amdgpu_device *, adev) __field(uint64_t, sched_job_id) - __field(struct amdgpu_ib *, ib) - __field(struct dma_fence *, fence) __string(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno) __field(char *, ring_name)__field (u32, num_ibs) ),TP_fast_assign ( - __entry->adev = job->adev; __entry->sched_job_id = job->base.id; - __entry->ib = job->ibs; - __entry->fence = &job->base.s_fence->finished; __assign_str(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) __entry->context = job->base.s_fence->finished.context; __entry->seqno = job->base.s_fence->finished.seqno; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("adev=%p, sched_job=%llu, first_ib=%p, sched_fence=%p, timeline=%s, context=%u, seqno=%u, ring_name=%s, num_ibs=%u" , - __entry->adev, __entry->sched_job_id, __entry->ib, - __entry->fence,__get_str (timeline), __entry->context, __entry->seqno, - __entry->ring_name, __entry->num_ibs) +TP_printk ("sched_job=%llu, timeline=%s, context=%u, seqno=%u, ring_name=%s, num_ibs=%u" , + __entry->sched_job_id,__get_str (timeline), __entry->context, + __entry->seqno, __entry->ring_name, __entry->num_ibs) ); TRACE_EVENT(amdgpu_vm_grab_id, TP_PROTO(struct amdgpu_vm *vm, int ring, struct amdgpu_job *job), TP_ARGS(vm, ring, job), TP_STRUCT__entry( __field(struct amdgpu_vm *, vm) __field(u32, ring) __field(u32, vmid)
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/5 drm/amdgpu: replace fence pointer with fence data in traces
In reply to a message not in the archiveFence data is easier to read and allows us to correlate to identify corresponding dma_fence ftrace events.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +9 -4
@@ -95,34 +95,39 @@ TRACE_EVENT(amdgpu_cs,TP_printk ("bo_list=%p, ring=%u, dw=%u, fences=%u" , __entry->bo_list, __entry->ring, __entry->dw, __entry->fences) );TRACE_EVENT (amdgpu_cs_ioctl, TP_PROTO(struct amdgpu_job *job),TP_ARGS (job),TP_STRUCT__entry ( __field(uint64_t, sched_job_id) + __string(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) + __field(unsigned int, context) + __field(unsigned int, seqno) __field(struct dma_fence *, fence) __field(char *, ring_name)__field (u32, num_ibs) ),TP_fast_assign ( __entry->sched_job_id = job->base.id; - __entry->fence = &job->base.s_fence->finished; + __assign_str(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) + __entry->context = job->base.s_fence->finished.context; + __entry->seqno = job->base.s_fence->finished.seqno; __entry->ring_name = job->ring->name; __entry->num_ibs = job->num_ibs; ), -TP_printk ("sched_job=%llu, sched_fence=%p, ring_name=%s, num_ibs=%u" , - __entry->sched_job_id, - __entry->fence, __entry->ring_name, __entry->num_ibs) +TP_printk ("sched_job=%llu, timeline=%s, context=%u, seqno=%u, ring_name=%s, num_ibs=%u" , + __entry->sched_job_id,__get_str (timeline), __entry->context, + __entry->seqno, __entry->ring_name, __entry->num_ibs) ); TRACE_EVENT(amdgpu_sched_run_job, TP_PROTO(struct amdgpu_job *job), TP_ARGS(job), TP_STRUCT__entry( __field(uint64_t, sched_job_id) __string(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno)
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
nice patches, the set is Reviewed-by: Chunming Zhou <[email protected]>
Quoted 7 lines · Andres Rodriguez
These are some of the extra changes Christian was requesting in the previous ftrace thread.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Am 10.03.2017 um 03:51 schrieb zhoucm1:
Quoted 1 line
nice patches, the set is Reviewed-by: Chunming Zhou <[email protected]>
Indeed looks good to me as well, but a few lines seems to be to long.
Please throw the patches into checkpatch.pl and at least try to fix any fallout.
With that done the patches are Reviewed-by: Christian König <[email protected]> as well.
Regards,
Christian.
Quoted 10 lines · Andres Rodriguez
Quoted 7 lines
These are some of the extra changes Christian was requesting in the previous ftrace thread.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx