Skip to content

feat: add basic information on profiling python code#322

Merged
bhearsum merged 1 commit intomozilla-releng:mainfrom
bhearsum:push-kzqxqnpvotrq
Oct 24, 2025
Merged

feat: add basic information on profiling python code#322
bhearsum merged 1 commit intomozilla-releng:mainfrom
bhearsum:push-kzqxqnpvotrq

Conversation

@bhearsum
Copy link
Copy Markdown
Contributor

No description provided.

@bhearsum bhearsum requested a review from a team as a code owner October 21, 2025 17:20
@bhearsum
Copy link
Copy Markdown
Contributor Author

@Eijebong - flagging you mainly so you can follow-up with the TODO section.

Copy link
Copy Markdown
Contributor

@ahal ahal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

I have this alias setup:

alias py-samply="PYTHONPERFSUPPORT=1 samply record  --include-args"

So you can just do py-samply ./mach taskgraph tasks

@abhishekmadan30
Copy link
Copy Markdown
Contributor

abhishekmadan30 commented Oct 23, 2025

To enable python frame pointers you can use this (Samply) : CFLAGS="-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" pyenv install 3.12
Its from this : https://gist.github.com/jrmuizel/63667a68ccb65ede9346a29c6a29aadc

Also I think we should add the samply only works with python frame pointers on linux currently.
To make it compatible on Mac, you need to create your own python exectuable but that doesnt work for features within mozilla central as ./mach cant be profiled that way but for other repos it can

I can also add this in a subsequent patch

@bhearsum
Copy link
Copy Markdown
Contributor Author

I think both of these could be good additions -- you can both submit follow-ups :)

@bhearsum bhearsum merged commit ae581b9 into mozilla-releng:main Oct 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants