Re: [PATCH v3] trace-cmd: Stop recording when processes traced with -P exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 May 2020 12:05:29 -0500
Bijan Tabatabai <bijan311@xxxxxxxxx> wrote:

> From: Bijan Tabatabai <bijan311@xxxxxxxxx>
> 
> When the -F flag is used in trace-cmd record, trace-cmd stops recording
> when the executable it is tracing terminates.
> This patch makes the -P flag act similarly.
> 
> Signed-off-by: Bijan Tabatabai <bijan311@xxxxxxxxx>
> ---
>  This patch has changed to use the pidfd interface to determine if a process
>  has ended.
>  It also has changed to work with the patch "trace-cmd: Handle filtered PIDs per
>  ftarce instance" (5502bcef0f962cda).
> ---
>  tracecmd/include/trace-local.h |  2 +
>  tracecmd/trace-record.c        | 84 ++++++++++++++++++++++++++++++++++
>  2 files changed, 86 insertions(+)
> 

Nice!

Although I just tried it out and noticed that if I run the following
command:

 # sleep 20& sleep 50&
[1] 2216
[2] 2218
 # trace-cmd record -e sched -P 2216 -B foo -e all -P 2218

It will exit out after the first sleep (20 second) and before the second is
done.

It appears to exit as soon as the first process is finished. We should want
to wait till the last one is finished.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux