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()
153 xe_gt_err(gt, "GuC log buffer not allocated\n"); in xe_guc_log_snapshot_capture()
157 snapshot = xe_guc_log_snapshot_alloc(log, atomic); in xe_guc_log_snapshot_capture()
159 xe_gt_err(gt, "GuC log snapshot not allocated\n"); in xe_guc_log_snapshot_capture()
167 xe_map_memcpy_from(xe, snapshot->copy[i], &log->bo->vmap, in xe_guc_log_snapshot_capture()
180 snapshot->level = log->level; in xe_guc_log_snapshot_capture()
189 * xe_guc_log_snapshot_print - dump a previously saved copy of the GuC log to some useful location
190 * @snapshot: a snapshot of the GuC log
199 drm_printf(p, "GuC log snapshot not allocated!\n"); in xe_guc_log_snapshot_print()
209 drm_printf(p, "Log level: %u\n", snapshot->level); in xe_guc_log_snapshot_print()
211 drm_printf(p, "[LOG].length: 0x%zx\n", snapshot->size); in xe_guc_log_snapshot_print()
215 const char *prefix = i ? NULL : "[LOG].data"; in xe_guc_log_snapshot_print()
224 * xe_guc_log_print_dmesg - dump a copy of the GuC log to dmesg
225 * @log: GuC log structure
227 void xe_guc_log_print_dmesg(struct xe_guc_log *log) in xe_guc_log_print_dmesg() argument
229 struct xe_gt *gt = log_to_gt(log); in xe_guc_log_print_dmesg()
234 drm_printf(&lp, "Dumping GuC log for %ps...\n", __builtin_return_address(0)); in xe_guc_log_print_dmesg()
236 xe_guc_log_print(log, &lp); in xe_guc_log_print_dmesg()
242 * xe_guc_log_print - dump a copy of the GuC log to some useful location
243 * @log: GuC log structure
246 void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p) in xe_guc_log_print() argument
250 drm_printf(p, "**** GuC Log ****\n"); in xe_guc_log_print()
252 snapshot = xe_guc_log_snapshot_capture(log, false); in xe_guc_log_print()
253 drm_printf(p, "CS reference clock: %u\n", log_to_gt(log)->info.reference_clock); in xe_guc_log_print()
258 int xe_guc_log_init(struct xe_guc_log *log) in xe_guc_log_init() argument
260 struct xe_device *xe = log_to_xe(log); in xe_guc_log_init()
261 struct xe_tile *tile = gt_to_tile(log_to_gt(log)); in xe_guc_log_init()
272 log->bo = bo; in xe_guc_log_init()
273 log->level = xe_modparam.guc_log_level; in xe_guc_log_init()
280 static u32 xe_guc_log_section_size_crash(struct xe_guc_log *log) in xe_guc_log_section_size_crash() argument
285 static u32 xe_guc_log_section_size_debug(struct xe_guc_log *log) in xe_guc_log_section_size_debug() argument
291 * xe_guc_log_section_size_capture - Get capture buffer size within log sections.
292 * @log: The log object.
294 * This function will return the capture buffer size within log sections.
298 u32 xe_guc_log_section_size_capture(struct xe_guc_log *log) in xe_guc_log_section_size_capture() argument
304 * xe_guc_get_log_buffer_size - Get log buffer size for a type.
305 * @log: The log object.
306 * @type: The log buffer type
310 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
314 return xe_guc_log_section_size_crash(log); in xe_guc_get_log_buffer_size()
316 return xe_guc_log_section_size_debug(log); in xe_guc_get_log_buffer_size()
318 return xe_guc_log_section_size_capture(log); in xe_guc_get_log_buffer_size()
324 * xe_guc_get_log_buffer_offset - Get offset in log buffer for a type.
325 * @log: The log object.
326 * @type: The log buffer type
328 * This function will return the offset in the log buffer for a type.
331 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
339 offset += xe_guc_get_log_buffer_size(log, i); in xe_guc_get_log_buffer_offset()
346 * xe_guc_check_log_buf_overflow - Check if log buffer overflowed
347 * @log: The log object.
348 * @type: The log buffer type
358 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
361 unsigned int prev_full_cnt = log->stats[type].sampled_overflow; in xe_guc_check_log_buf_overflow()
367 log->stats[type].overflow = full_cnt; in xe_guc_check_log_buf_overflow()
368 log->stats[type].sampled_overflow += full_cnt - prev_full_cnt; in xe_guc_check_log_buf_overflow()
372 log->stats[type].sampled_overflow += 16; in xe_guc_check_log_buf_overflow()
374 xe_gt_notice(log_to_gt(log), "log buffer overflow\n"); in xe_guc_check_log_buf_overflow()