From patchwork Mon Sep 9 17:17:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harshula Jayasuriya X-Patchwork-Id: 2862591 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0CCCE9F485 for ; Mon, 9 Sep 2013 17:17:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC85A20303 for ; Mon, 9 Sep 2013 17:17:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93DDB202F6 for ; Mon, 9 Sep 2013 17:17:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168Ab3IIRRg (ORCPT ); Mon, 9 Sep 2013 13:17:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751171Ab3IIRRg (ORCPT ); Mon, 9 Sep 2013 13:17:36 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r89HHXuU029572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Sep 2013 13:17:33 -0400 Received: from [10.3.113.15] ([10.3.113.15]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r89HHVUa006960; Mon, 9 Sep 2013 13:17:32 -0400 Message-ID: <1378747050.4117.122.camel@serendib> Subject: [PATCH] nfsiostat: periodically flush stdout From: Harshula Jayasuriya To: Steve Dickson , Chuck Lever Cc: linux-nfs@vger.kernel.org Date: Tue, 10 Sep 2013 03:17:30 +1000 Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * 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 --- 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 #