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

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

 



Hi Steve,

> Won't that while loop just go into a spin?
>
> What about something like a fsnotify on a /proc/<pid>/ file?
>
> I rather have trace-cmd sleep and wake up when a task exits, than to do a
> spin. Like it does for the -F option.

I just tried doing this using the inotify API and hit a snag.
It turns out inotify can't monitor pseudo-filesystems like /proc, so I
don't think that suggestion will work.

What if I put a call to sleep in the loop?
It's not the most elegant solution, but that way it wouldn't be too
different from the current code that sleeps for 10 seconds after
checking if finished is set to true.

Thanks,
Bijan



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

  Powered by Linux