Bug 220327

Summary: ktrace(1) doesn't follow descendants after forks
Product: Base System Reporter: Yuri Victorovich <yuri>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Not A Bug    
Severity: Affects Only Me CC: dchagin
Priority: ---    
Version: 11.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Testcase: pdfork.c none

Description Yuri Victorovich freebsd_committer freebsd_triage 2017-06-28 07:28:56 UTC
Created attachment 183876 [details]
Testcase: pdfork.c

The attached program pdfork.c forks and launches /bin/ls. When run under ktrace(1), child process is launched, but doesn't appear in the trace file despite of the -d flag.

> ktrace -d pdfork
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2017-06-28 07:29:31 UTC
FreeBSD 11.0-STABLE r317247
Comment 2 Dmitry Chagin freebsd_committer freebsd_triage 2017-06-28 07:46:36 UTC
run ktrace with -di flags, as:

     -d      Descendants; perform the operation for all current children of
             the designated processes.
     -i      Inherit; pass the trace flags to all future children of the
             designated processes.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2017-06-28 07:56:35 UTC
Thanks!