power: pmic-voter: make debug status more parsable

The status debug property lists all of the voters, their enable and
value status, and the effective result. Currently the status is
presented on multiple lines which is difficult to parse. Change the
format to be more parsable.

Print each voter in the following format:
VOTABLE: CLIENT: en=1 v=1000

Print a single summary line at the end in the following format:
VOTABLE: effective=EFFECTIVE_CLIENT type=VOTABLE_TYPE v=1000

Change-Id: I0671cdd8e0911450bafe4869cb49cc48bd622a81
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
This commit is contained in:
Nicholas Troast 2017-08-03 13:52:33 -07:00 committed by Gerrit - the friendly Code Review server
parent a49bb61510
commit 0092e08d5c

View file

@ -519,11 +519,10 @@ static int show_votable_clients(struct seq_file *m, void *data)
lock_votable(votable); lock_votable(votable);
seq_printf(m, "Votable %s:\n", votable->name);
seq_puts(m, "clients:\n");
for (i = 0; i < votable->num_clients; i++) { for (i = 0; i < votable->num_clients; i++) {
if (votable->client_strs[i]) { if (votable->client_strs[i]) {
seq_printf(m, "%-15s:\t\ten=%d\t\tv=%d\n", seq_printf(m, "%s: %s:\t\t\ten=%d v=%d\n",
votable->name,
votable->client_strs[i], votable->client_strs[i],
votable->votes[i].enabled, votable->votes[i].enabled,
votable->votes[i].value); votable->votes[i].value);
@ -542,11 +541,11 @@ static int show_votable_clients(struct seq_file *m, void *data)
break; break;
} }
seq_printf(m, "type: %s\n", type_str);
seq_puts(m, "Effective:\n");
effective_client_str = get_effective_client_locked(votable); effective_client_str = get_effective_client_locked(votable);
seq_printf(m, "%-15s:\t\tv=%d\n", seq_printf(m, "%s: effective=%s type=%s v=%d\n",
votable->name,
effective_client_str ? effective_client_str : "none", effective_client_str ? effective_client_str : "none",
type_str,
get_effective_result_locked(votable)); get_effective_result_locked(votable));
unlock_votable(votable); unlock_votable(votable);