Bug 220327 - ktrace(1) doesn't follow descendants after forks
Summary: ktrace(1) doesn't follow descendants after forks
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-28 07:28 UTC by Yuri Victorovich
Modified: 2017-06-28 07:56 UTC (History)
1 user (show)

See Also:


Attachments
Testcase: pdfork.c (452 bytes, text/x-csrc)
2017-06-28 07:28 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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!