Skip to contentSkip to conversation

perf stat: how to capture the output when it is running in the backgroud

DISCUSSION Hailong Yang 2 participants 3 messages May 13, 2012 – May 14, 2012

lore
Share & tools
lore
#0 lore raw

Dear all,

I am running perf stat to collect the performance statistics of a already running 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.

[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

#1 lore raw
Quoted 7 lines · Hailong Yang

Dear all,

I am running perf stat to collect the performance statistics of a already running 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.

Quoted 7 lines

[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 ~]#

Try: kill -INT $pid

David

#2 lore raw

Thanks, David. That works.

Hailong

Quoted 6 lines

-----Original Message-----
From: David Ahern [mailto:[email protected]]
Sent: Monday, May 14, 2012 3:08 AM
To: Hailong Yang
Cc: [email protected]
Subject: Re: perf stat: how to capture the output when it is running in

the

Quoted 6 lines

backgroud

Quoted 3 lines · Hailong Yang

Dear all,

I am running perf stat to collect the performance statistics of a

already

Quoted 15 lines
Quoted 11 lines

running 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.

[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 ~]#

Try: kill -INT $pid

David