Rotate Right Zoom - Statistical Sampling

Statistical Sampling

Statistical sampling is the periodic recording of a processor's program counter or instruction pointer.

  • Each sample is taken (triggered) after a fixed period of time has elapsed or set number of events has occurred. In this way samples are taken in code proportionate to where more time is spent or more events occur.
  • Statistical sampling can be either system-wide or target a specific process. System-wide sampling captures all of the processes running on a system, and can include time spent in kernel or driver code as well. Process-targeted sampling can be used to understand time spent waiting for I/O or kernel work.
  • Additional information besides the program counter can be recorded at each interval. For example, other hardware performance counters can be read or the entire function callstack can be recorded. Recording the stack is important because it allows the developer to know not only where time was spent (or events occurred), but also how that code was called.

Read more about this topic:  Rotate Right Zoom