diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-10 14:09:16 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-10 14:10:22 +0100 |
commit | ef430bd6394b5e51d7474996b9599f726115911a (patch) | |
tree | f1dea7883ba2291c6bf10f20a2a2b08963569286 /overlay/gpu-perf.c | |
parent | 43f6fceef90149872011bdf2aeaabcae585ec654 (diff) |
overlay: Fixup new layout of tracepoints
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/gpu-perf.c')
-rw-r--r-- | overlay/gpu-perf.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c index 42ac44d5..fed5c4fe 100644 --- a/overlay/gpu-perf.c +++ b/overlay/gpu-perf.c @@ -61,6 +61,14 @@ struct sample_event { uint32_t raw[0]; }; +enum { + DEVICE = 0, + CTX, + ENGINE, + CTX_SEQNO, + GLOBAL_SEQNO +}; + static uint64_t tracepoint_id(const char *sys, const char *name) { char buf[1024]; @@ -218,7 +226,7 @@ static int request_add(struct gpu_perf *gp, const void *event) if (comm == NULL) return 0; - comm->nr_requests[sample->raw[1]]++; + comm->nr_requests[sample->raw[ENGINE]]++; return 1; } @@ -234,7 +242,7 @@ static int ctx_switch(struct gpu_perf *gp, const void *event) { const struct sample_event *sample = event; - gp->ctx_switch[sample->raw[1]]++; + gp->ctx_switch[sample->raw[ENGINE]]++; return 1; } @@ -265,12 +273,14 @@ static int wait_begin(struct gpu_perf *gp, const void *event) if (wait == NULL) return 0; + /* XXX argument order CTX == ENGINE! */ + wait->comm = comm; wait->comm->active = true; - wait->seqno = sample->raw[2]; + wait->seqno = sample->raw[GLOBAL_SEQNO]; wait->time = sample->time; - wait->next = gp->wait[sample->raw[1]]; - gp->wait[sample->raw[1]] = wait; + wait->next = gp->wait[sample->raw[CTX]]; + gp->wait[sample->raw[CTX]] = wait; return 0; } @@ -280,8 +290,8 @@ static int wait_end(struct gpu_perf *gp, const void *event) const struct sample_event *sample = event; struct gpu_perf_time *wait, **prev; - for (prev = &gp->wait[sample->raw[1]]; (wait = *prev) != NULL; prev = &wait->next) { - if (wait->seqno != sample->raw[2]) + for (prev = &gp->wait[sample->raw[ENGINE]]; (wait = *prev) != NULL; prev = &wait->next) { + if (wait->seqno != sample->raw[GLOBAL_SEQNO]) continue; wait->comm->wait_time += sample->time - wait->time; |