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