From c55320e9e2a8916e911bcd39ab37b79e3a7d03b2 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Jan 2021 20:43:27 +0100 Subject: New upstream version 3.0.5 --- linux/PressureStallMeter.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'linux/PressureStallMeter.c') diff --git a/linux/PressureStallMeter.c b/linux/PressureStallMeter.c index 745068c..7486968 100644 --- a/linux/PressureStallMeter.c +++ b/linux/PressureStallMeter.c @@ -43,18 +43,22 @@ static void PressureStallMeter_updateValues(Meter* this, char* buffer, size_t le } Platform_getPressureStall(file, some, &this->values[0], &this->values[1], &this->values[2]); - xSnprintf(buffer, len, "%s %s %.2lf%% %.2lf%% %.2lf%%", some ? "some" : "full", file, this->values[0], this->values[1], this->values[2]); + + /* only print bar for ten (not sixty and threehundred), cause the sum is meaningless */ + this->curItems = 1; + + xSnprintf(buffer, len, "%s %s %5.2lf%% %5.2lf%% %5.2lf%%", some ? "some" : "full", file, this->values[0], this->values[1], this->values[2]); } static void PressureStallMeter_display(const Object* cast, RichString* out) { const Meter* this = (const Meter*)cast; char buffer[20]; - xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[0]); - RichString_write(out, CRT_colors[PRESSURE_STALL_TEN], buffer); - xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[1]); - RichString_append(out, CRT_colors[PRESSURE_STALL_SIXTY], buffer); - xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[2]); - RichString_append(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer); + xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[0]); + RichString_writeAscii(out, CRT_colors[PRESSURE_STALL_TEN], buffer); + xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[1]); + RichString_appendAscii(out, CRT_colors[PRESSURE_STALL_SIXTY], buffer); + xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[2]); + RichString_appendAscii(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer); } const MeterClass PressureStallCPUSomeMeter_class = { -- cgit v1.2.3