* [PATCH] nfsiostat: periodically flush stdout
@ 2013-09-09 17:17 Harshula Jayasuriya
2013-09-18 19:15 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Harshula Jayasuriya @ 2013-09-09 17:17 UTC (permalink / raw)
To: Steve Dickson, Chuck Lever; +Cc: linux-nfs
* In a shell script, when nfsiostat is run in the background with
stdout redirected to a file, flush stdout periodically to ensure
that we do not lose the buffered output if the nfsiostat process
is killed.
Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
---
tools/nfs-iostat/nfs-iostat.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index c035537..155581c 100644
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -413,6 +413,8 @@ class DeviceData:
self.__print_rpc_op_stats('WRITE', sample_time)
self.__print_page_stats(sample_time)
+ sys.stdout.flush()
+
#
# Functions
#
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] nfsiostat: periodically flush stdout
2013-09-09 17:17 [PATCH] nfsiostat: periodically flush stdout Harshula Jayasuriya
@ 2013-09-18 19:15 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2013-09-18 19:15 UTC (permalink / raw)
To: Harshula Jayasuriya; +Cc: Chuck Lever, linux-nfs
On 09/09/13 13:17, Harshula Jayasuriya wrote:
> * In a shell script, when nfsiostat is run in the background with
> stdout redirected to a file, flush stdout periodically to ensure
> that we do not lose the buffered output if the nfsiostat process
> is killed.
>
> Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
Committed!
steved.
> ---
> tools/nfs-iostat/nfs-iostat.py | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> index c035537..155581c 100644
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -413,6 +413,8 @@ class DeviceData:
> self.__print_rpc_op_stats('WRITE', sample_time)
> self.__print_page_stats(sample_time)
>
> + sys.stdout.flush()
> +
> #
> # Functions
> #
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-18 19:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 17:17 [PATCH] nfsiostat: periodically flush stdout Harshula Jayasuriya
2013-09-18 19:15 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).