From 959b0c2d4a9b0b04da6f0bf26c881cc6c7006e8c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 10 May 2017 15:06:44 +0100 Subject: overlay: Convert to per-context seqno tracking Signed-off-by: Chris Wilson --- overlay/gpu-perf.c | 6 ++++-- overlay/gpu-perf.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'overlay') diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c index fed5c4fe..f557b9f0 100644 --- a/overlay/gpu-perf.c +++ b/overlay/gpu-perf.c @@ -277,7 +277,8 @@ static int wait_begin(struct gpu_perf *gp, const void *event) wait->comm = comm; wait->comm->active = true; - wait->seqno = sample->raw[GLOBAL_SEQNO]; + wait->context = sample->raw[ENGINE]; + wait->seqno = sample->raw[CTX_SEQNO]; wait->time = sample->time; wait->next = gp->wait[sample->raw[CTX]]; gp->wait[sample->raw[CTX]] = wait; @@ -291,7 +292,8 @@ static int wait_end(struct gpu_perf *gp, const void *event) struct gpu_perf_time *wait, **prev; for (prev = &gp->wait[sample->raw[ENGINE]]; (wait = *prev) != NULL; prev = &wait->next) { - if (wait->seqno != sample->raw[GLOBAL_SEQNO]) + if (wait->context != sample->raw[CTX] || + wait->seqno != sample->raw[CTX_SEQNO]) continue; wait->comm->wait_time += sample->time - wait->time; diff --git a/overlay/gpu-perf.h b/overlay/gpu-perf.h index 0d869869..6c81e62b 100644 --- a/overlay/gpu-perf.h +++ b/overlay/gpu-perf.h @@ -61,6 +61,7 @@ struct gpu_perf { struct gpu_perf_time { struct gpu_perf_time *next; struct gpu_perf_comm *comm; + uint32_t context; uint32_t seqno; uint64_t time; } *wait[MAX_RINGS]; -- cgit v1.2.3