linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harshula Jayasuriya <harshula@redhat.com>
To: Steve Dickson <SteveD@redhat.com>, Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] nfsiostat: periodically flush stdout
Date: Tue, 10 Sep 2013 03:17:30 +1000	[thread overview]
Message-ID: <1378747050.4117.122.camel@serendib> (raw)

* 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


             reply	other threads:[~2013-09-09 17:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 17:17 Harshula Jayasuriya [this message]
2013-09-18 19:15 ` [PATCH] nfsiostat: periodically flush stdout Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378747050.4117.122.camel@serendib \
    --to=harshula@redhat.com \
    --cc=SteveD@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).