waitstat 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .TH WAITSTAT 3
  2. .SH NAME
  3. waitstat \- kernel waiting times profiling
  4. .SH SYNOPSIS
  5. .nf
  6. .B bind -a #W /dev
  7. .sp
  8. .B /dev/wsctl
  9. .B /dev/wsdata
  10. .fi
  11. .SH DESCRIPTION
  12. The
  13. .I waitstat
  14. device provides profiling
  15. data for the operating system kernel regarding waiting times (usecs) for locks, mostly.
  16. .PP
  17. The file
  18. .B wsdata
  19. holds one line per program counter where a wait of interest happen. The fields
  20. report the type of waiting event, the program counter, the number of times waiting
  21. did happen there, the maximum waiting time, and the total waiting time.
  22. .PP
  23. The file
  24. .B wsdata
  25. controls profiling for this device.
  26. Writing the string
  27. .B start
  28. to
  29. .B wsctl
  30. begins profiling;
  31. .B stop
  32. terminates it. The message
  33. .B clear
  34. restarts profiling after zeroing the counts.
  35. .SH EXAMPLE
  36. The following
  37. .IR rc (1)
  38. script runs a test program while profiling the kernel
  39. and reports the results.
  40. .sp
  41. .EX
  42. bind -a '#W' /dev
  43. echo start > /dev/wsctl
  44. runtest
  45. echo stop > /dev/wsctl
  46. cat /dev/wsdata
  47. .EE
  48. .SH SOURCE
  49. .B /sys/src/9/port/devws.c
  50. .SH SEE ALSO
  51. .IR kprof (3)