-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
gh-141645: Add a TUI mode to the new tachyon profiler #141646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
bac7bfa
gh-141645: Add a TUI mode to the new tachyon profiler
pablogsal 757ce0a
use sampling rate in progress bar
pablogsal 85bada1
Fix failed samples calculation
pablogsal 4a7df35
Add GIL flags
pablogsal d45f012
fix sample rate
pablogsal b1b9614
Update Lib/profiling/sampling/live_collector.py
pablogsal af9dd77
Update Lib/profiling/sampling/live_collector.py
pablogsal 0e70587
Update Lib/profiling/sampling/sample.py
pablogsal 7a43706
refactor live mode
pablogsal f597f8e
Implement color management and and S
pablogsal 9f12a5c
Remove exception arg
pablogsal e2ff9fc
Fix tests
pablogsal 6b21c9a
Remove pass
pablogsal 4473aa9
Small refactor
pablogsal 20c4d27
Split tests
pablogsal 142b116
Implement per-thread switcher
pablogsal 1543ce5
Supress stdin to not leave things hanging
pablogsal 00dc8e7
Simplify
pablogsal 5035156
Fix HZ update
pablogsal b69ebdd
Merge remote-tracking branch 'upstream/main' into live-tui
pablogsal 1034708
Reorder tests
pablogsal 1864e17
Fix tests
pablogsal c160d8d
Implement color diffing
pablogsal 985680c
Change default sorting
pablogsal b5550f5
Fix tests
pablogsal 5ef23e3
Check for curses
pablogsal 99b19e0
UX improvements
pablogsal a51766a
Address feedback and ensuring the TUI works at the end
pablogsal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| """Constants for the sampling profiler.""" | ||
|
|
||
| # Profiling mode constants | ||
| PROFILING_MODE_WALL = 0 | ||
| PROFILING_MODE_CPU = 1 | ||
| PROFILING_MODE_GIL = 2 | ||
| PROFILING_MODE_ALL = 3 # Combines GIL + CPU checks | ||
|
|
||
| # Sort mode constants | ||
| SORT_MODE_NSAMPLES = 0 | ||
| SORT_MODE_TOTTIME = 1 | ||
| SORT_MODE_CUMTIME = 2 | ||
| SORT_MODE_SAMPLE_PCT = 3 | ||
| SORT_MODE_CUMUL_PCT = 4 | ||
| SORT_MODE_NSAMPLES_CUMUL = 5 | ||
|
|
||
| # Thread status flags | ||
| try: | ||
| from _remote_debugging import ( | ||
| THREAD_STATUS_HAS_GIL, | ||
| THREAD_STATUS_ON_CPU, | ||
| THREAD_STATUS_UNKNOWN, | ||
| THREAD_STATUS_GIL_REQUESTED, | ||
| ) | ||
| except ImportError: | ||
| # Fallback for tests or when module is not available | ||
| THREAD_STATUS_HAS_GIL = (1 << 0) | ||
| THREAD_STATUS_ON_CPU = (1 << 1) | ||
| THREAD_STATUS_UNKNOWN = (1 << 2) | ||
| THREAD_STATUS_GIL_REQUESTED = (1 << 3) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.