From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: How to get perf stat output and redirect to a file rather than screen Date: Thu, 27 Jun 2013 11:49:42 -0600 Message-ID: <51CC7B36.6030201@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pd0-f175.google.com ([209.85.192.175]:40559 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752411Ab3F0Rtq (ORCPT ); Thu, 27 Jun 2013 13:49:46 -0400 Received: by mail-pd0-f175.google.com with SMTP id 4so522827pdd.34 for ; Thu, 27 Jun 2013 10:49:45 -0700 (PDT) In-Reply-To: Sender: linux-perf-users-owner@vger.kernel.org List-ID: To: Peipei Wang Cc: perf group On 6/27/13 11:47 AM, Peipei Wang wrote: > Hi all. > > I want to save the output of perf stat as a file, however, I 've tried > several ways, none of them works. Here is what I have tried. > My basic command is " timeout -s SIGINT 4s perf stat -p 32098". That > is using perf stat to capture process 32098 for 4 seconds. perf stat -o -p 32098 Also, instead of timeout ... you can run: perf sat -o /tmp/perfstat.out -p 32098 -- sleep 4 That tells perf to profile process 32098 and do so for as long as the workload is running where the workload is to sleep for 4 seconds. David