2 * Copyright 2018 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
27 #define TRACE_SYSTEM amdgpu_dm
29 #if !defined(_AMDGPU_DM_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
30 #define _AMDGPU_DM_TRACE_H_
32 #include <linux/tracepoint.h>
34 TRACE_EVENT(amdgpu_dc_rreg
,
35 TP_PROTO(unsigned long *read_count
, uint32_t reg
, uint32_t value
),
36 TP_ARGS(read_count
, reg
, value
),
38 __field(uint32_t, reg
)
39 __field(uint32_t, value
)
43 __entry
->value
= value
;
44 *read_count
= *read_count
+ 1;
46 TP_printk("reg=0x%08lx, value=0x%08lx",
47 (unsigned long)__entry
->reg
,
48 (unsigned long)__entry
->value
)
51 TRACE_EVENT(amdgpu_dc_wreg
,
52 TP_PROTO(unsigned long *write_count
, uint32_t reg
, uint32_t value
),
53 TP_ARGS(write_count
, reg
, value
),
55 __field(uint32_t, reg
)
56 __field(uint32_t, value
)
60 __entry
->value
= value
;
61 *write_count
= *write_count
+ 1;
63 TP_printk("reg=0x%08lx, value=0x%08lx",
64 (unsigned long)__entry
->reg
,
65 (unsigned long)__entry
->value
)
69 TRACE_EVENT(amdgpu_dc_performance
,
70 TP_PROTO(unsigned long read_count
, unsigned long write_count
,
71 unsigned long *last_read
, unsigned long *last_write
,
72 const char *func
, unsigned int line
),
73 TP_ARGS(read_count
, write_count
, last_read
, last_write
, func
, line
),
75 __field(uint32_t, reads
)
76 __field(uint32_t, writes
)
77 __field(uint32_t, read_delta
)
78 __field(uint32_t, write_delta
)
80 __field(uint32_t, line
)
83 __entry
->reads
= read_count
;
84 __entry
->writes
= write_count
;
85 __entry
->read_delta
= read_count
- *last_read
;
86 __entry
->write_delta
= write_count
- *last_write
;
87 __assign_str(func
, func
);
89 *last_read
= read_count
;
90 *last_write
= write_count
;
92 TP_printk("%s:%d reads=%08ld (%08ld total), writes=%08ld (%08ld total)",
93 __get_str(func
), __entry
->line
,
94 (unsigned long)__entry
->read_delta
,
95 (unsigned long)__entry
->reads
,
96 (unsigned long)__entry
->write_delta
,
97 (unsigned long)__entry
->writes
)
99 #endif /* _AMDGPU_DM_TRACE_H_ */
101 #undef TRACE_INCLUDE_PATH
102 #define TRACE_INCLUDE_PATH .
103 #define TRACE_INCLUDE_FILE amdgpu_dm_trace
104 #include <trace/define_trace.h>