From ef430bd6394b5e51d7474996b9599f726115911a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 10 May 2017 14:09:16 +0100 Subject: overlay: Fixup new layout of tracepoints Signed-off-by: Chris Wilson --- overlay/gpu-perf.c | 24 +++++++++++++++++------- overlay/gpu-top.c | 3 ++- overlay/overlay.c | 5 +++-- 3 files changed, 22 insertions(+), 10 deletions(-) (limited to 'overlay') 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; diff --git a/overlay/gpu-top.c b/overlay/gpu-top.c index 4097cd06..891a7ea7 100644 --- a/overlay/gpu-top.c +++ b/overlay/gpu-top.c @@ -69,8 +69,9 @@ static int perf_init(struct gpu_top *gt) { const char *names[] = { "RCS", - "VCS", "BCS", + "VCS0", + "VCS1", NULL, }; int n; diff --git a/overlay/overlay.c b/overlay/overlay.c index b726588d..b30f7a1d 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -313,8 +313,9 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf * struct gpu_perf_comm *comm, **prev; const char *ring_name[] = { "R", - "V", "B", + "V0", + "V1", }; double range[2]; char buf[1024]; @@ -432,7 +433,7 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf * goto skip_comm; len = sprintf(buf, "%s:", comm->name); - for (n = 0; n < 3; n++) { + for (n = 0; n < sizeof(ring_name)/sizeof(ring_name[0]); n++) { if (comm->nr_requests[n] == 0) continue; len += sprintf(buf + len, "%s %d%s", need_comma ? "," : "", comm->nr_requests[n], ring_name[n]); -- cgit v1.2.3