summaryrefslogtreecommitdiff
path: root/overlay/overlay.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-27 17:40:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-27 17:43:46 +0100
commitc6b26c5a406225868f05672949bcc4997c94c3ab (patch)
tree913cf3ee290f0e458042c0b50ee167ac0bc56f10 /overlay/overlay.c
parent177208b0d4cf64a3e2f18909a47afc5bd646a651 (diff)
overlay: Scale the CPU busy value by the numer of active cores
Having 100% always mean one processor fully utilised is much easier to understand (than having to remember how many cores are on each machine and scale appropriately). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.c')
-rw-r--r--overlay/overlay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/overlay/overlay.c b/overlay/overlay.c
index 08b90aef..a457a409 100644
--- a/overlay/overlay.c
+++ b/overlay/overlay.c
@@ -143,8 +143,8 @@ static void init_gpu_top(struct overlay_context *ctx,
};
int n;
+ cpu_top_init(&gt->cpu_top);
gpu_top_init(&gt->gpu_top);
- memset(&gt->cpu, 0, sizeof(gt->cpu));
chart_init(&gt->cpu, "CPU", 120);
chart_set_position(&gt->cpu, PAD, PAD);
@@ -222,7 +222,7 @@ static void show_gpu_top(struct overlay_context *ctx, struct overlay_gpu_top *gt
y = PAD + 12 - 2;
cairo_set_source_rgba(ctx->cr, 0.75, 0.25, 0.75, 1.);
cairo_move_to(ctx->cr, PAD, y);
- sprintf(txt, "CPU: %3d%% busy", gt->cpu_top.busy);
+ sprintf(txt, "CPU: %3d%% busy", gt->cpu_top.busy * gt->cpu_top.nr_cpu);
cairo_show_text(ctx->cr, txt);
y += 14;