2017-11-30 21:29:47 -05: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-20 16:55:21 -04: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>
# include <drm/drmP.h>
# undef TRACE_SYSTEM
# define TRACE_SYSTEM amdgpu
# define TRACE_INCLUDE_FILE amdgpu_trace
2017-03-11 10:50:34 -05: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 08:02:27 -04: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 10:52:00 -05:00
TP_printk ( " 0x%04lx, 0x%08lx, 0x%08lx " ,
2016-05-31 08:02:27 -04: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 10:52:00 -05:00
TP_printk ( " 0x%04lx, 0x%08lx, 0x%08lx " ,
2016-05-31 08:02:27 -04:00
( unsigned long ) __entry - > did ,
( unsigned long ) __entry - > reg ,
( unsigned long ) __entry - > value )
) ;
2016-12-06 03:41:55 -05:00
TRACE_EVENT ( amdgpu_iv ,
TP_PROTO ( struct amdgpu_iv_entry * iv ) ,
TP_ARGS ( iv ) ,
TP_STRUCT__entry (
__field ( unsigned , client_id )
__field ( unsigned , src_id )
__field ( unsigned , ring_id )
2017-12-18 17:08:25 +01:00
__field ( unsigned , vmid )
__field ( unsigned , vmid_src )
2016-12-06 03:41:55 -05:00
__field ( uint64_t , timestamp )
__field ( unsigned , timestamp_src )
2018-01-09 19:47:37 +01:00
__field ( unsigned , pasid )
2016-12-06 03:41:55 -05:00
__array ( unsigned , src_data , 4 )
) ,
TP_fast_assign (
__entry - > client_id = iv - > client_id ;
__entry - > src_id = iv - > src_id ;
__entry - > ring_id = iv - > ring_id ;
2017-12-18 17:08:25 +01:00
__entry - > vmid = iv - > vmid ;
__entry - > vmid_src = iv - > vmid_src ;
2016-12-06 03:41:55 -05:00
__entry - > timestamp = iv - > timestamp ;
__entry - > timestamp_src = iv - > timestamp_src ;
2018-01-09 19:47:37 +01:00
__entry - > pasid = iv - > pasid ;
2016-12-06 03:41:55 -05: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-01-09 19:47:37 +01:00
TP_printk ( " client_id:%u src_id:%u ring:%u vmid:%u timestamp: %llu pasid:%u src_data: %08x %08x %08x %08x \n " ,
2016-12-06 03:41:55 -05:00
__entry - > client_id , __entry - > src_id ,
2017-12-18 17:08:25 +01:00
__entry - > ring_id , __entry - > vmid ,
2018-01-09 19:47:37 +01:00
__entry - > timestamp , __entry - > pasid ,
2016-12-06 03:41:55 -05:00
__entry - > src_data [ 0 ] , __entry - > src_data [ 1 ] ,
__entry - > src_data [ 2 ] , __entry - > src_data [ 3 ] )
) ;
2015-04-20 16:55:21 -04: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 17:43:51 +08:00
__field ( u32 , type )
__field ( u32 , prefer )
__field ( u32 , allow )
__field ( u32 , visible )
2015-04-20 16:55:21 -04:00
) ,
TP_fast_assign (
__entry - > bo = bo ;
__entry - > pages = bo - > tbo . num_pages ;
2016-06-07 17:43:51 +08:00
__entry - > type = bo - > tbo . mem . mem_type ;
2017-08-08 07:58:01 -04:00
__entry - > prefer = bo - > preferred_domains ;
2016-06-07 17:43:51 +08:00
__entry - > allow = bo - > allowed_domains ;
__entry - > visible = bo - > flags ;
2015-04-20 16:55:21 -04:00
) ,
2016-06-07 17:43:51 +08:00
2017-08-08 07:58:01 -04:00
TP_printk ( " bo=%p, pages=%u, type=%d, preferred=%d, allowed=%d, visible=%d " ,
2016-06-07 17:43:51 +08:00
__entry - > bo , __entry - > pages , __entry - > type ,
__entry - > prefer , __entry - > allow , __entry - > visible )
2015-04-20 16:55:21 -04:00
) ;
TRACE_EVENT ( amdgpu_cs ,
TP_PROTO ( struct amdgpu_cs_parser * p , int i ) ,
TP_ARGS ( p , i ) ,
TP_STRUCT__entry (
2015-06-10 19:21:14 +02:00
__field ( struct amdgpu_bo_list * , bo_list )
2015-04-20 16:55:21 -04:00
__field ( u32 , ring )
__field ( u32 , dw )
__field ( u32 , fences )
) ,
TP_fast_assign (
2015-06-10 19:21:14 +02:00
__entry - > bo_list = p - > bo_list ;
2018-07-13 15:08:44 +02:00
__entry - > ring = p - > ring - > idx ;
2016-02-03 13:44:52 +01:00
__entry - > dw = p - > job - > ibs [ i ] . length_dw ;
2015-04-20 16:55:21 -04:00
__entry - > fences = amdgpu_fence_count_emitted (
2018-07-13 15:08:44 +02:00
p - > ring ) ;
2015-04-20 16:55:21 -04:00
) ,
2015-06-10 19:21:14 +02:00
TP_printk ( " bo_list=%p, ring=%u, dw=%u, fences=%u " ,
__entry - > bo_list , __entry - > ring , __entry - > dw ,
2015-04-20 16:55:21 -04:00
__entry - > fences )
) ;
2015-11-11 14:56:00 +08:00
TRACE_EVENT ( amdgpu_cs_ioctl ,
TP_PROTO ( struct amdgpu_job * job ) ,
TP_ARGS ( job ) ,
TP_STRUCT__entry (
2017-03-09 21:25:52 -05:00
__field ( uint64_t , sched_job_id )
2017-03-11 10:50:34 -05:00
__string ( timeline , AMDGPU_JOB_GET_TIMELINE_NAME ( job ) )
2017-03-09 21:25:54 -05:00
__field ( unsigned int , context )
__field ( unsigned int , seqno )
2016-10-25 13:00:45 +01:00
__field ( struct dma_fence * , fence )
2015-11-11 14:56:00 +08:00
__field ( char * , ring_name )
__field ( u32 , num_ibs )
) ,
TP_fast_assign (
2017-03-09 21:25:52 -05:00
__entry - > sched_job_id = job - > base . id ;
2017-03-11 10:50:34 -05:00
__assign_str ( timeline , AMDGPU_JOB_GET_TIMELINE_NAME ( job ) )
2017-03-09 21:25:54 -05:00
__entry - > context = job - > base . s_fence - > finished . context ;
__entry - > seqno = job - > base . s_fence - > finished . seqno ;
2018-07-13 15:08:44 +02:00
__entry - > ring_name = to_amdgpu_ring ( job - > base . sched ) - > name ;
2015-11-11 14:56:00 +08:00
__entry - > num_ibs = job - > num_ibs ;
) ,
2017-03-09 21:25:54 -05: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 14:56:00 +08:00
) ;
TRACE_EVENT ( amdgpu_sched_run_job ,
TP_PROTO ( struct amdgpu_job * job ) ,
TP_ARGS ( job ) ,
TP_STRUCT__entry (
2017-03-09 21:25:52 -05:00
__field ( uint64_t , sched_job_id )
2017-03-11 10:50:34 -05:00
__string ( timeline , AMDGPU_JOB_GET_TIMELINE_NAME ( job ) )
2017-02-24 13:20:58 -05:00
__field ( unsigned int , context )
__field ( unsigned int , seqno )
2015-11-11 14:56:00 +08:00
__field ( char * , ring_name )
__field ( u32 , num_ibs )
) ,
TP_fast_assign (
2017-03-09 21:25:52 -05:00
__entry - > sched_job_id = job - > base . id ;
2017-03-11 10:50:34 -05:00
__assign_str ( timeline , AMDGPU_JOB_GET_TIMELINE_NAME ( job ) )
2017-02-24 13:20:58 -05:00
__entry - > context = job - > base . s_fence - > finished . context ;
__entry - > seqno = job - > base . s_fence - > finished . seqno ;
2018-07-13 15:08:44 +02:00
__entry - > ring_name = to_amdgpu_ring ( job - > base . sched ) - > name ;
2015-11-11 14:56:00 +08:00
__entry - > num_ibs = job - > num_ibs ;
) ,
2017-03-09 21:25:53 -05: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 14:56:00 +08:00
) ;
2015-04-20 16:55:21 -04:00
TRACE_EVENT ( amdgpu_vm_grab_id ,
2017-04-07 15:31:13 +02:00
TP_PROTO ( struct amdgpu_vm * vm , struct amdgpu_ring * ring ,
struct amdgpu_job * job ) ,
2016-07-08 10:48:24 +02:00
TP_ARGS ( vm , ring , job ) ,
2015-04-20 16:55:21 -04:00
TP_STRUCT__entry (
2018-01-05 14:23:56 +01:00
__field ( u32 , pasid )
2015-04-20 16:55:21 -04:00
__field ( u32 , ring )
2017-12-18 17:08:25 +01:00
__field ( u32 , vmid )
2017-04-07 15:31:13 +02:00
__field ( u32 , vm_hub )
2016-02-26 16:18:36 +01:00
__field ( u64 , pd_addr )
2016-07-08 10:48:24 +02:00
__field ( u32 , needs_flush )
2015-04-20 16:55:21 -04:00
) ,
TP_fast_assign (
2018-01-05 14:23:56 +01:00
__entry - > pasid = vm - > pasid ;
2017-04-07 15:31:13 +02:00
__entry - > ring = ring - > idx ;
2017-12-18 17:08:25 +01:00
__entry - > vmid = job - > vmid ;
2017-04-07 15:31:13 +02:00
__entry - > vm_hub = ring - > funcs - > vmhub ,
2016-07-08 10:48:24 +02:00
__entry - > pd_addr = job - > vm_pd_addr ;
__entry - > needs_flush = job - > vm_needs_flush ;
2015-04-20 16:55:21 -04:00
) ,
2018-01-05 14:23:56 +01:00
TP_printk ( " pasid=%d, ring=%u, id=%u, hub=%u, pd_addr=%010Lx needs_flush=%u " ,
__entry - > pasid , __entry - > ring , __entry - > vmid ,
2017-04-07 15:31:13 +02:00
__entry - > vm_hub , __entry - > pd_addr , __entry - > needs_flush )
2015-04-20 16:55:21 -04:00
) ;
2015-06-09 16:58:33 +02: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 11:06:52 +02:00
__field ( u64 , flags )
2015-06-09 16:58:33 +02:00
) ,
TP_fast_assign (
2017-08-01 10:51:43 +02:00
__entry - > bo = bo_va ? bo_va - > base . bo : NULL ;
2017-03-30 14:03:59 +02:00
__entry - > start = mapping - > start ;
__entry - > last = mapping - > last ;
2015-06-09 16:58:33 +02:00
__entry - > offset = mapping - > offset ;
__entry - > flags = mapping - > flags ;
) ,
2017-06-28 11:06:52 +02:00
TP_printk ( " bo=%p, start=%lx, last=%lx, offset=%010llx, flags=%llx " ,
2015-06-09 16:58:33 +02: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 11:06:52 +02:00
__field ( u64 , flags )
2015-06-09 16:58:33 +02:00
) ,
TP_fast_assign (
2018-05-11 14:54:31 +08:00
__entry - > bo = bo_va ? bo_va - > base . bo : NULL ;
2017-03-30 14:03:59 +02:00
__entry - > start = mapping - > start ;
__entry - > last = mapping - > last ;
2015-06-09 16:58:33 +02:00
__entry - > offset = mapping - > offset ;
__entry - > flags = mapping - > flags ;
) ,
2017-06-28 11:06:52 +02:00
TP_printk ( " bo=%p, start=%lx, last=%lx, offset=%010llx, flags=%llx " ,
2015-06-09 16:58:33 +02:00
__entry - > bo , __entry - > start , __entry - > last ,
__entry - > offset , __entry - > flags )
) ;
2015-09-28 12:00:23 +02:00
DECLARE_EVENT_CLASS ( amdgpu_vm_mapping ,
2015-04-20 16:55:21 -04:00
TP_PROTO ( struct amdgpu_bo_va_mapping * mapping ) ,
TP_ARGS ( mapping ) ,
TP_STRUCT__entry (
__field ( u64 , soffset )
__field ( u64 , eoffset )
2017-06-28 11:06:52 +02:00
__field ( u64 , flags )
2015-04-20 16:55:21 -04:00
) ,
TP_fast_assign (
2017-03-30 14:03:59 +02:00
__entry - > soffset = mapping - > start ;
__entry - > eoffset = mapping - > last + 1 ;
2015-04-20 16:55:21 -04:00
__entry - > flags = mapping - > flags ;
) ,
2017-06-28 11:06:52 +02:00
TP_printk ( " soffs=%010llx, eoffs=%010llx, flags=%llx " ,
2015-04-20 16:55:21 -04:00
__entry - > soffset , __entry - > eoffset , __entry - > flags )
) ;
2015-09-28 12:00:23 +02: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 16:56:34 +02:00
DEFINE_EVENT ( amdgpu_vm_mapping , amdgpu_vm_bo_cs ,
TP_PROTO ( struct amdgpu_bo_va_mapping * mapping ) ,
TP_ARGS ( mapping )
) ;
2016-09-25 16:11:52 +02:00
TRACE_EVENT ( amdgpu_vm_set_ptes ,
2015-04-20 16:55:21 -04:00
TP_PROTO ( uint64_t pe , uint64_t addr , unsigned count ,
2017-06-28 11:06:52 +02:00
uint32_t incr , uint64_t flags ) ,
2015-04-20 16:55:21 -04: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 11:06:52 +02:00
__field ( u64 , flags )
2015-04-20 16:55:21 -04:00
) ,
TP_fast_assign (
__entry - > pe = pe ;
__entry - > addr = addr ;
__entry - > count = count ;
__entry - > incr = incr ;
__entry - > flags = flags ;
) ,
2017-06-28 11:06:52 +02:00
TP_printk ( " pe=%010Lx, addr=%010Lx, incr=%u, flags=%llx, count=%u " ,
2015-04-20 16:55:21 -04:00
__entry - > pe , __entry - > addr , __entry - > incr ,
__entry - > flags , __entry - > count )
) ;
2016-09-25 16:11:52 +02: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-20 16:55:21 -04:00
TRACE_EVENT ( amdgpu_vm_flush ,
2017-12-18 17:08:25 +01:00
TP_PROTO ( struct amdgpu_ring * ring , unsigned vmid ,
2017-04-07 17:43:19 +02:00
uint64_t pd_addr ) ,
2017-12-18 17:08:25 +01:00
TP_ARGS ( ring , vmid , pd_addr ) ,
2015-04-20 16:55:21 -04:00
TP_STRUCT__entry (
__field ( u32 , ring )
2017-12-18 17:08:25 +01:00
__field ( u32 , vmid )
2017-04-07 17:43:19 +02:00
__field ( u32 , vm_hub )
__field ( u64 , pd_addr )
2015-04-20 16:55:21 -04:00
) ,
TP_fast_assign (
2017-04-07 17:43:19 +02:00
__entry - > ring = ring - > idx ;
2017-12-18 17:08:25 +01:00
__entry - > vmid = vmid ;
2017-04-07 17:43:19 +02:00
__entry - > vm_hub = ring - > funcs - > vmhub ;
2015-04-20 16:55:21 -04:00
__entry - > pd_addr = pd_addr ;
) ,
2017-04-07 17:43:19 +02:00
TP_printk ( " ring=%u, id=%u, hub=%u, pd_addr=%010Lx " ,
2017-12-18 17:08:25 +01:00
__entry - > ring , __entry - > vmid ,
2017-04-07 17:43:19 +02:00
__entry - > vm_hub , __entry - > pd_addr )
2015-04-20 16:55:21 -04:00
) ;
2018-01-09 19:32:58 +01: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 14:45:21 +02: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 17:43:51 +08:00
__field ( u64 , bo_size )
2015-06-10 14:45:21 +02:00
) ,
TP_fast_assign (
__entry - > list = list ;
__entry - > bo = bo ;
2016-06-07 17:43:51 +08:00
__entry - > bo_size = amdgpu_bo_size ( bo ) ;
2015-06-10 14:45:21 +02:00
) ,
2017-03-09 21:25:51 -05:00
TP_printk ( " list=%p, bo=%p, bo_size=%Ld " ,
2016-06-07 17:43:51 +08:00
__entry - > list ,
__entry - > bo ,
__entry - > bo_size )
2015-06-10 14:45:21 +02:00
) ;
2016-06-07 17:48:52 +08: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-09 21:25:51 -05:00
TP_printk ( " total_bo_size=%Ld, total_bo_count=%Ld " ,
2016-06-07 17:48:52 +08:00
__entry - > total_bo , __entry - > total_size )
) ;
2018-07-16 16:12:24 +02:00
TRACE_EVENT ( amdgpu_bo_move ,
2016-06-07 17:48:52 +08: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-24 13:20:57 -05:00
TP_printk ( " bo=%p, from=%d, to=%d, size=%Ld " ,
2016-06-07 17:48:52 +08:00
__entry - > bo , __entry - > old_placement ,
__entry - > new_placement , __entry - > bo_size )
) ;
2018-07-31 10:52:25 -04: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 10:50:34 -05:00
# undef AMDGPU_JOB_GET_TIMELINE_NAME
2015-04-20 16:55:21 -04:00
# endif
/* This part must be outside protection */
# undef TRACE_INCLUDE_PATH
2017-09-01 12:54:01 -04:00
# define TRACE_INCLUDE_PATH .. / .. / drivers / gpu / drm / amd / amdgpu
2015-04-20 16:55:21 -04:00
# include <trace/define_trace.h>