From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hailong Yang" Subject: perf stat to collect the performance statistics of KVM process Date: Sun, 13 May 2012 23:56:28 +0800 Message-ID: <4fafd9af.62ee440a.4f7f.6049@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:35962 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877Ab2EMP4c (ORCPT ); Sun, 13 May 2012 11:56:32 -0400 Received: by pbbrp8 with SMTP id rp8so5151341pbb.19 for ; Sun, 13 May 2012 08:56:32 -0700 (PDT) Content-Language: zh-cn Sender: kvm-owner@vger.kernel.org List-ID: 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? Best Regards Hailong