1
0

ptrace 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. .TH UART 3
  2. .SH NAME
  3. ptrace \- process scheduling traces
  4. .SH SYNOPSIS
  5. .nf
  6. .B bind -a #σ /dev
  7. .B /dev/ptrace
  8. .B /dev/ptracectl
  9. .fi
  10. .SH DESCRIPTION
  11. .PP
  12. The process trace device is a replacement for the trace facility in
  13. .IR proc (3)
  14. to report more information about process events.
  15. .PP
  16. The
  17. .B ptracectl
  18. admits the following requests:
  19. .TP
  20. .BI size " n
  21. Set the size of the buffer to
  22. .I n
  23. entries. Before issuing this request tracing is not enabled.
  24. .TP
  25. .BI trace " pid value"
  26. Set the trace on or off for the process with the given pid.
  27. .PP
  28. The
  29. .B ptrace
  30. file reports an integral number of events when read. To avoid
  31. too much interference with scheduling, it does not block readers.
  32. When no more events are available the read returns an EOF indication,
  33. but the program is expected to poll the device for further events.
  34. This behavior mimics what
  35. .IR proc (3)
  36. does with the trace interface.
  37. .SH SOURCE
  38. .B /sys/src/9/port/devptrace.c
  39. .br
  40. .B /sys/src/9k/port/devptrace.c
  41. .SH "SEE ALSO
  42. .IR ptrace (1),
  43. .IR ptrace (2).
  44. .SH BUGS
  45. If the buffer size is too small, events will be discarded.
  46. .PP
  47. The reader must poll the trace device.