Lines Matching full:snapshot

1749 				   struct xe_guc_submit_exec_queue_snapshot *snapshot)  in guc_exec_queue_wq_snapshot_capture()  argument
1756 snapshot->guc.wqi_head = q->guc->wqi_head; in guc_exec_queue_wq_snapshot_capture()
1757 snapshot->guc.wqi_tail = q->guc->wqi_tail; in guc_exec_queue_wq_snapshot_capture()
1758 snapshot->parallel.wq_desc.head = parallel_read(xe, map, wq_desc.head); in guc_exec_queue_wq_snapshot_capture()
1759 snapshot->parallel.wq_desc.tail = parallel_read(xe, map, wq_desc.tail); in guc_exec_queue_wq_snapshot_capture()
1760 snapshot->parallel.wq_desc.status = parallel_read(xe, map, in guc_exec_queue_wq_snapshot_capture()
1763 if (snapshot->parallel.wq_desc.head != in guc_exec_queue_wq_snapshot_capture()
1764 snapshot->parallel.wq_desc.tail) { in guc_exec_queue_wq_snapshot_capture()
1765 for (i = snapshot->parallel.wq_desc.head; in guc_exec_queue_wq_snapshot_capture()
1766 i != snapshot->parallel.wq_desc.tail; in guc_exec_queue_wq_snapshot_capture()
1768 snapshot->parallel.wq[i / sizeof(u32)] = in guc_exec_queue_wq_snapshot_capture()
1774 guc_exec_queue_wq_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snapshot, in guc_exec_queue_wq_snapshot_print() argument
1780 snapshot->guc.wqi_head, snapshot->parallel.wq_desc.head); in guc_exec_queue_wq_snapshot_print()
1782 snapshot->guc.wqi_tail, snapshot->parallel.wq_desc.tail); in guc_exec_queue_wq_snapshot_print()
1783 drm_printf(p, "\tWQ status: %u\n", snapshot->parallel.wq_desc.status); in guc_exec_queue_wq_snapshot_print()
1785 if (snapshot->parallel.wq_desc.head != in guc_exec_queue_wq_snapshot_print()
1786 snapshot->parallel.wq_desc.tail) { in guc_exec_queue_wq_snapshot_print()
1787 for (i = snapshot->parallel.wq_desc.head; in guc_exec_queue_wq_snapshot_print()
1788 i != snapshot->parallel.wq_desc.tail; in guc_exec_queue_wq_snapshot_print()
1791 snapshot->parallel.wq[i / sizeof(u32)]); in guc_exec_queue_wq_snapshot_print()
1796 * xe_guc_exec_queue_snapshot_capture - Take a quick snapshot of the GuC Engine.
1802 * Returns: a GuC Submit Engine snapshot object that must be freed by the
1812 struct xe_guc_submit_exec_queue_snapshot *snapshot; in xe_guc_exec_queue_snapshot_capture() local
1815 snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); in xe_guc_exec_queue_snapshot_capture()
1817 if (!snapshot) { in xe_guc_exec_queue_snapshot_capture()
1818 drm_err(&xe->drm, "Skipping GuC Engine snapshot entirely.\n"); in xe_guc_exec_queue_snapshot_capture()
1822 snapshot->guc.id = q->guc->id; in xe_guc_exec_queue_snapshot_capture()
1823 memcpy(&snapshot->name, &q->name, sizeof(snapshot->name)); in xe_guc_exec_queue_snapshot_capture()
1824 snapshot->class = q->class; in xe_guc_exec_queue_snapshot_capture()
1825 snapshot->logical_mask = q->logical_mask; in xe_guc_exec_queue_snapshot_capture()
1826 snapshot->width = q->width; in xe_guc_exec_queue_snapshot_capture()
1827 snapshot->refcount = kref_read(&q->refcount); in xe_guc_exec_queue_snapshot_capture()
1828 snapshot->sched_timeout = sched->base.timeout; in xe_guc_exec_queue_snapshot_capture()
1829 snapshot->sched_props.timeslice_us = q->sched_props.timeslice_us; in xe_guc_exec_queue_snapshot_capture()
1830 snapshot->sched_props.preempt_timeout_us = in xe_guc_exec_queue_snapshot_capture()
1833 snapshot->lrc = kmalloc_array(q->width, sizeof(struct lrc_snapshot), in xe_guc_exec_queue_snapshot_capture()
1836 if (!snapshot->lrc) { in xe_guc_exec_queue_snapshot_capture()
1837 drm_err(&xe->drm, "Skipping GuC Engine LRC snapshot.\n"); in xe_guc_exec_queue_snapshot_capture()
1842 snapshot->lrc[i].context_desc = in xe_guc_exec_queue_snapshot_capture()
1844 snapshot->lrc[i].head = xe_lrc_ring_head(lrc); in xe_guc_exec_queue_snapshot_capture()
1845 snapshot->lrc[i].tail.internal = lrc->ring.tail; in xe_guc_exec_queue_snapshot_capture()
1846 snapshot->lrc[i].tail.memory = in xe_guc_exec_queue_snapshot_capture()
1848 snapshot->lrc[i].start_seqno = xe_lrc_start_seqno(lrc); in xe_guc_exec_queue_snapshot_capture()
1849 snapshot->lrc[i].seqno = xe_lrc_seqno(lrc); in xe_guc_exec_queue_snapshot_capture()
1853 snapshot->schedule_state = atomic_read(&q->guc->state); in xe_guc_exec_queue_snapshot_capture()
1854 snapshot->exec_queue_flags = q->flags; in xe_guc_exec_queue_snapshot_capture()
1856 snapshot->parallel_execution = xe_exec_queue_is_parallel(q); in xe_guc_exec_queue_snapshot_capture()
1857 if (snapshot->parallel_execution) in xe_guc_exec_queue_snapshot_capture()
1858 guc_exec_queue_wq_snapshot_capture(q, snapshot); in xe_guc_exec_queue_snapshot_capture()
1861 snapshot->pending_list_size = list_count_nodes(&sched->base.pending_list); in xe_guc_exec_queue_snapshot_capture()
1862 snapshot->pending_list = kmalloc_array(snapshot->pending_list_size, in xe_guc_exec_queue_snapshot_capture()
1866 if (!snapshot->pending_list) { in xe_guc_exec_queue_snapshot_capture()
1867 drm_err(&xe->drm, "Skipping GuC Engine pending_list snapshot.\n"); in xe_guc_exec_queue_snapshot_capture()
1871 snapshot->pending_list[i].seqno = in xe_guc_exec_queue_snapshot_capture()
1873 snapshot->pending_list[i].fence = in xe_guc_exec_queue_snapshot_capture()
1875 snapshot->pending_list[i].finished = in xe_guc_exec_queue_snapshot_capture()
1884 return snapshot; in xe_guc_exec_queue_snapshot_capture()
1888 * xe_guc_exec_queue_snapshot_print - Print out a given GuC Engine snapshot.
1889 * @snapshot: GuC Submit Engine snapshot object.
1892 * This function prints out a given GuC Submit Engine snapshot object.
1895 xe_guc_exec_queue_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snapshot, in xe_guc_exec_queue_snapshot_print() argument
1900 if (!snapshot) in xe_guc_exec_queue_snapshot_print()
1903 drm_printf(p, "\nGuC ID: %d\n", snapshot->guc.id); in xe_guc_exec_queue_snapshot_print()
1904 drm_printf(p, "\tName: %s\n", snapshot->name); in xe_guc_exec_queue_snapshot_print()
1905 drm_printf(p, "\tClass: %d\n", snapshot->class); in xe_guc_exec_queue_snapshot_print()
1906 drm_printf(p, "\tLogical mask: 0x%x\n", snapshot->logical_mask); in xe_guc_exec_queue_snapshot_print()
1907 drm_printf(p, "\tWidth: %d\n", snapshot->width); in xe_guc_exec_queue_snapshot_print()
1908 drm_printf(p, "\tRef: %d\n", snapshot->refcount); in xe_guc_exec_queue_snapshot_print()
1909 drm_printf(p, "\tTimeout: %ld (ms)\n", snapshot->sched_timeout); in xe_guc_exec_queue_snapshot_print()
1911 snapshot->sched_props.timeslice_us); in xe_guc_exec_queue_snapshot_print()
1913 snapshot->sched_props.preempt_timeout_us); in xe_guc_exec_queue_snapshot_print()
1915 for (i = 0; snapshot->lrc && i < snapshot->width; ++i) { in xe_guc_exec_queue_snapshot_print()
1917 snapshot->lrc[i].context_desc); in xe_guc_exec_queue_snapshot_print()
1919 snapshot->lrc[i].head); in xe_guc_exec_queue_snapshot_print()
1921 snapshot->lrc[i].tail.internal, in xe_guc_exec_queue_snapshot_print()
1922 snapshot->lrc[i].tail.memory); in xe_guc_exec_queue_snapshot_print()
1924 snapshot->lrc[i].start_seqno); in xe_guc_exec_queue_snapshot_print()
1925 drm_printf(p, "\tSeqno: (memory) %d\n", snapshot->lrc[i].seqno); in xe_guc_exec_queue_snapshot_print()
1927 drm_printf(p, "\tSchedule State: 0x%x\n", snapshot->schedule_state); in xe_guc_exec_queue_snapshot_print()
1928 drm_printf(p, "\tFlags: 0x%lx\n", snapshot->exec_queue_flags); in xe_guc_exec_queue_snapshot_print()
1930 if (snapshot->parallel_execution) in xe_guc_exec_queue_snapshot_print()
1931 guc_exec_queue_wq_snapshot_print(snapshot, p); in xe_guc_exec_queue_snapshot_print()
1933 for (i = 0; snapshot->pending_list && i < snapshot->pending_list_size; in xe_guc_exec_queue_snapshot_print()
1936 snapshot->pending_list[i].seqno, in xe_guc_exec_queue_snapshot_print()
1937 snapshot->pending_list[i].fence, in xe_guc_exec_queue_snapshot_print()
1938 snapshot->pending_list[i].finished); in xe_guc_exec_queue_snapshot_print()
1943 * snapshot.
1944 * @snapshot: GuC Submit Engine snapshot object.
1949 void xe_guc_exec_queue_snapshot_free(struct xe_guc_submit_exec_queue_snapshot *snapshot) in xe_guc_exec_queue_snapshot_free() argument
1951 if (!snapshot) in xe_guc_exec_queue_snapshot_free()
1954 kfree(snapshot->lrc); in xe_guc_exec_queue_snapshot_free()
1955 kfree(snapshot->pending_list); in xe_guc_exec_queue_snapshot_free()
1956 kfree(snapshot); in xe_guc_exec_queue_snapshot_free()
1961 struct xe_guc_submit_exec_queue_snapshot *snapshot; in guc_exec_queue_print() local
1963 snapshot = xe_guc_exec_queue_snapshot_capture(q); in guc_exec_queue_print()
1964 xe_guc_exec_queue_snapshot_print(snapshot, p); in guc_exec_queue_print()
1965 xe_guc_exec_queue_snapshot_free(snapshot); in guc_exec_queue_print()