ratrace 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .TH RATRACE 1
  2. .SH NAME
  3. ratrace \- trace process system calls
  4. .SH SYNOPSIS
  5. .B ratrace
  6. [
  7. .I -o tracefile
  8. ]
  9. [
  10. .I pid
  11. ] | [
  12. .I -c command
  13. ]
  14. .SH DESCRIPTION
  15. .I Ratrace
  16. shows the system calls executed by a process,
  17. either the one with
  18. .I pid
  19. or a fresh invocation of
  20. .IR command .
  21. .PP
  22. Trace output is determined by the kernel, not
  23. .IR ratrace .
  24. Certain fixed rules apply.
  25. Trace output by default goes to file descriptor 2.
  26. Option \fB-o\fP can be used to switch trace output to \fItracefile\fP.
  27. .PP
  28. The first four fields of the output are
  29. pid, text name, system call name, and the PC of the user program.
  30. Data is always printed as
  31. .IB pointer /\c
  32. "\fIstring\fP",
  33. where the
  34. .I string
  35. is the first 32 bytes of the data, with
  36. .L \&.
  37. replacing non-printing ASCII characters
  38. (printing characters are those between ASCII space (SP) and delete (DEL), exclusive).
  39. Return values follow an
  40. .LR = ,
  41. and include the integer return value,
  42. the
  43. .I errstr
  44. (with "" if there is no
  45. .IR errstr ),
  46. and
  47. the start and stop times for the system call in nanoseconds.
  48. The times are exclusive of the overhead for tracing.
  49. .SH FILES
  50. .BI /proc/ pid /syscall
  51. .br
  52. .BI /proc/ pid /ctl
  53. .SH SOURCE
  54. .B /sys/src/cmd/ratrace.c
  55. .SH "SEE ALSO"
  56. .IR acid (1),
  57. .IR db (1),
  58. .IR proc (3)
  59. .SH BUGS
  60. The printing of the data is too limited in length;
  61. printing
  62. .L \&.
  63. instead of something more sensible is limiting.