Sampling is one of the CPU profiling modes.
When sampling is used, the profiler periodically queries stacks and times of running threads to estimate the slowest parts of the code. In this mode method invocation counts are not available.
Use profiler toolbar to start CPU sampling as shown on the picture below. There are also alternate methods to start CPU profiling.
Sampling is typically the best option when your goal is to locate and discover performance bottlenecks. With sampling, the profiler adds virtually no overhead to the profiled application. However, the probes for the high-level statistics, if enabled, may impose additional overhead.
See also: Profiling overhead: how to reduce or avoid.
You can configure some CPU sampling aspects with CPU sampling settings.