1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 2 /* 3 * include/trace/events/host1x.h 3 * include/trace/events/host1x.h 4 * 4 * 5 * host1x event logging to ftrace. 5 * host1x event logging to ftrace. 6 * 6 * 7 * Copyright (c) 2010-2013, NVIDIA Corporation 7 * Copyright (c) 2010-2013, NVIDIA Corporation. 8 */ 8 */ 9 9 10 #undef TRACE_SYSTEM 10 #undef TRACE_SYSTEM 11 #define TRACE_SYSTEM host1x 11 #define TRACE_SYSTEM host1x 12 12 13 #if !defined(_TRACE_HOST1X_H) || defined(TRACE 13 #if !defined(_TRACE_HOST1X_H) || defined(TRACE_HEADER_MULTI_READ) 14 #define _TRACE_HOST1X_H 14 #define _TRACE_HOST1X_H 15 15 16 #include <linux/ktime.h> 16 #include <linux/ktime.h> 17 #include <linux/tracepoint.h> 17 #include <linux/tracepoint.h> 18 18 19 struct host1x_bo; 19 struct host1x_bo; 20 20 21 DECLARE_EVENT_CLASS(host1x, 21 DECLARE_EVENT_CLASS(host1x, 22 TP_PROTO(const char *name), 22 TP_PROTO(const char *name), 23 TP_ARGS(name), 23 TP_ARGS(name), 24 TP_STRUCT__entry(__field(const char *, 24 TP_STRUCT__entry(__field(const char *, name)), 25 TP_fast_assign(__entry->name = name;), 25 TP_fast_assign(__entry->name = name;), 26 TP_printk("name=%s", __entry->name) 26 TP_printk("name=%s", __entry->name) 27 ); 27 ); 28 28 29 DEFINE_EVENT(host1x, host1x_channel_open, 29 DEFINE_EVENT(host1x, host1x_channel_open, 30 TP_PROTO(const char *name), 30 TP_PROTO(const char *name), 31 TP_ARGS(name) 31 TP_ARGS(name) 32 ); 32 ); 33 33 34 DEFINE_EVENT(host1x, host1x_channel_release, 34 DEFINE_EVENT(host1x, host1x_channel_release, 35 TP_PROTO(const char *name), 35 TP_PROTO(const char *name), 36 TP_ARGS(name) 36 TP_ARGS(name) 37 ); 37 ); 38 38 39 DEFINE_EVENT(host1x, host1x_cdma_begin, 39 DEFINE_EVENT(host1x, host1x_cdma_begin, 40 TP_PROTO(const char *name), 40 TP_PROTO(const char *name), 41 TP_ARGS(name) 41 TP_ARGS(name) 42 ); 42 ); 43 43 44 DEFINE_EVENT(host1x, host1x_cdma_end, 44 DEFINE_EVENT(host1x, host1x_cdma_end, 45 TP_PROTO(const char *name), 45 TP_PROTO(const char *name), 46 TP_ARGS(name) 46 TP_ARGS(name) 47 ); 47 ); 48 48 49 TRACE_EVENT(host1x_cdma_push, 49 TRACE_EVENT(host1x_cdma_push, 50 TP_PROTO(const char *name, u32 op1, u3 50 TP_PROTO(const char *name, u32 op1, u32 op2), 51 51 52 TP_ARGS(name, op1, op2), 52 TP_ARGS(name, op1, op2), 53 53 54 TP_STRUCT__entry( 54 TP_STRUCT__entry( 55 __field(const char *, name) 55 __field(const char *, name) 56 __field(u32, op1) 56 __field(u32, op1) 57 __field(u32, op2) 57 __field(u32, op2) 58 ), 58 ), 59 59 60 TP_fast_assign( 60 TP_fast_assign( 61 __entry->name = name; 61 __entry->name = name; 62 __entry->op1 = op1; 62 __entry->op1 = op1; 63 __entry->op2 = op2; 63 __entry->op2 = op2; 64 ), 64 ), 65 65 66 TP_printk("name=%s, op1=%08x, op2=%08x 66 TP_printk("name=%s, op1=%08x, op2=%08x", 67 __entry->name, __entry->op1, _ 67 __entry->name, __entry->op1, __entry->op2) 68 ); 68 ); 69 69 70 TRACE_EVENT(host1x_cdma_push_wide, 70 TRACE_EVENT(host1x_cdma_push_wide, 71 TP_PROTO(const char *name, u32 op1, u3 71 TP_PROTO(const char *name, u32 op1, u32 op2, u32 op3, u32 op4), 72 72 73 TP_ARGS(name, op1, op2, op3, op4), 73 TP_ARGS(name, op1, op2, op3, op4), 74 74 75 TP_STRUCT__entry( 75 TP_STRUCT__entry( 76 __field(const char *, name) 76 __field(const char *, name) 77 __field(u32, op1) 77 __field(u32, op1) 78 __field(u32, op2) 78 __field(u32, op2) 79 __field(u32, op3) 79 __field(u32, op3) 80 __field(u32, op4) 80 __field(u32, op4) 81 ), 81 ), 82 82 83 TP_fast_assign( 83 TP_fast_assign( 84 __entry->name = name; 84 __entry->name = name; 85 __entry->op1 = op1; 85 __entry->op1 = op1; 86 __entry->op2 = op2; 86 __entry->op2 = op2; 87 __entry->op3 = op3; 87 __entry->op3 = op3; 88 __entry->op4 = op4; 88 __entry->op4 = op4; 89 ), 89 ), 90 90 91 TP_printk("name=%s, op1=%08x, op2=%08x 91 TP_printk("name=%s, op1=%08x, op2=%08x, op3=%08x op4=%08x", 92 __entry->name, __entry->op1, _ 92 __entry->name, __entry->op1, __entry->op2, __entry->op3, 93 __entry->op4) 93 __entry->op4) 94 ); 94 ); 95 95 96 TRACE_EVENT(host1x_cdma_push_gather, 96 TRACE_EVENT(host1x_cdma_push_gather, 97 TP_PROTO(const char *name, struct host 97 TP_PROTO(const char *name, struct host1x_bo *bo, 98 u32 words, u32 offset, 98 u32 words, u32 offset, void *cmdbuf), 99 99 100 TP_ARGS(name, bo, words, offset, cmdbu 100 TP_ARGS(name, bo, words, offset, cmdbuf), 101 101 102 TP_STRUCT__entry( 102 TP_STRUCT__entry( 103 __field(const char *, name) 103 __field(const char *, name) 104 __field(struct host1x_bo *, bo 104 __field(struct host1x_bo *, bo) 105 __field(u32, words) 105 __field(u32, words) 106 __field(u32, offset) 106 __field(u32, offset) 107 __field(bool, cmdbuf) 107 __field(bool, cmdbuf) 108 __dynamic_array(u32, cmdbuf, w 108 __dynamic_array(u32, cmdbuf, words) 109 ), 109 ), 110 110 111 TP_fast_assign( 111 TP_fast_assign( 112 if (cmdbuf) { 112 if (cmdbuf) { 113 memcpy(__get_dynamic_a 113 memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset, 114 words 114 words * sizeof(u32)); 115 } 115 } 116 __entry->cmdbuf = cmdbuf; 116 __entry->cmdbuf = cmdbuf; 117 __entry->name = name; 117 __entry->name = name; 118 __entry->bo = bo; 118 __entry->bo = bo; 119 __entry->words = words; 119 __entry->words = words; 120 __entry->offset = offset; 120 __entry->offset = offset; 121 ), 121 ), 122 122 123 TP_printk("name=%s, bo=%p, words=%u, o 123 TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]", 124 __entry->name, __entry->bo, 124 __entry->name, __entry->bo, 125 __entry->words, __entry->offset, 125 __entry->words, __entry->offset, 126 __print_hex(__get_dynamic_array(cmdb 126 __print_hex(__get_dynamic_array(cmdbuf), 127 __entry->cmdbuf ? __entry->w 127 __entry->cmdbuf ? __entry->words * 4 : 0)) 128 ); 128 ); 129 129 130 TRACE_EVENT(host1x_channel_submit, 130 TRACE_EVENT(host1x_channel_submit, 131 TP_PROTO(const char *name, u32 cmdbufs 131 TP_PROTO(const char *name, u32 cmdbufs, u32 relocs, u32 syncpt_id, 132 u32 syncpt_incrs), 132 u32 syncpt_incrs), 133 133 134 TP_ARGS(name, cmdbufs, relocs, syncpt_ 134 TP_ARGS(name, cmdbufs, relocs, syncpt_id, syncpt_incrs), 135 135 136 TP_STRUCT__entry( 136 TP_STRUCT__entry( 137 __field(const char *, name) 137 __field(const char *, name) 138 __field(u32, cmdbufs) 138 __field(u32, cmdbufs) 139 __field(u32, relocs) 139 __field(u32, relocs) 140 __field(u32, syncpt_id) 140 __field(u32, syncpt_id) 141 __field(u32, syncpt_incrs) 141 __field(u32, syncpt_incrs) 142 ), 142 ), 143 143 144 TP_fast_assign( 144 TP_fast_assign( 145 __entry->name = name; 145 __entry->name = name; 146 __entry->cmdbufs = cmdbufs; 146 __entry->cmdbufs = cmdbufs; 147 __entry->relocs = relocs; 147 __entry->relocs = relocs; 148 __entry->syncpt_id = syncpt_id 148 __entry->syncpt_id = syncpt_id; 149 __entry->syncpt_incrs = syncpt 149 __entry->syncpt_incrs = syncpt_incrs; 150 ), 150 ), 151 151 152 TP_printk("name=%s, cmdbufs=%u, relocs 152 TP_printk("name=%s, cmdbufs=%u, relocs=%u, syncpt_id=%u, " 153 "syncpt_incrs=%u", 153 "syncpt_incrs=%u", 154 __entry->name, __entry->cmdb 154 __entry->name, __entry->cmdbufs, __entry->relocs, 155 __entry->syncpt_id, __entry- 155 __entry->syncpt_id, __entry->syncpt_incrs) 156 ); 156 ); 157 157 158 TRACE_EVENT(host1x_channel_submitted, 158 TRACE_EVENT(host1x_channel_submitted, 159 TP_PROTO(const char *name, u32 syncpt_ 159 TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max), 160 160 161 TP_ARGS(name, syncpt_base, syncpt_max) 161 TP_ARGS(name, syncpt_base, syncpt_max), 162 162 163 TP_STRUCT__entry( 163 TP_STRUCT__entry( 164 __field(const char *, name) 164 __field(const char *, name) 165 __field(u32, syncpt_base) 165 __field(u32, syncpt_base) 166 __field(u32, syncpt_max) 166 __field(u32, syncpt_max) 167 ), 167 ), 168 168 169 TP_fast_assign( 169 TP_fast_assign( 170 __entry->name = name; 170 __entry->name = name; 171 __entry->syncpt_base = syncpt_ 171 __entry->syncpt_base = syncpt_base; 172 __entry->syncpt_max = syncpt_m 172 __entry->syncpt_max = syncpt_max; 173 ), 173 ), 174 174 175 TP_printk("name=%s, syncpt_base=%d, sy 175 TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d", 176 __entry->name, __entry->syncpt 176 __entry->name, __entry->syncpt_base, __entry->syncpt_max) 177 ); 177 ); 178 178 179 TRACE_EVENT(host1x_channel_submit_complete, 179 TRACE_EVENT(host1x_channel_submit_complete, 180 TP_PROTO(const char *name, int count, 180 TP_PROTO(const char *name, int count, u32 thresh), 181 181 182 TP_ARGS(name, count, thresh), 182 TP_ARGS(name, count, thresh), 183 183 184 TP_STRUCT__entry( 184 TP_STRUCT__entry( 185 __field(const char *, name) 185 __field(const char *, name) 186 __field(int, count) 186 __field(int, count) 187 __field(u32, thresh) 187 __field(u32, thresh) 188 ), 188 ), 189 189 190 TP_fast_assign( 190 TP_fast_assign( 191 __entry->name = name; 191 __entry->name = name; 192 __entry->count = count; 192 __entry->count = count; 193 __entry->thresh = thresh; 193 __entry->thresh = thresh; 194 ), 194 ), 195 195 196 TP_printk("name=%s, count=%d, thresh=% 196 TP_printk("name=%s, count=%d, thresh=%d", 197 __entry->name, __entry->count, 197 __entry->name, __entry->count, __entry->thresh) 198 ); 198 ); 199 199 200 TRACE_EVENT(host1x_wait_cdma, 200 TRACE_EVENT(host1x_wait_cdma, 201 TP_PROTO(const char *name, u32 eventid 201 TP_PROTO(const char *name, u32 eventid), 202 202 203 TP_ARGS(name, eventid), 203 TP_ARGS(name, eventid), 204 204 205 TP_STRUCT__entry( 205 TP_STRUCT__entry( 206 __field(const char *, name) 206 __field(const char *, name) 207 __field(u32, eventid) 207 __field(u32, eventid) 208 ), 208 ), 209 209 210 TP_fast_assign( 210 TP_fast_assign( 211 __entry->name = name; 211 __entry->name = name; 212 __entry->eventid = eventid; 212 __entry->eventid = eventid; 213 ), 213 ), 214 214 215 TP_printk("name=%s, event=%d", __entry 215 TP_printk("name=%s, event=%d", __entry->name, __entry->eventid) 216 ); 216 ); 217 217 218 TRACE_EVENT(host1x_syncpt_load_min, 218 TRACE_EVENT(host1x_syncpt_load_min, 219 TP_PROTO(u32 id, u32 val), 219 TP_PROTO(u32 id, u32 val), 220 220 221 TP_ARGS(id, val), 221 TP_ARGS(id, val), 222 222 223 TP_STRUCT__entry( 223 TP_STRUCT__entry( 224 __field(u32, id) 224 __field(u32, id) 225 __field(u32, val) 225 __field(u32, val) 226 ), 226 ), 227 227 228 TP_fast_assign( 228 TP_fast_assign( 229 __entry->id = id; 229 __entry->id = id; 230 __entry->val = val; 230 __entry->val = val; 231 ), 231 ), 232 232 233 TP_printk("id=%d, val=%d", __entry->id 233 TP_printk("id=%d, val=%d", __entry->id, __entry->val) 234 ); 234 ); 235 235 236 TRACE_EVENT(host1x_syncpt_wait_check, 236 TRACE_EVENT(host1x_syncpt_wait_check, 237 TP_PROTO(struct host1x_bo *bo, u32 off 237 TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh, 238 u32 min), 238 u32 min), 239 239 240 TP_ARGS(bo, offset, syncpt_id, thresh, 240 TP_ARGS(bo, offset, syncpt_id, thresh, min), 241 241 242 TP_STRUCT__entry( 242 TP_STRUCT__entry( 243 __field(struct host1x_bo *, bo 243 __field(struct host1x_bo *, bo) 244 __field(u32, offset) 244 __field(u32, offset) 245 __field(u32, syncpt_id) 245 __field(u32, syncpt_id) 246 __field(u32, thresh) 246 __field(u32, thresh) 247 __field(u32, min) 247 __field(u32, min) 248 ), 248 ), 249 249 250 TP_fast_assign( 250 TP_fast_assign( 251 __entry->bo = bo; 251 __entry->bo = bo; 252 __entry->offset = offset; 252 __entry->offset = offset; 253 __entry->syncpt_id = syncpt_id 253 __entry->syncpt_id = syncpt_id; 254 __entry->thresh = thresh; 254 __entry->thresh = thresh; 255 __entry->min = min; 255 __entry->min = min; 256 ), 256 ), 257 257 258 TP_printk("bo=%p, offset=%05x, id=%d, 258 TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d", 259 __entry->bo, __entry->offset, 259 __entry->bo, __entry->offset, 260 __entry->syncpt_id, __entry->t 260 __entry->syncpt_id, __entry->thresh, 261 __entry->min) 261 __entry->min) 262 ); 262 ); 263 263 264 #endif /* _TRACE_HOST1X_H */ 264 #endif /* _TRACE_HOST1X_H */ 265 265 266 /* This part must be outside protection */ 266 /* This part must be outside protection */ 267 #include <trace/define_trace.h> 267 #include <trace/define_trace.h> 268 268
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.