[release/6.0] Always write sample events in EventPipe based on sample frequency. (#58761)
* Always write sample events in EventPipe based on sample frequency.
If no managed frames (including helper frames) are located on stack,
sample was dropped and not emitted into EventPipe. This cause issues
in tooling that try to do thread time calculations based on sample,
especially in cases where embedded threads returned to native
code during several samples before calling back into runtime. In such
scenarios the last sampled event would be prolonged, giving false
information that that stackframe lasted much longer than it really did.
Always writing samples into EventPipe will also visualize time an attached
thread spend outside of runtime, not running managed code.
* Adjust included profiler samples.
Only include external samples still on top fram (no callstack) or
managed/external samples includig a callstack.
Co-authored-by: lateralusX <lateralusx.github@gmail.com>