Lines Matching full:log
23 log_to_guc(struct xe_guc_log *log) in log_to_guc() argument
25 return container_of(log, struct xe_guc, log); in log_to_guc()
29 log_to_gt(struct xe_guc_log *log) in log_to_gt() argument
31 return container_of(log, struct xe_gt, uc.guc.log); in log_to_gt()
35 log_to_xe(struct xe_guc_log *log) in log_to_xe() argument
37 return gt_to_xe(log_to_gt(log)); in log_to_xe()
43 * GuC Log buffer Layout in guc_log_size()
67 static struct xe_guc_log_snapshot *xe_guc_log_snapshot_alloc(struct xe_guc_log *log, bool atomic) in xe_guc_log_snapshot_alloc() argument
78 * NB: kmalloc has a hard limit well below the maximum GuC log buffer size. in xe_guc_log_snapshot_alloc()
82 snapshot->size = log->bo->size; in xe_guc_log_snapshot_alloc()
112 * xe_guc_log_snapshot_free - free a previously captured GuC log snapshot
113 * @snapshot: GuC log snapshot structure
135 * xe_guc_log_snapshot_capture - create a new snapshot copy the GuC log for later dumping
136 * @log: GuC log structure
142 struct xe_guc_log_snapshot *xe_guc_log_snapshot_capture(struct xe_guc_log *log, bool atomic) in xe_guc_log_snapshot_capture() argument
145 struct xe_device *xe = log_to_xe(log); in xe_guc_log_snapshot_capture()
146 struct xe_guc *guc = log_to_guc(log); in xe_guc_log_snapshot_capture()
147 struct xe_gt *gt = log_to_gt(log); in xe_guc_log_snapshot_capture()
152 if (!log->bo) in xe_guc_log_snapshot_capture()
155 snapshot = xe_guc_log_snapshot_alloc(log, atomic); in xe_guc_log_snapshot_capture()
163 xe_map_memcpy_from(xe, snapshot->copy[i], &log->bo->vmap, in xe_guc_log_snapshot_capture()
176 snapshot->level = log->level; in xe_guc_log_snapshot_capture()
185 * xe_guc_log_snapshot_print - dump a previously saved copy of the GuC log to some useful location
186 * @snapshot: a snapshot of the GuC log
195 drm_printf(p, "GuC log snapshot not allocated!\n"); in xe_guc_log_snapshot_print()
205 drm_printf(p, "Log level: %u\n", snapshot->level); in xe_guc_log_snapshot_print()
207 drm_printf(p, "[LOG].length: 0x%zx\n", snapshot->size); in xe_guc_log_snapshot_print()
211 const char *prefix = i ? NULL : "[LOG].data"; in xe_guc_log_snapshot_print()
220 * xe_guc_log_print_dmesg - dump a copy of the GuC log to dmesg
221 * @log: GuC log structure
223 void xe_guc_log_print_dmesg(struct xe_guc_log *log) in xe_guc_log_print_dmesg() argument
225 struct xe_gt *gt = log_to_gt(log); in xe_guc_log_print_dmesg()
230 drm_printf(&lp, "Dumping GuC log for %ps...\n", __builtin_return_address(0)); in xe_guc_log_print_dmesg()
232 xe_guc_log_print(log, &lp); in xe_guc_log_print_dmesg()
238 * xe_guc_log_print - dump a copy of the GuC log to some useful location
239 * @log: GuC log structure
242 void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p) in xe_guc_log_print() argument
246 drm_printf(p, "**** GuC Log ****\n"); in xe_guc_log_print()
248 snapshot = xe_guc_log_snapshot_capture(log, false); in xe_guc_log_print()
249 drm_printf(p, "CS reference clock: %u\n", log_to_gt(log)->info.reference_clock); in xe_guc_log_print()
254 int xe_guc_log_init(struct xe_guc_log *log) in xe_guc_log_init() argument
256 struct xe_device *xe = log_to_xe(log); in xe_guc_log_init()
257 struct xe_tile *tile = gt_to_tile(log_to_gt(log)); in xe_guc_log_init()
268 log->bo = bo; in xe_guc_log_init()
269 log->level = xe_modparam.guc_log_level; in xe_guc_log_init()
276 static u32 xe_guc_log_section_size_crash(struct xe_guc_log *log) in xe_guc_log_section_size_crash() argument
281 static u32 xe_guc_log_section_size_debug(struct xe_guc_log *log) in xe_guc_log_section_size_debug() argument
287 * xe_guc_log_section_size_capture - Get capture buffer size within log sections.
288 * @log: The log object.
290 * This function will return the capture buffer size within log sections.
294 u32 xe_guc_log_section_size_capture(struct xe_guc_log *log) in xe_guc_log_section_size_capture() argument
300 * xe_guc_get_log_buffer_size - Get log buffer size for a type.
301 * @log: The log object.
302 * @type: The log buffer type
306 u32 xe_guc_get_log_buffer_size(struct xe_guc_log *log, enum guc_log_buffer_type type) in xe_guc_get_log_buffer_size() argument
310 return xe_guc_log_section_size_crash(log); in xe_guc_get_log_buffer_size()
312 return xe_guc_log_section_size_debug(log); in xe_guc_get_log_buffer_size()
314 return xe_guc_log_section_size_capture(log); in xe_guc_get_log_buffer_size()
320 * xe_guc_get_log_buffer_offset - Get offset in log buffer for a type.
321 * @log: The log object.
322 * @type: The log buffer type
324 * This function will return the offset in the log buffer for a type.
327 u32 xe_guc_get_log_buffer_offset(struct xe_guc_log *log, enum guc_log_buffer_type type) in xe_guc_get_log_buffer_offset() argument
335 offset += xe_guc_get_log_buffer_size(log, i); in xe_guc_get_log_buffer_offset()
342 * xe_guc_check_log_buf_overflow - Check if log buffer overflowed
343 * @log: The log object.
344 * @type: The log buffer type
354 bool xe_guc_check_log_buf_overflow(struct xe_guc_log *log, enum guc_log_buffer_type type, in xe_guc_check_log_buf_overflow() argument
357 unsigned int prev_full_cnt = log->stats[type].sampled_overflow; in xe_guc_check_log_buf_overflow()
363 log->stats[type].overflow = full_cnt; in xe_guc_check_log_buf_overflow()
364 log->stats[type].sampled_overflow += full_cnt - prev_full_cnt; in xe_guc_check_log_buf_overflow()
368 log->stats[type].sampled_overflow += 16; in xe_guc_check_log_buf_overflow()
370 xe_gt_notice(log_to_gt(log), "log buffer overflow\n"); in xe_guc_check_log_buf_overflow()