diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 22:33:35 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 22:33:35 +0100 |
commit | 67f533f836487093a27e176d64de206772088345 (patch) | |
tree | e0731f8a28efa9e6e7082dd25fcb3bb24ee7e772 /overlay/overlay.c | |
parent | 6233cac9c9f264961c62bb1330d8f48b3b6922b5 (diff) |
overlay: Accumulate busy times
Still a little too course as we add multiple overlapping seqnos and
waits.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.c')
-rw-r--r-- | overlay/overlay.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c index bd327ab0..42327111 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -286,6 +286,27 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf * } comm->wait_time = 0; } + if (comm->busy_time) { + buf[0] = '\0'; + if (comm->busy_time > 1000*1000) { + sprintf(buf, "%s %.1f ms busy", + need_comma ? "," : "", + comm->busy_time / (1000*1000.)); + } else if (comm->busy_time > 100) { + sprintf(buf, "%s %.1f us busy", + need_comma ? "," : "", + comm->busy_time / 1000.); + } else { + sprintf(buf, "%s %.0f ns busy", + need_comma ? "," : "", + (double)comm->busy_time); + } + if (buf[0] != '\0') { + cairo_show_text(ctx->cr, buf); + need_comma = true; + } + comm->busy_time = 0; + } y += 14; memset(comm->nr_requests, 0, sizeof(comm->nr_requests)); |