Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-135953: Add flamegraph reporter to sampling profiler #138304

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

Closed
lkollar wants to merge 19 commits into python:main from lkollar:profiling/flamegraph
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f82c991
Remove unused variables in sample profiler
lkollar Aug 27, 2025
e7ff0d1
Add HTML flamegraph to sampling profiler
lkollar Aug 27, 2025
a9b1213
Avoid displaying popup outside viewport
lkollar Aug 31, 2025
e1c56ee
fixup! Add HTML flamegraph to sampling profiler
lkollar Aug 31, 2025
3a64277
Vendor D3 files and Python logo
lkollar Sep 7, 2025
e5139c7
Update Makefile.pre.in
lkollar Sep 7, 2025
37134d8
Move licenses into license.rst
lkollar Sep 7, 2025
09d04fa
Update license.rst
lkollar Sep 7, 2025
3799731
Update license.rst
lkollar Sep 7, 2025
4f10915
fixup! Update license.rst
pablogsal Sep 8, 2025
fb48a88
fixup! fixup! Update license.rst
pablogsal Sep 8, 2025
8882b27
fixup! fixup! fixup! Update license.rst
pablogsal Sep 8, 2025
738bd0a
Update Lib/test/test_profiling/test_sampling_profiler.py
lkollar Sep 9, 2025
4e63501
Shorten lines in flamegraph.js
lkollar Sep 9, 2025
eef995d
Watch for readystate before initialising flamegraph UI
lkollar Sep 9, 2025
97474d6
Add .min.js to .gitattributes
lkollar Sep 9, 2025
8291df0
Break up large functions in flamegraph.js
lkollar Sep 9, 2025
a780144
Use importlib.resources to locate flamegraph assets
lkollar Sep 9, 2025
9d3956d
fixup! Update Lib/test/test_profiling/test_sampling_profiler.py
lkollar Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
*.min.js generated
30 changes: 30 additions & 0 deletions Doc/license.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1169,3 +1169,33 @@ contributors. The pyzstd code is distributed under the 3-Clause BSD License::
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Profiling module
----------------

The :mod:`!profiling` module includes vendored third-party libraries in
:file:`Lib/profiling/sampling/_vendor/` with the following licenses:

**d3-flamegraph**

The d3-flamegraph library is distributed under the Apache License, Version 2.0.
See the OpenSSL section above for the full text of the Apache License Version 2.0.

**d3.js**

The d3.js library contains the following notice::

Copyright 2010-2021 Mike Bostock

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
View file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[フレーム]
View file Open in desktop

Large diffs are not rendered by default.

View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.d3-flame-graph rect {
stroke: #EEEEEE;
fill-opacity: .8;
}

.d3-flame-graph rect:hover {
stroke: #474747;
stroke-width: 0.5;
cursor: pointer;
}

.d3-flame-graph-label {
pointer-events: none;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 12px;
font-family: Verdana;
margin-left: 4px;
margin-right: 4px;
line-height: 1.5;
padding: 0 0 0;
font-weight: 400;
color: black;
text-align: left;
}

.d3-flame-graph .fade {
opacity: 0.6 !important;
}

.d3-flame-graph .title {
font-size: 20px;
font-family: Verdana;
}

.d3-flame-graph-tip {
background-color: black;
border: none;
border-radius: 3px;
padding: 5px 10px 5px 10px;
min-width: 250px;
text-align: left;
color: white;
z-index: 10;
}
View file Open in desktop

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Lib/profiling/sampling/_vendor/d3/7.8.5/d3.min.js
View file Open in desktop

Large diffs are not rendered by default.

Loading
Loading

AltStyle によって変換されたページ (->オリジナル) /