Lines Matching full:snapshot
2104 struct xe_guc_submit_exec_queue_snapshot *snapshot) in guc_exec_queue_wq_snapshot_capture() argument
2111 snapshot->guc.wqi_head = q->guc->wqi_head; in guc_exec_queue_wq_snapshot_capture()
2112 snapshot->guc.wqi_tail = q->guc->wqi_tail; in guc_exec_queue_wq_snapshot_capture()
2113 snapshot->parallel.wq_desc.head = parallel_read(xe, map, wq_desc.head); in guc_exec_queue_wq_snapshot_capture()
2114 snapshot->parallel.wq_desc.tail = parallel_read(xe, map, wq_desc.tail); in guc_exec_queue_wq_snapshot_capture()
2115 snapshot->parallel.wq_desc.status = parallel_read(xe, map, in guc_exec_queue_wq_snapshot_capture()
2118 if (snapshot->parallel.wq_desc.head != in guc_exec_queue_wq_snapshot_capture()
2119 snapshot->parallel.wq_desc.tail) { in guc_exec_queue_wq_snapshot_capture()
2120 for (i = snapshot->parallel.wq_desc.head; in guc_exec_queue_wq_snapshot_capture()
2121 i != snapshot->parallel.wq_desc.tail; in guc_exec_queue_wq_snapshot_capture()
2123 snapshot->parallel.wq[i / sizeof(u32)] = in guc_exec_queue_wq_snapshot_capture()
2129 guc_exec_queue_wq_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snapshot, in guc_exec_queue_wq_snapshot_print() argument
2135 snapshot->guc.wqi_head, snapshot->parallel.wq_desc.head); in guc_exec_queue_wq_snapshot_print()
2137 snapshot->guc.wqi_tail, snapshot->parallel.wq_desc.tail); in guc_exec_queue_wq_snapshot_print()
2138 drm_printf(p, "\tWQ status: %u\n", snapshot->parallel.wq_desc.status); in guc_exec_queue_wq_snapshot_print()
2140 if (snapshot->parallel.wq_desc.head != in guc_exec_queue_wq_snapshot_print()
2141 snapshot->parallel.wq_desc.tail) { in guc_exec_queue_wq_snapshot_print()
2142 for (i = snapshot->parallel.wq_desc.head; in guc_exec_queue_wq_snapshot_print()
2143 i != snapshot->parallel.wq_desc.tail; in guc_exec_queue_wq_snapshot_print()
2146 snapshot->parallel.wq[i / sizeof(u32)]); in guc_exec_queue_wq_snapshot_print()
2151 * xe_guc_exec_queue_snapshot_capture - Take a quick snapshot of the GuC Engine.
2157 * Returns: a GuC Submit Engine snapshot object that must be freed by the
2164 struct xe_guc_submit_exec_queue_snapshot *snapshot; in xe_guc_exec_queue_snapshot_capture() local
2167 snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); in xe_guc_exec_queue_snapshot_capture()
2169 if (!snapshot) in xe_guc_exec_queue_snapshot_capture()
2172 snapshot->guc.id = q->guc->id; in xe_guc_exec_queue_snapshot_capture()
2173 memcpy(&snapshot->name, &q->name, sizeof(snapshot->name)); in xe_guc_exec_queue_snapshot_capture()
2174 snapshot->class = q->class; in xe_guc_exec_queue_snapshot_capture()
2175 snapshot->logical_mask = q->logical_mask; in xe_guc_exec_queue_snapshot_capture()
2176 snapshot->width = q->width; in xe_guc_exec_queue_snapshot_capture()
2177 snapshot->refcount = kref_read(&q->refcount); in xe_guc_exec_queue_snapshot_capture()
2178 snapshot->sched_timeout = sched->base.timeout; in xe_guc_exec_queue_snapshot_capture()
2179 snapshot->sched_props.timeslice_us = q->sched_props.timeslice_us; in xe_guc_exec_queue_snapshot_capture()
2180 snapshot->sched_props.preempt_timeout_us = in xe_guc_exec_queue_snapshot_capture()
2183 snapshot->lrc = kmalloc_array(q->width, sizeof(struct xe_lrc_snapshot *), in xe_guc_exec_queue_snapshot_capture()
2186 if (snapshot->lrc) { in xe_guc_exec_queue_snapshot_capture()
2190 snapshot->lrc[i] = xe_lrc_snapshot_capture(lrc); in xe_guc_exec_queue_snapshot_capture()
2194 snapshot->schedule_state = atomic_read(&q->guc->state); in xe_guc_exec_queue_snapshot_capture()
2195 snapshot->exec_queue_flags = q->flags; in xe_guc_exec_queue_snapshot_capture()
2197 snapshot->parallel_execution = xe_exec_queue_is_parallel(q); in xe_guc_exec_queue_snapshot_capture()
2198 if (snapshot->parallel_execution) in xe_guc_exec_queue_snapshot_capture()
2199 guc_exec_queue_wq_snapshot_capture(q, snapshot); in xe_guc_exec_queue_snapshot_capture()
2202 snapshot->pending_list_size = list_count_nodes(&sched->base.pending_list); in xe_guc_exec_queue_snapshot_capture()
2203 snapshot->pending_list = kmalloc_array(snapshot->pending_list_size, in xe_guc_exec_queue_snapshot_capture()
2207 if (snapshot->pending_list) { in xe_guc_exec_queue_snapshot_capture()
2212 snapshot->pending_list[i].seqno = in xe_guc_exec_queue_snapshot_capture()
2214 snapshot->pending_list[i].fence = in xe_guc_exec_queue_snapshot_capture()
2216 snapshot->pending_list[i].finished = in xe_guc_exec_queue_snapshot_capture()
2225 return snapshot; in xe_guc_exec_queue_snapshot_capture()
2229 * xe_guc_exec_queue_snapshot_capture_delayed - Take delayed part of snapshot of the GuC Engine.
2230 * @snapshot: Previously captured snapshot of job.
2235 xe_guc_exec_queue_snapshot_capture_delayed(struct xe_guc_submit_exec_queue_snapshot *snapshot) in xe_guc_exec_queue_snapshot_capture_delayed() argument
2239 if (!snapshot || !snapshot->lrc) in xe_guc_exec_queue_snapshot_capture_delayed()
2242 for (i = 0; i < snapshot->width; ++i) in xe_guc_exec_queue_snapshot_capture_delayed()
2243 xe_lrc_snapshot_capture_delayed(snapshot->lrc[i]); in xe_guc_exec_queue_snapshot_capture_delayed()
2247 * xe_guc_exec_queue_snapshot_print - Print out a given GuC Engine snapshot.
2248 * @snapshot: GuC Submit Engine snapshot object.
2251 * This function prints out a given GuC Submit Engine snapshot object.
2254 xe_guc_exec_queue_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snapshot, in xe_guc_exec_queue_snapshot_print() argument
2259 if (!snapshot) in xe_guc_exec_queue_snapshot_print()
2262 drm_printf(p, "GuC ID: %d\n", snapshot->guc.id); in xe_guc_exec_queue_snapshot_print()
2263 drm_printf(p, "\tName: %s\n", snapshot->name); in xe_guc_exec_queue_snapshot_print()
2264 drm_printf(p, "\tClass: %d\n", snapshot->class); in xe_guc_exec_queue_snapshot_print()
2265 drm_printf(p, "\tLogical mask: 0x%x\n", snapshot->logical_mask); in xe_guc_exec_queue_snapshot_print()
2266 drm_printf(p, "\tWidth: %d\n", snapshot->width); in xe_guc_exec_queue_snapshot_print()
2267 drm_printf(p, "\tRef: %d\n", snapshot->refcount); in xe_guc_exec_queue_snapshot_print()
2268 drm_printf(p, "\tTimeout: %ld (ms)\n", snapshot->sched_timeout); in xe_guc_exec_queue_snapshot_print()
2270 snapshot->sched_props.timeslice_us); in xe_guc_exec_queue_snapshot_print()
2272 snapshot->sched_props.preempt_timeout_us); in xe_guc_exec_queue_snapshot_print()
2274 for (i = 0; snapshot->lrc && i < snapshot->width; ++i) in xe_guc_exec_queue_snapshot_print()
2275 xe_lrc_snapshot_print(snapshot->lrc[i], p); in xe_guc_exec_queue_snapshot_print()
2277 drm_printf(p, "\tSchedule State: 0x%x\n", snapshot->schedule_state); in xe_guc_exec_queue_snapshot_print()
2278 drm_printf(p, "\tFlags: 0x%lx\n", snapshot->exec_queue_flags); in xe_guc_exec_queue_snapshot_print()
2280 if (snapshot->parallel_execution) in xe_guc_exec_queue_snapshot_print()
2281 guc_exec_queue_wq_snapshot_print(snapshot, p); in xe_guc_exec_queue_snapshot_print()
2283 for (i = 0; snapshot->pending_list && i < snapshot->pending_list_size; in xe_guc_exec_queue_snapshot_print()
2286 snapshot->pending_list[i].seqno, in xe_guc_exec_queue_snapshot_print()
2287 snapshot->pending_list[i].fence, in xe_guc_exec_queue_snapshot_print()
2288 snapshot->pending_list[i].finished); in xe_guc_exec_queue_snapshot_print()
2293 * snapshot.
2294 * @snapshot: GuC Submit Engine snapshot object.
2299 void xe_guc_exec_queue_snapshot_free(struct xe_guc_submit_exec_queue_snapshot *snapshot) in xe_guc_exec_queue_snapshot_free() argument
2303 if (!snapshot) in xe_guc_exec_queue_snapshot_free()
2306 if (snapshot->lrc) { in xe_guc_exec_queue_snapshot_free()
2307 for (i = 0; i < snapshot->width; i++) in xe_guc_exec_queue_snapshot_free()
2308 xe_lrc_snapshot_free(snapshot->lrc[i]); in xe_guc_exec_queue_snapshot_free()
2309 kfree(snapshot->lrc); in xe_guc_exec_queue_snapshot_free()
2311 kfree(snapshot->pending_list); in xe_guc_exec_queue_snapshot_free()
2312 kfree(snapshot); in xe_guc_exec_queue_snapshot_free()
2317 struct xe_guc_submit_exec_queue_snapshot *snapshot; in guc_exec_queue_print() local
2319 snapshot = xe_guc_exec_queue_snapshot_capture(q); in guc_exec_queue_print()
2320 xe_guc_exec_queue_snapshot_print(snapshot, p); in guc_exec_queue_print()
2321 xe_guc_exec_queue_snapshot_free(snapshot); in guc_exec_queue_print()