xref: /linux/drivers/gpu/drm/xe/xe_trace_lrc.h (revision 96c84703f1cf6ea43617f9565166681cd71df104)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright © 2024 Intel Corporation
4  */
5 
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM xe
8 
9 #if !defined(_XE_TRACE_LRC_H_) || defined(TRACE_HEADER_MULTI_READ)
10 #define _XE_TRACE_LRC_H_
11 
12 #include <linux/tracepoint.h>
13 #include <linux/types.h>
14 
15 #include "xe_gt_types.h"
16 #include "xe_lrc.h"
17 #include "xe_lrc_types.h"
18 
19 #define __dev_name_lrc(lrc)	dev_name(gt_to_xe((lrc)->fence_ctx.gt)->drm.dev)
20 
21 TRACE_EVENT(xe_lrc_update_timestamp,
22 	    TP_PROTO(struct xe_lrc *lrc, uint32_t old),
23 	    TP_ARGS(lrc, old),
24 	    TP_STRUCT__entry(
25 		     __field(struct xe_lrc *, lrc)
26 		     __field(u32, old)
27 		     __field(u32, new)
28 		     __string(name, lrc->fence_ctx.name)
29 		     __string(device_id, __dev_name_lrc(lrc))
30 	    ),
31 
32 	    TP_fast_assign(
33 		   __entry->lrc	= lrc;
34 		   __entry->old = old;
35 		   __entry->new = lrc->ctx_timestamp;
36 		   __assign_str(name);
37 		   __assign_str(device_id);
38 		   ),
39 	    TP_printk("lrc=:%p lrc->name=%s old=%u new=%u device_id:%s",
40 		      __entry->lrc, __get_str(name),
41 		      __entry->old, __entry->new,
42 		      __get_str(device_id))
43 );
44 
45 #endif
46 
47 /* This part must be outside protection */
48 #undef TRACE_INCLUDE_PATH
49 #undef TRACE_INCLUDE_FILE
50 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
51 #define TRACE_INCLUDE_FILE xe_trace_lrc
52 #include <trace/define_trace.h>
53