Commit 9344867
authored
refactor(profiling): split stack sampler helpers (#18975)
## Description
Pure refactor of existing stack sampler internals, with no intended behavior or internal contract changes, in preparation for timer_create based cpu time profiling in #18724
Specifically:
- Extracts the existing task/greenlet/thread-stack rendering branch in `ThreadInfo::sample()` into a local `render_unwound_stacks()` helper.
- Extracts duplicate one-time thread registration failure logging in `Sampler::register_thread()` into a local helper.
This does not introduce CPU timer profiling, new configuration, new native bindings, or changes to thread registration semantics.
## Testing
- `scripts/lint cformat`
Attempted a targeted profiling test run from the worktree, but the test runner failed during riot venv setup before executing tests due the worktree using `/home/bits/project/.riot`, which was not writable/available in that context.
## Risks
Low. This is intended to be behavior-preserving refactoring only.
## Additional Notes
No changelog needed, internal refactor only.
Co-authored-by: taegyun.kim <taegyun.kim@datadoghq.com>1 parent 44a33e5 commit 9344867
2 files changed
Lines changed: 22 additions & 13 deletions
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
711 | | - | |
712 | | - | |
| 711 | + | |
| 712 | + | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | 715 | | |
727 | 716 | | |
728 | 717 | | |
| |||
755 | 744 | | |
756 | 745 | | |
757 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
758 | 766 | | |
759 | 767 | | |
760 | 768 | | |
| |||
0 commit comments