* [PATCH RESEND] clk: Fix JSON output in debugfs
@ 2015-04-29 16:36 Stefan Wahren
2015-05-01 0:37 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Wahren @ 2015-04-29 16:36 UTC (permalink / raw)
To: Mike Turquette, Stephen Boyd; +Cc: linux-kernel, Stefan Wahren
key/value pairs in a JSON object must be separated by a comma.
After adding the properties "accuracy" and "phase" the JSON output
of /sys/kernel/debug/clk/clk_dump is invalid.
So add the missing commas to fix it.
Fixes: 5279fc4 ("clk: add clk accuracy retrieval support")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
drivers/clk/clk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index fa5a00e..693d2aa 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -233,8 +233,8 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
seq_printf(s, "\"%s\": { ", c->name);
seq_printf(s, "\"enable_count\": %d,", c->enable_count);
seq_printf(s, "\"prepare_count\": %d,", c->prepare_count);
- seq_printf(s, "\"rate\": %lu", clk_core_get_rate(c));
- seq_printf(s, "\"accuracy\": %lu", clk_core_get_accuracy(c));
+ seq_printf(s, "\"rate\": %lu,", clk_core_get_rate(c));
+ seq_printf(s, "\"accuracy\": %lu,", clk_core_get_accuracy(c));
seq_printf(s, "\"phase\": %d", clk_core_get_phase(c));
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] clk: Fix JSON output in debugfs
2015-04-29 16:36 [PATCH RESEND] clk: Fix JSON output in debugfs Stefan Wahren
@ 2015-05-01 0:37 ` Stephen Boyd
2015-05-01 0:48 ` Stefan Wahren
2015-05-01 0:55 ` Felipe Balbi
0 siblings, 2 replies; 5+ messages in thread
From: Stephen Boyd @ 2015-05-01 0:37 UTC (permalink / raw)
To: Stefan Wahren; +Cc: Mike Turquette, linux-kernel
On 04/29, Stefan Wahren wrote:
> key/value pairs in a JSON object must be separated by a comma.
> After adding the properties "accuracy" and "phase" the JSON output
> of /sys/kernel/debug/clk/clk_dump is invalid.
>
> So add the missing commas to fix it.
>
> Fixes: 5279fc4 ("clk: add clk accuracy retrieval support")
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Hmph, this regression is old, v3.14 days. We probably ought to
have a comment in here stating this should be JSON format.
Applied to clk-next with the comment below squashed in.
----8<----
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 5edbec6dfb20..b850a0ef5b9f 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1974,6 +1974,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
if (!c)
return;
+ /* This should be JSON format, i.e. elements separated with a comma */
seq_printf(s, "\"%s\": { ", c->name);
seq_printf(s, "\"enable_count\": %d,", c->enable_count);
seq_printf(s, "\"prepare_count\": %d,", c->prepare_count);
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] clk: Fix JSON output in debugfs
2015-05-01 0:37 ` Stephen Boyd
@ 2015-05-01 0:48 ` Stefan Wahren
2015-05-01 0:55 ` Felipe Balbi
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2015-05-01 0:48 UTC (permalink / raw)
To: Stephen Boyd; +Cc: linux-kernel, Mike Turquette
> Stephen Boyd <sboyd@codeaurora.org> hat am 1. Mai 2015 um 02:37 geschrieben:
>
>
> On 04/29, Stefan Wahren wrote:
> > key/value pairs in a JSON object must be separated by a comma.
> > After adding the properties "accuracy" and "phase" the JSON output
> > of /sys/kernel/debug/clk/clk_dump is invalid.
> >
> > So add the missing commas to fix it.
> >
> > Fixes: 5279fc4 ("clk: add clk accuracy retrieval support")
> > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>
> Hmph, this regression is old, v3.14 days. We probably ought to
> have a comment in here stating this should be JSON format.
>
> Applied to clk-next with the comment below squashed in.
Thanks
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] clk: Fix JSON output in debugfs
2015-05-01 0:37 ` Stephen Boyd
2015-05-01 0:48 ` Stefan Wahren
@ 2015-05-01 0:55 ` Felipe Balbi
2015-05-01 1:34 ` Stephen Boyd
1 sibling, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2015-05-01 0:55 UTC (permalink / raw)
To: Stephen Boyd; +Cc: Stefan Wahren, Mike Turquette, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
On Thu, Apr 30, 2015 at 05:37:12PM -0700, Stephen Boyd wrote:
> On 04/29, Stefan Wahren wrote:
> > key/value pairs in a JSON object must be separated by a comma.
> > After adding the properties "accuracy" and "phase" the JSON output
> > of /sys/kernel/debug/clk/clk_dump is invalid.
> >
> > So add the missing commas to fix it.
> >
> > Fixes: 5279fc4 ("clk: add clk accuracy retrieval support")
> > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>
> Hmph, this regression is old, v3.14 days. We probably ought to
> have a comment in here stating this should be JSON format.
>
> Applied to clk-next with the comment below squashed in.
>
> ----8<----
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 5edbec6dfb20..b850a0ef5b9f 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1974,6 +1974,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
> if (!c)
> return;
>
> + /* This should be JSON format, i.e. elements separated with a comma */
> seq_printf(s, "\"%s\": { ", c->name);
> seq_printf(s, "\"enable_count\": %d,", c->enable_count);
> seq_printf(s, "\"prepare_count\": %d,", c->prepare_count);
you probably want to a newline character after all clocks have been
dumped.
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 459ce9da13e0..c2de94238e75 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -276,7 +276,7 @@ static int clk_dump(struct seq_file *s, void *data)
clk_prepare_unlock();
- seq_printf(s, "}");
+ seq_printf(s, "}\n");
return 0;
}
cheers
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] clk: Fix JSON output in debugfs
2015-05-01 0:55 ` Felipe Balbi
@ 2015-05-01 1:34 ` Stephen Boyd
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2015-05-01 1:34 UTC (permalink / raw)
To: Felipe Balbi; +Cc: Stefan Wahren, Mike Turquette, linux-kernel
On 04/30, Felipe Balbi wrote:
> On Thu, Apr 30, 2015 at 05:37:12PM -0700, Stephen Boyd wrote:
> > On 04/29, Stefan Wahren wrote:
> > > key/value pairs in a JSON object must be separated by a comma.
> > > After adding the properties "accuracy" and "phase" the JSON output
> > > of /sys/kernel/debug/clk/clk_dump is invalid.
> > >
> > > So add the missing commas to fix it.
> > >
> > > Fixes: 5279fc4 ("clk: add clk accuracy retrieval support")
> > > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> >
> > Hmph, this regression is old, v3.14 days. We probably ought to
> > have a comment in here stating this should be JSON format.
> >
> > Applied to clk-next with the comment below squashed in.
> >
> > ----8<----
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index 5edbec6dfb20..b850a0ef5b9f 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -1974,6 +1974,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
> > if (!c)
> > return;
> >
> > + /* This should be JSON format, i.e. elements separated with a comma */
> > seq_printf(s, "\"%s\": { ", c->name);
> > seq_printf(s, "\"enable_count\": %d,", c->enable_count);
> > seq_printf(s, "\"prepare_count\": %d,", c->prepare_count);
>
> you probably want to a newline character after all clocks have been
> dumped.
Sure. Please send it as a separate patch with signed-off and I'll
apply. It doesn't seem like a fix for a regression.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-01 1:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29 16:36 [PATCH RESEND] clk: Fix JSON output in debugfs Stefan Wahren
2015-05-01 0:37 ` Stephen Boyd
2015-05-01 0:48 ` Stefan Wahren
2015-05-01 0:55 ` Felipe Balbi
2015-05-01 1:34 ` Stephen Boyd
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.