From patchwork Tue Mar 30 05:24:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Yang X-Patchwork-Id: 89166 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2U5OVGv011666 for ; Tue, 30 Mar 2010 05:24:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755287Ab0C3FY3 (ORCPT ); Tue, 30 Mar 2010 01:24:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639Ab0C3FY2 (ORCPT ); Tue, 30 Mar 2010 01:24:28 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2U5ORUM012598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Mar 2010 01:24:27 -0400 Received: from localhost.localdomain ([10.66.91.72]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2U5OOui016950; Tue, 30 Mar 2010 01:24:25 -0400 From: Feng Yang To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Feng Yang Subject: [PATCH] Update sar command and handle OSError error. Date: Tue, 30 Mar 2010 13:24:24 +0800 Message-Id: <1269926664-7199-1-git-send-email-fyang@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 30 Mar 2010 05:24:31 +0000 (UTC) diff --git a/client/profilers/sar/sar.py b/client/profilers/sar/sar.py index fbe0639..e10156f 100644 --- a/client/profilers/sar/sar.py +++ b/client/profilers/sar/sar.py @@ -21,14 +21,17 @@ class sar(profiler.profiler): logfile = open(os.path.join(test.profdir, "sar"), 'w') # Save the sar data as binary, convert to text after the test. raw = os.path.join(test.profdir, "sar.raw") - cmd = "/usr/bin/sar -o %s %d 0" % (raw, self.interval) + cmd = "/usr/bin/sar -o %s %d " % (raw, self.interval) p = subprocess.Popen(cmd, shell=True, stdout=logfile, \ stderr=subprocess.STDOUT) self.pid = p.pid def stop(self, test): - os.kill(self.pid, 15) + try: + os.kill(self.pid, 15) + except OSError: + pass def report(self, test):