From patchwork Mon Apr 12 07:35:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Yang X-Patchwork-Id: 91999 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 o3C7ZOMh029460 for ; Mon, 12 Apr 2010 07:35:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969Ab0DLHfV (ORCPT ); Mon, 12 Apr 2010 03:35:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58048 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737Ab0DLHfT (ORCPT ); Mon, 12 Apr 2010 03:35:19 -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.13.8/8.13.8) with ESMTP id o3C7ZGQH032085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Apr 2010 03:35:16 -0400 Received: from localhost.localdomain ([10.66.91.72]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3C7ZEYh015577; Mon, 12 Apr 2010 03:35:15 -0400 From: Feng Yang To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Feng Yang Subject: [PATCH] KVM Test: Make sar profiler could work in python 2.4 Date: Mon, 12 Apr 2010 15:35:13 +0800 Message-Id: <1271057713-32104-1-git-send-email-fyang@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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]); Mon, 12 Apr 2010 07:35:24 +0000 (UTC) diff --git a/client/profilers/sar/sar.py b/client/profilers/sar/sar.py index 2618646..7ee28b3 100644 --- a/client/profilers/sar/sar.py +++ b/client/profilers/sar/sar.py @@ -41,8 +41,8 @@ class sar(profiler.profiler): else: # Sar process didn't return, so 0 means generate continuously # Just terminate the process - self.cmd = self.sar_path + "-o %s %d 0" - t_process.terminate() + self.cmd = self.sar_path + " -o %s %d 0" + os.kill(t_process.pid, 15) def start(self, test): @@ -65,8 +65,10 @@ class sar(profiler.profiler): @param test: Autotest test on which this profiler will operate on. """ - self.sar_process.terminate() - + try: + os.kill(self.sar_process.pid, 15) + except OSError: + pass def report(self, test): """