Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
4.4 KiB

  1. Installing and Using
  2. Profile.exe
  3. Windows NT Sampling Profiler
  4. Windows NT v4.0
  5. Overview:
  6. The Windows NT Sampling Profiler is an easy to use tool that records
  7. the how often each function of an application is called during the
  8. course of that application.
  9. Installation:
  10. Required Files:
  11. PROFILE.EXE Windows NT Sampling Profiler
  12. Installed from the SDK
  13. PSAPI.DLL Process Support API Library
  14. Installed from the SDK
  15. Before trying to use the Sampling Profile make sure the required
  16. files listed above are in the path.
  17. Use:
  18. Required Environment Variables:
  19. The Sampling profiler must have access to the image's symbols
  20. in order to produce the most meaningful output. The sybmols
  21. are searched in the path described by the
  22. _NT_SYMBOL_PATH
  23. environment variable. Be sure to set this variable to the
  24. correct path before attempting the profile.
  25. Command Line Arguments:
  26. Usage: profile [/a] [/innn] [/k] name-of-image [parameters]...
  27. /a All hits
  28. /bnnn Set profile bucket size to 2 to the nnn bytes
  29. /ffilename Output to filename
  30. /innn Set profile interval to nnn (in 100ns units)
  31. /k profile system modules
  32. /s[profilesource] Use profilesource instead of clock interrupt
  33. /S[profilesource] Use profilesource as secondary profile source
  34. /a
  35. will display ALL hits or addresses that were sampled during
  36. the test run. Normally the hits are summarized by function.
  37. /bnnn
  38. Sets the profile bucket size (in bytes) to use. The default
  39. is 4 bytes. This determines the sample address granularity.
  40. /ffilename
  41. set the output file that is produced when the sampled program
  42. terminates. The defalt for this is "profile.out"
  43. /innn
  44. Sets the sample interval in 100 nS units. The default value
  45. is 488.2 microseconds (or /i4882)
  46. /k
  47. allows processing of system functions that are called by
  48. the process being profiled. Normally on the the user mode
  49. functions of the process are profiled.
  50. /sprofilesource
  51. changes the profile sample interrupt from the clock interrupt
  52. to another source. This option is not supported on all
  53. platforms, however.
  54. ALPHA Options:
  55. align
  56. totalissues
  57. pipelinedry
  58. loadinstructions
  59. pipelinefrozen
  60. branchinstructions
  61. totalnonissues
  62. dcachemisses
  63. icachemisses
  64. branchmispredicts
  65. storeinstructions
  66. MIPS options:
  67. align
  68. /Sprofilesource
  69. same options as above only this selects the secondary profile
  70. interrupt source
  71. Sample Command Lines:
  72. profile myprog.exe
  73. profiles the program "myprog.exe" using the default
  74. settings and monitoring only the user mode functions.
  75. The output is written to the default filename of
  76. "profile.out" in the default directory.
  77. profile /k /fMyProg.dat myprog.exe
  78. profiles the program "myprog.exe" using the default
  79. settings and monitoring both the user mode and the
  80. kernel mode functions executed by this process
  81. The output is written to the user specified filename
  82. of "MyProg.dat" in the default directory.
  83. While the program being profiled runs, the instruction pointer is being
  84. sampled periodicaly and profile records the value of the instruction
  85. pointer each time the sample occurs inside the profiled process. When the
  86. program terminates the recorded address values are looked up in the symbol
  87. files to determine the function being run at the time. The tabulation
  88. of the results is then output to the specified, or default, filename.
  89. The output consists of 3 comma separated fields. The first field is the
  90. number of times a sample occured in the function. The second field is the
  91. name of the module containing that function and the third field is the
  92. name of the function within the module followed by it's virtual
  93. address. In a verbose listing each of these function entries is followed
  94. by a listing of the actual addresses that were sampled.