summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-22 10:59:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-22 10:59:58 +0000
commit184786988e5d78ae230139d76691b9ce7f97dca6 (patch)
tree54b95ff62e95e373fa254dd45e477dbcb6af622b /overlay
parentb20a6b827924bfaf0bf92a1eae818385f90dfbea (diff)
overlay: Fill the blank charts with error messages
Instead of showing nothing, show a "space left intentionally blank" message. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay')
-rw-r--r--overlay/gpu-perf.c4
-rw-r--r--overlay/gpu-perf.h1
-rw-r--r--overlay/overlay.c30
3 files changed, 30 insertions, 5 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c
index d5e461c6..b9ca11bd 100644
--- a/overlay/gpu-perf.c
+++ b/overlay/gpu-perf.c
@@ -301,8 +301,10 @@ void gpu_perf_init(struct gpu_perf *gp, unsigned flags)
perf_tracepoint_open(gp, "i915", "i915_gem_request_wait_end", wait_end);
perf_tracepoint_open(gp, "i915", "i915_flip_complete", flip_complete);
- if (gp->nr_events == 0)
+ if (gp->nr_events == 0) {
+ gp->error = "i915.ko tracepoints not available";
return;
+ }
if (perf_mmap(gp))
return;
diff --git a/overlay/gpu-perf.h b/overlay/gpu-perf.h
index 3b91bd59..53699f75 100644
--- a/overlay/gpu-perf.h
+++ b/overlay/gpu-perf.h
@@ -30,6 +30,7 @@
#define MAX_RINGS 4
struct gpu_perf {
+ const char *error;
int page_size;
int nr_cpus;
int nr_events;
diff --git a/overlay/overlay.c b/overlay/overlay.c
index 04ff5ee1..e783a6f4 100644
--- a/overlay/overlay.c
+++ b/overlay/overlay.c
@@ -289,15 +289,26 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
cairo_pattern_t *linear;
int x, y, y1, y2, n;
+ cairo_rectangle(ctx->cr, ctx->width/2+6-.5, 12-.5, ctx->width/2-18+1, ctx->height/2-18+1);
+ cairo_set_source_rgb(ctx->cr, .15, .15, .15);
+ cairo_set_line_width(ctx->cr, 1);
+ cairo_stroke(ctx->cr);
+
+ if (gp->gpu_perf.error) {
+ cairo_text_extents_t extents;
+ cairo_text_extents(ctx->cr, gp->gpu_perf.error, &extents);
+ cairo_move_to(ctx->cr,
+ ctx->width/2+6 + (ctx->width/2-18 - extents.width)/2.,
+ 12 + (ctx->height/2-18 + extents.height)/2.);
+ cairo_show_text(ctx->cr, gp->gpu_perf.error);
+ return;
+ }
+
gpu_perf_update(&gp->gpu_perf);
y = 12 + 12 - 2;
x = ctx->width/2 + 6;
- cairo_rectangle(ctx->cr, ctx->width/2+6-.5, 12-.5, ctx->width/2-18+1, ctx->height/2-18+1);
- cairo_set_source_rgb(ctx->cr, .15, .15, .15);
- cairo_set_line_width(ctx->cr, 1);
- cairo_stroke(ctx->cr);
for (comm = gp->gpu_perf.comm; comm; comm = comm->next) {
int total;
@@ -495,6 +506,17 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq *
cairo_set_line_width(ctx->cr, 1);
cairo_stroke(ctx->cr);
+ if (gf->gpu_freq.error) {
+ const char *txt = "GPU frequency not found in debugfs";
+ cairo_text_extents_t extents;
+ cairo_text_extents(ctx->cr, txt, &extents);
+ cairo_move_to(ctx->cr,
+ 12 + (ctx->width/2-18 - extents.width)/2.,
+ ctx->height/2+6 + (ctx->height/2-18 + extents.height)/2.);
+ cairo_show_text(ctx->cr, txt);
+ return;
+ }
+
if (has_freq) {
if (gf->gpu_freq.current)
chart_add_sample(&gf->current, gf->gpu_freq.current);