diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 22:22:21 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 22:22:21 +0100 |
commit | 6233cac9c9f264961c62bb1330d8f48b3b6922b5 (patch) | |
tree | 5dcd740e10f9339f188915e7fbdcdc621926269c /overlay/overlay.c | |
parent | e1d8d774f331ba4e515cad4e5efa91ddc18efad6 (diff) |
overlay: Couple wait begin/end events together to fix accounting
Since the events may be processed out of order (due to per-cpu
ringbuffers) we need to be careful to associated wait pairs in order to
compute the correct elapsed time.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.c')
-rw-r--r-- | overlay/overlay.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c index b41dfc44..bd327ab0 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -266,10 +266,21 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf * need_comma = true; } if (comm->wait_time) { - if (comm->wait_time > 100) { + buf[0] = '\0'; + if (comm->wait_time > 1000*1000) { + sprintf(buf, "%s %.1f ms waiting", + need_comma ? "," : "", + comm->wait_time / (1000*1000.)); + } else if (comm->wait_time > 100) { sprintf(buf, "%s %.1f us waiting", need_comma ? "," : "", comm->wait_time / 1000.); + } else { + sprintf(buf, "%s %.0f ns waiting", + need_comma ? "," : "", + (double)comm->wait_time); + } + if (buf[0] != '\0') { cairo_show_text(ctx->cr, buf); need_comma = true; } |