I just tried that and discovered an interesting problem. After the first sleep ended, my computer completely locked up, and after a few minutes I decided to reset my computer. Then after rebooting, I checked out the master branch, recompiled, and tried running the same set of commands again. This time, my computer locked up shortly after I pressed Ctrl+C after both sleeps exited. I am running Ubuntu 20.04 with Ubuntu's version of the 5.4 kernel. Is this a bug that has been reported before? If not, what is the process for "officially" reporting it? Thank, Bijan On Wed, May 13, 2020 at 3:16 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > 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