Movatterモバイル変換


[0]ホーム

URL:


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-103295: expose API for writing perf map files#103546

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 60 commits intopython:mainfromgsallam:main
May 21, 2023

Conversation

gsallam
Copy link
Contributor

@gsallamgsallam commentedApr 14, 2023
edited by bedevere-bot
Loading

#96123 added support for CPython to write /tmp/perf-.map files, associating instruction address ranges with a human-readable frame name for the Linux perf profiler.

Two external Python JIT compilers,Cinder andPyston, both also independently write to perf map files.

Since perf map files are one-per-process, multiple separate libraries trying to write perf map entries independently can lead to file corruption from simultaneous writes.

It's unlikely for both Cinder and Pyston JITs to be used in the same process, but it's quite reasonable to use one of these JITs along with CPython's native perf trampoline support.

This PR add a C-API to write to the perf map file. It also update the perf trampoline to use the new API to write to the perf map file.

EdwaRen reacted with hooray emoji
@ghost
Copy link

ghost commentedApr 14, 2023
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

4 similar comments
@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@gsallamgsallam marked this pull request as ready for reviewApril 16, 2023 20:50
@arhadthedevarhadthedev added the interpreter-core(Objects, Python, Grammar, and Parser dirs) labelApr 19, 2023
@czardoz
Copy link
Contributor

Looks like the CI is having trouble installing dependencies, I will update this branch with rebase and try again in a bit

facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull requestMay 19, 2023
Summary: Backport the perf-trampoline introduced inpython/cpython#96123.  The perf trampoline doesn't work properly with the JIT, so we have submitted a PR to have a C-API to unify writing to the perf-map filespython/cpython#103546.Reviewed By: czardozDifferential Revision: D45419843fbshipit-source-id: 16bd13d7981e48c9eb7bc0e5eef1c1f4748965f6
facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull requestMay 19, 2023
Summary:With the perf trampoline writing to the perf-map files, we want to have a C-API to unify writing to the perf-map files to avoid file corruption from simultaneous writes. We are trying to upstream the API herepython/cpython#103546. More details about the motivation is in the PR.In addition to introducing the C-API, we also change JIT to utilize the new C-API.Reviewed By: czardozDifferential Revision: D45421966fbshipit-source-id: d270cc753a245f93cbfe3d723d0880595fef45f2
@carljmcarljm requested a review fromsunmy2019May 20, 2023 03:41
@carljmcarljm added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 20, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@carljm for commit10630e8 🤖

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 20, 2023
* main: (30 commits)pythongh-103987: fix several crashes in mmap module (python#103990)  docs: fix wrong indentation causing rendering error in dis page (python#104661)pythongh-94906: Support multiple steps in math.nextafter (python#103881)pythongh-104472: Skip `test_subprocess.ProcessTestCase.test_empty_env` if ASAN is enabled (python#104667)pythongh-103839: Allow building Tkinter against Tcl 8.7 without external libtommath (pythonGH-103842)pythongh-85984: New additions and improvements to the tty library. (python#101832)pythongh-104659: Consolidate python examples in enum documentation (python#104665)pythongh-92248: Deprecate `type`, `choices`, `metavar` parameters of `argparse.BooleanOptionalAction` (python#103678)pythongh-104645: fix error handling in marshal tests (python#104646)pythongh-104600: Make type.__type_params__ writable (python#104634)pythongh-104602: Add additional test for listcomp with lambda (python#104639)pythongh-104640: Disallow walrus in comprehension within type scopes (python#104641)pythongh-103921: Rename "type" header in argparse docs (python#104654)  Improve readability of `typing._ProtocolMeta.__instancecheck__` (python#104649)pythongh-96522: Fix deadlock in pty.spawn (python#96639)pythonGH-102818: Do not call `PyTraceBack_Here` in sys.settrace trampoline.  (pythonGH-104579)pythonGH-103545: Add macOS specific constants for ``os.setpriority`` to ``os`` (python#104606)pythongh-104623: Update macOS installer to SQLite 3.42.0 (pythonGH-104624)pythongh-104619: never leak comprehension locals to outer locals() (python#104637)pythongh-104602: ensure all cellvars are known up front (python#104603)  ...
@carljmcarljm added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 20, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@carljm for commite6be2a7 🤖

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 20, 2023
@carljm
Copy link
Member

carljm commentedMay 20, 2023
edited
Loading

Refleak buildbot failures are unrelated, they are all failing intest_mmap, which is a known issue on main:#104698. Otherwise buildbots look happy.

I think this is ready for merge;@pablogsal I will plan to merge it tomorrow evening unless you have objections!

Eclips4 and pablogsal reacted with thumbs up emoji

@pablogsalpablogsal merged commitbe0c106 intopython:mainMay 21, 2023
@pablogsal
Copy link
Member

I think this is ready for merge;@pablogsal I will plan to merge it tomorrow evening unless you have objections!

I went ahead and land it myself after another review pass 😉

Great job everyone!

sunmy2019, gsallam, and carljm reacted with hooray emoji

facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull requestMay 24, 2023
Summary:Port the latest changes from the [perf-map C-API PR](python/cpython#103546). This includes using error codes instead of exceptions to avoid the need to hold the GIL.Additionally, there was an issue with Fedora on a 32-bit system that was fixed in this [PR](python/cpython#104811), so I also ported the fix.Reviewed By: carljmDifferential Revision: D46041553fbshipit-source-id: 6502189f489ca6cf11949ecd93c044e5ebe4fd2c
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@carljmcarljmcarljm left review comments

@czardozczardozczardoz left review comments

@pablogsalpablogsalpablogsal left review comments

@gpsheadgpsheadgpshead approved these changes

@sunmy2019sunmy2019sunmy2019 approved these changes

Assignees
No one assigned
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@gsallam@bedevere-bot@czardoz@carljm@pablogsal@gpshead@sunmy2019@arhadthedev

[8]ページ先頭

©2009-2025 Movatter.jp