Skip to content

Add async awareness to Tachyon profiler #141565

@savannahostrowski

Description

@savannahostrowski

Feature or enhancement

Currently, Tachyon has no awareness of the async call stack, so flamegraphs for async code don't show the logical task hierarchy and are not very useful to users. The profiler should reconstruct async task dependencies and display them in the flamegraph to make async code profiling actionable.

Current state for a basic async program:

Image

...and asyncio's pstree for the same program:

└── (T) Task-1
    └──  main /Users/savannah/code/cpython/sandbox/test_simple_async.py:59
        └──  wait_for /Users/savannah/code/cpython/Lib/asyncio/tasks.py:488
            └── (T) Supervisor
                └──  supervisor /Users/savannah/code/cpython/sandbox/test_simple_async.py:41
                    ├── (T) Worker-0
                    │   └──  worker /Users/savannah/code/cpython/sandbox/test_simple_async.py:24
                    │       └── (T) LeafTask-0
                    │           └──  leaf_work /Users/savannah/code/cpython/sandbox/test_simple_async.py:13
                    │               └──  sleep /Users/savannah/code/cpython/Lib/asyncio/tasks.py:702
                    ├── (T) Worker-1
                    │   └──  worker /Users/savannah/code/cpython/sandbox/test_simple_async.py:24
                    │       └── (T) LeafTask-1
                    │           └──  leaf_work /Users/savannah/code/cpython/sandbox/test_simple_async.py:13
                    │               └──  sleep /Users/savannah/code/cpython/Lib/asyncio/tasks.py:702
                    └── (T) Worker-2
                        └──  worker /Users/savannah/code/cpython/sandbox/test_simple_async.py:24
                            └── (T) LeafTask-2
                                └──  leaf_work /Users/savannah/code/cpython/sandbox/test_simple_async.py:13
                                    └──  sleep /Users/savannah/code/cpython/Lib/asyncio/tasks.py:702```

Linked PRs

Metadata

Metadata

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-profilingtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions