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 |
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?
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 --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:
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(+)