mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-141645: Add a TUI mode to the new tachyon profiler (#141646)
This commit is contained in:
parent
e90061f5f1
commit
b3383085f9
17 changed files with 5519 additions and 60 deletions
|
|
@ -1,20 +1,19 @@
|
|||
from abc import ABC, abstractmethod
|
||||
|
||||
# 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)
|
||||
from .constants import (
|
||||
THREAD_STATUS_HAS_GIL,
|
||||
THREAD_STATUS_ON_CPU,
|
||||
THREAD_STATUS_UNKNOWN,
|
||||
THREAD_STATUS_GIL_REQUESTED,
|
||||
)
|
||||
|
||||
class Collector(ABC):
|
||||
@abstractmethod
|
||||
def collect(self, stack_frames):
|
||||
"""Collect profiling data from stack frames."""
|
||||
|
||||
def collect_failed_sample(self):
|
||||
"""Collect data about a failed sample attempt."""
|
||||
|
||||
@abstractmethod
|
||||
def export(self, filename):
|
||||
"""Export collected data to a file."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue