diff mbox series

opal-prd: flush after logging to stdio in debug mode

Message ID 1510187551-15444-1-git-send-email-jk@ozlabs.org
State Accepted
Headers show
Series opal-prd: flush after logging to stdio in debug mode | expand

Commit Message

Jeremy Kerr Nov. 9, 2017, 12:32 a.m. UTC
When in debug mode, flush after each log output. This makes it more
likely that we'll catch failure reasons on severe errors.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
 external/opal-prd/opal-prd.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stewart Smith Nov. 14, 2017, 6:48 a.m. UTC | #1
Jeremy Kerr <jk@ozlabs.org> writes:
> When in debug mode, flush after each log output. This makes it more
> likely that we'll catch failure reasons on severe errors.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> ---
>  external/opal-prd/opal-prd.c | 3 +++
>  1 file changed, 3 insertions(+)

Merged to master as of 88bd3bc5e6f8174e36d28159454ecddddf4fb12b

I take it we don't need this in 5.9.x at the moment and it'd be fine to
wait until a 5.10 for this to hit distros?
Jeremy Kerr Nov. 14, 2017, 7:21 a.m. UTC | #2
Hi Stewart,

> Jeremy Kerr <jk@ozlabs.org> writes:
>> When in debug mode, flush after each log output. This makes it more
>> likely that we'll catch failure reasons on severe errors.
>>
>> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>> ---
>>  external/opal-prd/opal-prd.c | 3 +++
>>  1 file changed, 3 insertions(+)
> 
> Merged to master as of 88bd3bc5e6f8174e36d28159454ecddddf4fb12b

Thanks!

> I take it we don't need this in 5.9.x at the moment and it'd be fine to
> wait until a 5.10 for this to hit distros?

Yep, I think that's a good plan - the 5.10 release would probablt suit
the timeline for a distro update.

Cheers,


Jeremy
diff mbox series

Patch

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index c26cc95..b15063f 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -192,6 +192,9 @@  static void pr_log_stdio(int priority, const char *fmt, va_list ap)
 
 	vprintf(fmt, ap);
 	printf("\n");
+
+	if (ctx->debug)
+		fflush(stdout);
 }
 
 /* standard logging prefixes: