From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Theurer Subject: Re: perf stat to collect the performance statistics of KVM process Date: Mon, 14 May 2012 08:43:13 -0500 Message-ID: <4FB10BF1.5080807@linux.vnet.ibm.com> References: <4fafd9af.62ee440a.4f7f.6049@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Hailong Yang Return-path: Received: from e1.ny.us.ibm.com ([32.97.182.141]:58416 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755030Ab2ENNpL (ORCPT ); Mon, 14 May 2012 09:45:11 -0400 Received: from /spool/local by e1.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 May 2012 09:45:10 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 26E6238C8056 for ; Mon, 14 May 2012 09:44:29 -0400 (EDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4EDiSuD157784 for ; Mon, 14 May 2012 09:44:29 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4EDiSnH005152 for ; Mon, 14 May 2012 07:44:28 -0600 In-Reply-To: <4fafd9af.62ee440a.4f7f.6049@mx.google.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/13/2012 10:56 AM, Hailong Yang wrote: > Dear all, > > I am running perf stat to collect the performance statistics of the already > running KVM guest VM process. And I have a shell script to execute the perf > stat as a daemon process. But when I use the 'kill' command to stop the perf > stat, there is no output redirected to a file. What I would like to do is > that to collect performance counters of the guest VM process for a certain > period and redirect the output to a log file, but without user interaction > (such as using CTRL + C to stop the perf stat) > > [root@dell06 ~]# (perf stat -p 7473 -x ,) 2> perftest& > [1] 15086 > [root@dell06 ~]# kill 15086 > [root@dell06 ~]# > [1]+ Terminated ( perf stat -p 7473 -x , ) 2> perftest > [root@dell06 ~]# cat perftest > [root@dell06 ~]# > > Any clue? Can you please try "kill -s INT " > > Best Regards > > Hailong > -Andrew Theurer