pan/decode: Add `minimal` mode

We would like a mode to skip decoding job payloads so we can just
inspect for faults.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3836>
This commit is contained in:
Alyssa Rosenzweig 2020-02-18 07:43:51 -05:00
parent b684ba6ce7
commit 4122f747ac
3 changed files with 16 additions and 9 deletions

View File

@ -942,7 +942,7 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
/* Wait so we can get errors reported back */
drmSyncobjWait(screen->fd, &batch->out_sync->syncobj, 1,
INT64_MAX, 0, NULL);
pandecode_jc(submit.jc, FALSE, screen->gpu_id);
pandecode_jc(submit.jc, FALSE, screen->gpu_id, false);
}
return 0;

View File

@ -2821,8 +2821,17 @@ pandecode_fragment_job(const struct pandecode_mapped_memory *mem,
static int job_descriptor_number = 0;
/* Entrypoint to start tracing. jc_gpu_va is the GPU address for the first job
* in the chain; later jobs are found by walking the chain. Bifrost is, well,
* if it's bifrost or not. GPU ID is the more finegrained ID (at some point, we
* might wish to combine this with the bifrost parameter) because some details
* are model-specific even within a particular architecture. Minimal traces
* *only* examine the job descriptors, skipping printing entirely if there is
* no faults, and only descends into the payload if there are faults. This is
* useful for looking for faults without the overhead of invasive traces. */
int
pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal)
{
struct mali_job_descriptor_header *h;
@ -2853,6 +2862,10 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
if (first)
start_number = job_no;
/* If the job is good to go, skip it in minimal mode */
if (minimal && (h->exception_status == 0x0 || h->exception_status == 0x1))
continue;
pandecode_log("struct mali_job_descriptor_header job_%"PRIx64"_%d = {\n", jc_gpu_va, job_no);
pandecode_indent++;
@ -2891,12 +2904,6 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
pandecode_indent--;
pandecode_log("};\n");
/* Do not touch the field yet -- decode the payload first, and
* don't touch that either. This is essential for the uploads
* to occur in sequence and therefore be dynamically allocated
* correctly. Do note the size, however, for that related
* reason. */
switch (h->job_type) {
case JOB_TYPE_WRITE_VALUE: {
struct mali_payload_write_value *s = payload;

View File

@ -51,7 +51,7 @@ void pandecode_close(void);
void
pandecode_inject_mmap(uint64_t gpu_va, void *cpu, unsigned sz, const char *name);
int pandecode_jc(uint64_t jc_gpu_va, bool bifrost, unsigned gpu_id);
int pandecode_jc(uint64_t jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal);
char *
pandecode_exception_access(unsigned access);