Output Format of PowerDebug is messed up on Samsung Arndale Board

Bug #1307896 reported by Mohammad Merajul Islam Molla
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro PMWG Powerdebug
New
Undecided
Unassigned

Bug Description

This issue reproduces with powerdebug 0.7.1 (latest code from git). While displaying information about "Regulators" output becomes really messy (zig zag) on Samsung Arndale Board (Exynos 5250, Cortex A-15). It looks like the output field size "11" for printing regulator name is not enough.

asprintf(&buf, "%-11s %-11s %-11s %-11s %-11s %-11s %-11s %-12s", ...)

Some regularots have longer names. Hence proposing to increase this limit to a higher value, i.e. 25.

Revision history for this message
Mohammad Merajul Islam Molla (meraj-enigma) wrote :

A simple patch will do. My git diff goes below -

diff --git a/regulator.c b/regulator.c
index 9cd89fd..045cceb 100644
--- a/regulator.c
+++ b/regulator.c
@@ -127,7 +127,7 @@ static int regulator_display_cb(struct tree *t, void *data)
        if (!strlen(reg->name))
                return 0;

- if (asprintf(&buf, "%-11s %-11s %-11s %-11s %-11d %-11d %-11d %-12d",
+ if (asprintf(&buf, "%-25s %-11s %-11s %-11s %-11d %-11d %-11d %-12d",
                     reg->name, reg->status, reg->state, reg->type,
                     reg->num_users, reg->microvolts, reg->min_microvolts,
                     reg->max_microvolts) < 0)
@@ -147,7 +147,7 @@ static int regulator_print_header(void)
        char *buf;
        int ret;

- if (asprintf(&buf, "%-11s %-11s %-11s %-11s %-11s %-11s %-11s %-12s",
+ if (asprintf(&buf, "%-25s %-11s %-11s %-11s %-11s %-11s %-11s %-12s",
                     "Name", "Status", "State", "Type", "Users", "Microvolts",
                     "Min u-volts", "Max u-volts") < 0)
                return -1;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.