2017-12-01 09:29:47 +07:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-04-21 03:55:21 +07:00
|
|
|
#if !defined(_AMDGPU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _AMDGPU_TRACE_H_
|
|
|
|
|
|
|
|
#include <linux/stringify.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM amdgpu
|
|
|
|
#define TRACE_INCLUDE_FILE amdgpu_trace
|
|
|
|
|
2017-03-11 22:50:34 +07:00
|
|
|
#define AMDGPU_JOB_GET_TIMELINE_NAME(job) \
|
|
|
|
job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)
|
|
|
|
|
2016-05-31 19:02:27 +07:00
|
|
|
TRACE_EVENT(amdgpu_mm_rreg,
|
|
|
|
TP_PROTO(unsigned did, uint32_t reg, uint32_t value),
|
|
|
|
TP_ARGS(did, reg, value),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned, did)
|
|
|
|
__field(uint32_t, reg)
|
|
|
|
__field(uint32_t, value)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->did = did;
|
|
|
|
__entry->reg = reg;
|
|
|
|
__entry->value = value;
|
|
|
|
),
|
2016-12-14 22:52:00 +07:00
|
|
|
TP_printk("0x%04lx, 0x%08lx, 0x%08lx",
|
2016-05-31 19:02:27 +07:00
|
|
|
(unsigned long)__entry->did,
|
|
|
|
(unsigned long)__entry->reg,
|
|
|
|
(unsigned long)__entry->value)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(amdgpu_mm_wreg,
|
|
|
|
TP_PROTO(unsigned did, uint32_t reg, uint32_t value),
|
|
|
|
TP_ARGS(did, reg, value),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned, did)
|
|
|
|
__field(uint32_t, reg)
|
|
|
|
__field(uint32_t, value)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->did = did;
|
|
|
|
__entry->reg = reg;
|
|
|
|
__entry->value = value;
|
|
|
|
),
|
2016-12-14 22:52:00 +07:00
|
|
|
TP_printk("0x%04lx, 0x%08lx, 0x%08lx",
|
2016-05-31 19:02:27 +07:00
|
|
|
(unsigned long)__entry->did,
|
|
|
|
(unsigned long)__entry->reg,
|
|
|
|
(unsigned long)__entry->value)
|
|
|
|
);
|
|
|
|
|
2016-12-06 15:41:55 +07:00
|
|
|
TRACE_EVENT(amdgpu_iv,
|
2018-09-26 18:37:24 +07:00
|
|
|
TP_PROTO(unsigned ih, struct amdgpu_iv_entry *iv),
|
|
|
|
TP_ARGS(ih, iv),
|
2016-12-06 15:41:55 +07:00
|
|
|
TP_STRUCT__entry(
|
2018-09-26 18:37:24 +07:00
|
|
|
__field(unsigned, ih)
|
2016-12-06 15:41:55 +07:00
|
|
|
__field(unsigned, client_id)
|
|
|
|
__field(unsigned, src_id)
|
|
|
|
__field(unsigned, ring_id)
|
2017-12-18 23:08:25 +07:00
|
|
|
__field(unsigned, vmid)
|
|
|
|
__field(unsigned, vmid_src)
|
2016-12-06 15:41:55 +07:00
|
|
|
__field(uint64_t, timestamp)
|
|
|
|
__field(unsigned, timestamp_src)
|
2018-01-10 01:47:37 +07:00
|
|
|
__field(unsigned, pasid)
|
2016-12-06 15:41:55 +07:00
|
|
|
__array(unsigned, src_data, 4)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
2018-09-26 18:37:24 +07:00
|
|
|
__entry->ih = ih;
|
2016-12-06 15:41:55 +07:00
|
|
|
__entry->client_id = iv->client_id;
|
|
|
|
__entry->src_id = iv->src_id;
|
|
|
|
__entry->ring_id = iv->ring_id;
|
2017-12-18 23:08:25 +07:00
|
|
|
__entry->vmid = iv->vmid;
|
|
|
|
__entry->vmid_src = iv->vmid_src;
|
2016-12-06 15:41:55 +07:00
|
|
|
__entry->timestamp = iv->timestamp;
|
|
|
|
__entry->timestamp_src = iv->timestamp_src;
|
2018-01-10 01:47:37 +07:00
|
|
|
__entry->pasid = iv->pasid;
|
2016-12-06 15:41:55 +07:00
|
|
|
__entry->src_data[0] = iv->src_data[0];
|
|
|
|
__entry->src_data[1] = iv->src_data[1];
|
|
|
|
__entry->src_data[2] = iv->src_data[2];
|
|
|
|
__entry->src_data[3] = iv->src_data[3];
|
|
|
|
),
|
2018-09-26 18:37:24 +07:00
|
|
|
TP_printk("ih:%u client_id:%u src_id:%u ring:%u vmid:%u "
|
|
|
|
"timestamp: %llu pasid:%u src_data: %08x %08x %08x %08x",
|
|
|
|
__entry->ih, __entry->client_id, __entry->src_id,
|
2017-12-18 23:08:25 +07:00
|
|
|
__entry->ring_id, __entry->vmid,
|
2018-01-10 01:47:37 +07:00
|
|
|
__entry->timestamp, __entry->pasid,
|
2016-12-06 15:41:55 +07:00
|
|
|
__entry->src_data[0], __entry->src_data[1],
|
|
|
|
__entry->src_data[2], __entry->src_data[3])
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2015-04-21 03:55:21 +07:00
|
|
|
TRACE_EVENT(amdgpu_bo_create,
|
|
|
|
TP_PROTO(struct amdgpu_bo *bo),
|
|
|
|
TP_ARGS(bo),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct amdgpu_bo *, bo)
|
|
|
|
__field(u32, pages)
|
2016-06-07 16:43:51 +07:00
|
|
|
__field(u32, type)
|
|
|
|
__field(u32, prefer)
|
|
|
|
__field(u32, allow)
|
|
|
|
__field(u32, visible)
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->bo = bo;
|
|
|
|
__entry->pages = bo->tbo.num_pages;
|
2016-06-07 16:43:51 +07:00
|
|
|
__entry->type = bo->tbo.mem.mem_type;
|
2017-08-08 18:58:01 +07:00
|
|
|
__entry->prefer = bo->preferred_domains;
|
2016-06-07 16:43:51 +07:00
|
|
|
__entry->allow = bo->allowed_domains;
|
|
|
|
__entry->visible = bo->flags;
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
2016-06-07 16:43:51 +07:00
|
|
|
|
2017-08-08 18:58:01 +07:00
|
|
|
TP_printk("bo=%p, pages=%u, type=%d, preferred=%d, allowed=%d, visible=%d",
|
2016-06-07 16:43:51 +07:00
|
|
|
__entry->bo, __entry->pages, __entry->type,
|
|
|
|
__entry->prefer, __entry->allow, __entry->visible)
|
2015-04-21 03:55:21 +07:00
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(amdgpu_cs,
|
|
|
|
TP_PROTO(struct amdgpu_cs_parser *p, int i),
|
|
|
|
TP_ARGS(p, i),
|
|
|
|
TP_STRUCT__entry(
|
2015-06-11 00:21:14 +07:00
|
|
|
__field(struct amdgpu_bo_list *, bo_list)
|
2015-04-21 03:55:21 +07:00
|
|
|
__field(u32, ring)
|
|
|
|
__field(u32, dw)
|
|
|
|
__field(u32, fences)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2015-06-11 00:21:14 +07:00
|
|
|
__entry->bo_list = p->bo_list;
|
2018-07-19 19:22:25 +07:00
|
|
|
__entry->ring = to_amdgpu_ring(p->entity->rq->sched)->idx;
|
2016-02-03 19:44:52 +07:00
|
|
|
__entry->dw = p->job->ibs[i].length_dw;
|
2015-04-21 03:55:21 +07:00
|
|
|
__entry->fences = amdgpu_fence_count_emitted(
|
2018-07-19 19:22:25 +07:00
|
|
|
to_amdgpu_ring(p->entity->rq->sched));
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
2015-06-11 00:21:14 +07:00
|
|
|
TP_printk("bo_list=%p, ring=%u, dw=%u, fences=%u",
|
|
|
|
__entry->bo_list, __entry->ring, __entry->dw,
|
2015-04-21 03:55:21 +07:00
|
|
|
__entry->fences)
|
|
|
|
);
|
|
|
|
|
2015-11-11 13:56:00 +07:00
|
|
|
TRACE_EVENT(amdgpu_cs_ioctl,
|
|
|
|
TP_PROTO(struct amdgpu_job *job),
|
|
|
|
TP_ARGS(job),
|
|
|
|
TP_STRUCT__entry(
|
2017-03-10 09:25:52 +07:00
|
|
|
__field(uint64_t, sched_job_id)
|
2017-03-11 22:50:34 +07:00
|
|
|
__string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job))
|
2017-03-10 09:25:54 +07:00
|
|
|
__field(unsigned int, context)
|
|
|
|
__field(unsigned int, seqno)
|
2016-10-25 19:00:45 +07:00
|
|
|
__field(struct dma_fence *, fence)
|
2015-11-11 13:56:00 +07:00
|
|
|
__field(char *, ring_name)
|
|
|
|
__field(u32, num_ibs)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-03-10 09:25:52 +07:00
|
|
|
__entry->sched_job_id = job->base.id;
|
2017-03-11 22:50:34 +07:00
|
|
|
__assign_str(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job))
|
2017-03-10 09:25:54 +07:00
|
|
|
__entry->context = job->base.s_fence->finished.context;
|
|
|
|
__entry->seqno = job->base.s_fence->finished.seqno;
|
2018-07-13 20:08:44 +07:00
|
|
|
__entry->ring_name = to_amdgpu_ring(job->base.sched)->name;
|
2015-11-11 13:56:00 +07:00
|
|
|
__entry->num_ibs = job->num_ibs;
|
|
|
|
),
|
2017-03-10 09:25:54 +07:00
|
|
|
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)
|
2015-11-11 13:56:00 +07:00
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(amdgpu_sched_run_job,
|
|
|
|
TP_PROTO(struct amdgpu_job *job),
|
|
|
|
TP_ARGS(job),
|
|
|
|
TP_STRUCT__entry(
|
2017-03-10 09:25:52 +07:00
|
|
|
__field(uint64_t, sched_job_id)
|
2017-03-11 22:50:34 +07:00
|
|
|
__string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job))
|
2017-02-25 01:20:58 +07:00
|
|
|
__field(unsigned int, context)
|
|
|
|
__field(unsigned int, seqno)
|
2015-11-11 13:56:00 +07:00
|
|
|
__field(char *, ring_name)
|
|
|
|
__field(u32, num_ibs)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-03-10 09:25:52 +07:00
|
|
|
__entry->sched_job_id = job->base.id;
|
2017-03-11 22:50:34 +07:00
|
|
|
__assign_str(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job))
|
2017-02-25 01:20:58 +07:00
|
|
|
__entry->context = job->base.s_fence->finished.context;
|
|
|
|
__entry->seqno = job->base.s_fence->finished.seqno;
|
2018-07-13 20:08:44 +07:00
|
|
|
__entry->ring_name = to_amdgpu_ring(job->base.sched)->name;
|
2015-11-11 13:56:00 +07:00
|
|
|
__entry->num_ibs = job->num_ibs;
|
|
|
|
),
|
2017-03-10 09:25:53 +07:00
|
|
|
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)
|
2015-11-11 13:56:00 +07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2015-04-21 03:55:21 +07:00
|
|
|
TRACE_EVENT(amdgpu_vm_grab_id,
|
2017-04-07 20:31:13 +07:00
|
|
|
TP_PROTO(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
|
|
|
|
struct amdgpu_job *job),
|
2016-07-08 15:48:24 +07:00
|
|
|
TP_ARGS(vm, ring, job),
|
2015-04-21 03:55:21 +07:00
|
|
|
TP_STRUCT__entry(
|
2018-01-05 20:23:56 +07:00
|
|
|
__field(u32, pasid)
|
2018-10-30 19:04:37 +07:00
|
|
|
__string(ring, ring->name)
|
2015-04-21 03:55:21 +07:00
|
|
|
__field(u32, ring)
|
2017-12-18 23:08:25 +07:00
|
|
|
__field(u32, vmid)
|
2017-04-07 20:31:13 +07:00
|
|
|
__field(u32, vm_hub)
|
2016-02-26 22:18:36 +07:00
|
|
|
__field(u64, pd_addr)
|
2016-07-08 15:48:24 +07:00
|
|
|
__field(u32, needs_flush)
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2018-01-05 20:23:56 +07:00
|
|
|
__entry->pasid = vm->pasid;
|
2018-10-30 19:04:37 +07:00
|
|
|
__assign_str(ring, ring->name)
|
2017-12-18 23:08:25 +07:00
|
|
|
__entry->vmid = job->vmid;
|
2017-04-07 20:31:13 +07:00
|
|
|
__entry->vm_hub = ring->funcs->vmhub,
|
2016-07-08 15:48:24 +07:00
|
|
|
__entry->pd_addr = job->vm_pd_addr;
|
|
|
|
__entry->needs_flush = job->vm_needs_flush;
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
2018-10-30 19:04:37 +07:00
|
|
|
TP_printk("pasid=%d, ring=%s, id=%u, hub=%u, pd_addr=%010Lx needs_flush=%u",
|
|
|
|
__entry->pasid, __get_str(ring), __entry->vmid,
|
2017-04-07 20:31:13 +07:00
|
|
|
__entry->vm_hub, __entry->pd_addr, __entry->needs_flush)
|
2015-04-21 03:55:21 +07:00
|
|
|
);
|
|
|
|
|
2015-06-09 21:58:33 +07:00
|
|
|
TRACE_EVENT(amdgpu_vm_bo_map,
|
|
|
|
TP_PROTO(struct amdgpu_bo_va *bo_va,
|
|
|
|
struct amdgpu_bo_va_mapping *mapping),
|
|
|
|
TP_ARGS(bo_va, mapping),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct amdgpu_bo *, bo)
|
|
|
|
__field(long, start)
|
|
|
|
__field(long, last)
|
|
|
|
__field(u64, offset)
|
2017-06-28 16:06:52 +07:00
|
|
|
__field(u64, flags)
|
2015-06-09 21:58:33 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-08-01 15:51:43 +07:00
|
|
|
__entry->bo = bo_va ? bo_va->base.bo : NULL;
|
2017-03-30 19:03:59 +07:00
|
|
|
__entry->start = mapping->start;
|
|
|
|
__entry->last = mapping->last;
|
2015-06-09 21:58:33 +07:00
|
|
|
__entry->offset = mapping->offset;
|
|
|
|
__entry->flags = mapping->flags;
|
|
|
|
),
|
2017-06-28 16:06:52 +07:00
|
|
|
TP_printk("bo=%p, start=%lx, last=%lx, offset=%010llx, flags=%llx",
|
2015-06-09 21:58:33 +07:00
|
|
|
__entry->bo, __entry->start, __entry->last,
|
|
|
|
__entry->offset, __entry->flags)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(amdgpu_vm_bo_unmap,
|
|
|
|
TP_PROTO(struct amdgpu_bo_va *bo_va,
|
|
|
|
struct amdgpu_bo_va_mapping *mapping),
|
|
|
|
TP_ARGS(bo_va, mapping),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct amdgpu_bo *, bo)
|
|
|
|
__field(long, start)
|
|
|
|
__field(long, last)
|
|
|
|
__field(u64, offset)
|
2017-06-28 16:06:52 +07:00
|
|
|
__field(u64, flags)
|
2015-06-09 21:58:33 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2018-05-11 13:54:31 +07:00
|
|
|
__entry->bo = bo_va ? bo_va->base.bo : NULL;
|
2017-03-30 19:03:59 +07:00
|
|
|
__entry->start = mapping->start;
|
|
|
|
__entry->last = mapping->last;
|
2015-06-09 21:58:33 +07:00
|
|
|
__entry->offset = mapping->offset;
|
|
|
|
__entry->flags = mapping->flags;
|
|
|
|
),
|
2017-06-28 16:06:52 +07:00
|
|
|
TP_printk("bo=%p, start=%lx, last=%lx, offset=%010llx, flags=%llx",
|
2015-06-09 21:58:33 +07:00
|
|
|
__entry->bo, __entry->start, __entry->last,
|
|
|
|
__entry->offset, __entry->flags)
|
|
|
|
);
|
|
|
|
|
2015-09-28 17:00:23 +07:00
|
|
|
DECLARE_EVENT_CLASS(amdgpu_vm_mapping,
|
2015-04-21 03:55:21 +07:00
|
|
|
TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
|
|
|
|
TP_ARGS(mapping),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u64, soffset)
|
|
|
|
__field(u64, eoffset)
|
2017-06-28 16:06:52 +07:00
|
|
|
__field(u64, flags)
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-03-30 19:03:59 +07:00
|
|
|
__entry->soffset = mapping->start;
|
|
|
|
__entry->eoffset = mapping->last + 1;
|
2015-04-21 03:55:21 +07:00
|
|
|
__entry->flags = mapping->flags;
|
|
|
|
),
|
2017-06-28 16:06:52 +07:00
|
|
|
TP_printk("soffs=%010llx, eoffs=%010llx, flags=%llx",
|
2015-04-21 03:55:21 +07:00
|
|
|
__entry->soffset, __entry->eoffset, __entry->flags)
|
|
|
|
);
|
|
|
|
|
2015-09-28 17:00:23 +07:00
|
|
|
DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_update,
|
|
|
|
TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
|
|
|
|
TP_ARGS(mapping)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_mapping,
|
|
|
|
TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
|
|
|
|
TP_ARGS(mapping)
|
|
|
|
);
|
|
|
|
|
2018-07-27 21:56:34 +07:00
|
|
|
DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_cs,
|
|
|
|
TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
|
|
|
|
TP_ARGS(mapping)
|
|
|
|
);
|
|
|
|
|
2016-09-25 21:11:52 +07:00
|
|
|
TRACE_EVENT(amdgpu_vm_set_ptes,
|
2015-04-21 03:55:21 +07:00
|
|
|
TP_PROTO(uint64_t pe, uint64_t addr, unsigned count,
|
2017-06-28 16:06:52 +07:00
|
|
|
uint32_t incr, uint64_t flags),
|
2015-04-21 03:55:21 +07:00
|
|
|
TP_ARGS(pe, addr, count, incr, flags),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u64, pe)
|
|
|
|
__field(u64, addr)
|
|
|
|
__field(u32, count)
|
|
|
|
__field(u32, incr)
|
2017-06-28 16:06:52 +07:00
|
|
|
__field(u64, flags)
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->pe = pe;
|
|
|
|
__entry->addr = addr;
|
|
|
|
__entry->count = count;
|
|
|
|
__entry->incr = incr;
|
|
|
|
__entry->flags = flags;
|
|
|
|
),
|
2017-06-28 16:06:52 +07:00
|
|
|
TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%llx, count=%u",
|
2015-04-21 03:55:21 +07:00
|
|
|
__entry->pe, __entry->addr, __entry->incr,
|
|
|
|
__entry->flags, __entry->count)
|
|
|
|
);
|
|
|
|
|
2016-09-25 21:11:52 +07:00
|
|
|
TRACE_EVENT(amdgpu_vm_copy_ptes,
|
|
|
|
TP_PROTO(uint64_t pe, uint64_t src, unsigned count),
|
|
|
|
TP_ARGS(pe, src, count),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u64, pe)
|
|
|
|
__field(u64, src)
|
|
|
|
__field(u32, count)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->pe = pe;
|
|
|
|
__entry->src = src;
|
|
|
|
__entry->count = count;
|
|
|
|
),
|
|
|
|
TP_printk("pe=%010Lx, src=%010Lx, count=%u",
|
|
|
|
__entry->pe, __entry->src, __entry->count)
|
|
|
|
);
|
|
|
|
|
2015-04-21 03:55:21 +07:00
|
|
|
TRACE_EVENT(amdgpu_vm_flush,
|
2017-12-18 23:08:25 +07:00
|
|
|
TP_PROTO(struct amdgpu_ring *ring, unsigned vmid,
|
2017-04-07 22:43:19 +07:00
|
|
|
uint64_t pd_addr),
|
2017-12-18 23:08:25 +07:00
|
|
|
TP_ARGS(ring, vmid, pd_addr),
|
2015-04-21 03:55:21 +07:00
|
|
|
TP_STRUCT__entry(
|
2018-10-30 19:04:37 +07:00
|
|
|
__string(ring, ring->name)
|
2017-12-18 23:08:25 +07:00
|
|
|
__field(u32, vmid)
|
2017-04-07 22:43:19 +07:00
|
|
|
__field(u32, vm_hub)
|
|
|
|
__field(u64, pd_addr)
|
2015-04-21 03:55:21 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2018-10-30 19:04:37 +07:00
|
|
|
__assign_str(ring, ring->name)
|
2017-12-18 23:08:25 +07:00
|
|
|
__entry->vmid = vmid;
|
2017-04-07 22:43:19 +07:00
|
|
|
__entry->vm_hub = ring->funcs->vmhub;
|
2015-04-21 03:55:21 +07:00
|
|
|
__entry->pd_addr = pd_addr;
|
|
|
|
),
|
2018-10-30 19:04:37 +07:00
|
|
|
TP_printk("ring=%s, id=%u, hub=%u, pd_addr=%010Lx",
|
|
|
|
__get_str(ring), __entry->vmid,
|
2017-04-07 22:43:19 +07:00
|
|
|
__entry->vm_hub,__entry->pd_addr)
|
2015-04-21 03:55:21 +07:00
|
|
|
);
|
|
|
|
|
2018-01-10 01:32:58 +07:00
|
|
|
DECLARE_EVENT_CLASS(amdgpu_pasid,
|
|
|
|
TP_PROTO(unsigned pasid),
|
|
|
|
TP_ARGS(pasid),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned, pasid)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->pasid = pasid;
|
|
|
|
),
|
|
|
|
TP_printk("pasid=%u", __entry->pasid)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(amdgpu_pasid, amdgpu_pasid_allocated,
|
|
|
|
TP_PROTO(unsigned pasid),
|
|
|
|
TP_ARGS(pasid)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(amdgpu_pasid, amdgpu_pasid_freed,
|
|
|
|
TP_PROTO(unsigned pasid),
|
|
|
|
TP_ARGS(pasid)
|
|
|
|
);
|
|
|
|
|
2015-06-10 19:45:21 +07:00
|
|
|
TRACE_EVENT(amdgpu_bo_list_set,
|
|
|
|
TP_PROTO(struct amdgpu_bo_list *list, struct amdgpu_bo *bo),
|
|
|
|
TP_ARGS(list, bo),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct amdgpu_bo_list *, list)
|
|
|
|
__field(struct amdgpu_bo *, bo)
|
2016-06-07 16:43:51 +07:00
|
|
|
__field(u64, bo_size)
|
2015-06-10 19:45:21 +07:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->list = list;
|
|
|
|
__entry->bo = bo;
|
2016-06-07 16:43:51 +07:00
|
|
|
__entry->bo_size = amdgpu_bo_size(bo);
|
2015-06-10 19:45:21 +07:00
|
|
|
),
|
2017-03-10 09:25:51 +07:00
|
|
|
TP_printk("list=%p, bo=%p, bo_size=%Ld",
|
2016-06-07 16:43:51 +07:00
|
|
|
__entry->list,
|
|
|
|
__entry->bo,
|
|
|
|
__entry->bo_size)
|
2015-06-10 19:45:21 +07:00
|
|
|
);
|
|
|
|
|
2016-06-07 16:48:52 +07:00
|
|
|
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;
|
|
|
|
),
|
2017-03-10 09:25:51 +07:00
|
|
|
TP_printk("total_bo_size=%Ld, total_bo_count=%Ld",
|
2016-06-07 16:48:52 +07:00
|
|
|
__entry->total_bo, __entry->total_size)
|
|
|
|
);
|
|
|
|
|
2018-07-16 21:12:24 +07:00
|
|
|
TRACE_EVENT(amdgpu_bo_move,
|
2016-06-07 16:48:52 +07:00
|
|
|
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)
|
|
|
|
__field(u32, old_placement)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->bo = bo;
|
|
|
|
__entry->bo_size = amdgpu_bo_size(bo);
|
|
|
|
__entry->new_placement = new_placement;
|
|
|
|
__entry->old_placement = old_placement;
|
|
|
|
),
|
2017-02-25 01:20:57 +07:00
|
|
|
TP_printk("bo=%p, from=%d, to=%d, size=%Ld",
|
2016-06-07 16:48:52 +07:00
|
|
|
__entry->bo, __entry->old_placement,
|
|
|
|
__entry->new_placement, __entry->bo_size)
|
|
|
|
);
|
|
|
|
|
2018-07-31 21:52:25 +07:00
|
|
|
TRACE_EVENT(amdgpu_ib_pipe_sync,
|
|
|
|
TP_PROTO(struct amdgpu_job *sched_job, struct dma_fence *fence),
|
|
|
|
TP_ARGS(sched_job, fence),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(const char *,name)
|
|
|
|
__field(uint64_t, id)
|
|
|
|
__field(struct dma_fence *, fence)
|
|
|
|
__field(uint64_t, ctx)
|
|
|
|
__field(unsigned, seqno)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->name = sched_job->base.sched->name;
|
|
|
|
__entry->id = sched_job->base.id;
|
|
|
|
__entry->fence = fence;
|
|
|
|
__entry->ctx = fence->context;
|
|
|
|
__entry->seqno = fence->seqno;
|
|
|
|
),
|
|
|
|
TP_printk("job ring=%s, id=%llu, need pipe sync to fence=%p, context=%llu, seq=%u",
|
|
|
|
__entry->name, __entry->id,
|
|
|
|
__entry->fence, __entry->ctx,
|
|
|
|
__entry->seqno)
|
|
|
|
);
|
|
|
|
|
2017-03-11 22:50:34 +07:00
|
|
|
#undef AMDGPU_JOB_GET_TIMELINE_NAME
|
2015-04-21 03:55:21 +07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* This part must be outside protection */
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
2017-09-01 23:54:01 +07:00
|
|
|
#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/amd/amdgpu
|
2015-04-21 03:55:21 +07:00
|
|
|
#include <trace/define_trace.h>
|