Project

General

Profile

Actions

Bug #16445

open

ptime should not inhibit other tracers

Added by Joshua M. Clulow about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

The ptime tool is excellent in almost every respect, except that its use to accurately time execution inhibts all other debugging or tracing. Unlike other debuggers, which one could at least detach temporarily so as to swap in another (say, alternating between truss and dtrace), the ptime process must obviously exist for the lifetime of its child. By way of example:

$ ptime sleep 100 &
[1] 8047

$ ptree 8047
504    /usr/sbin/sshd
  7999   /usr/sbin/sshd -R
    8001   /usr/sbin/sshd -R
      8002   -bash
        8047   ptime sleep 100
          8049   sleep 100

$ truss -p 8049
truss: process is traced: 8049

There does not really appear to be any inherent reason that this must be true, other than perhaps that it was convenient to do so with proc interfaces available at the time. Notably, pwait, which also blocks waiting for a nominated set of processes to terminate, does not appear to inhibit tracers. It seems to poll on a proc file for the target process, rather than do a more complete and exclusive grab.

No data to display

Actions

Also available in: Atom PDF