Skip to content
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

[JSC] Emit dyld tracepoint to tell system profiler about JIT code region #26271

Conversation

Constellation
Copy link
Member

@Constellation Constellation commented Mar 21, 2024

2645a1e

[JSC] Emit dyld tracepoint to tell system profiler about JIT code region
https://bugs.webkit.org/show_bug.cgi?id=271419
rdar://125196249

Reviewed by Justin Michaud.

This patch emits fake dyld tracepoint which tells our system profiler (see SystemTracing.h) about JIT code region.
We need to assign good UUID to this JIT code region. And since this is JIT code, each process has different JIT code.
Thus, we create v5 UUID from process ID and namespace UUID and attach it to JIT code region.

* Source/JavaScriptCore/jit/ExecutableAllocator.cpp:
(JSC::initializeJITPageReservation):
* Source/WTF/wtf/ByteOrder.h:
(WTF::bswap64):
* Source/WTF/wtf/UUID.cpp:
(WTF::UUID::createVersion5):
* Source/WTF/wtf/UUID.h:

Canonical link: https://commits.webkit.org/276524@main

564f537

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2   πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
  πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  wpe-skia
  πŸ›  πŸ§ͺ jsc βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
  πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ gtk-wk2
  πŸ›  tv-sim βœ… πŸ§ͺ api-gtk
  πŸ›  watch βœ… πŸ›  jsc-armv7
βœ… πŸ›  πŸ§ͺ unsafe-merge βœ… πŸ›  watch-sim βœ… πŸ§ͺ jsc-armv7-tests

@Constellation Constellation requested a review from a team as a code owner March 21, 2024 22:24
@Constellation Constellation self-assigned this Mar 21, 2024
@Constellation Constellation added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Mar 21, 2024
Copy link
Contributor

@justinmichaud justinmichaud left a comment

Choose a reason for hiding this comment

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

r=me

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 21, 2024
@Constellation Constellation removed the merging-blocked Applied to prevent a change from being merged label Mar 22, 2024
@Constellation Constellation force-pushed the eng/JSC-Emit-dyld-tracepoint-to-tell-system-profiler-about-JIT-code-region branch from 41424ae to 564f537 Compare March 22, 2024 01:29
@Constellation Constellation added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 22, 2024
https://bugs.webkit.org/show_bug.cgi?id=271419
rdar://125196249

Reviewed by Justin Michaud.

This patch emits fake dyld tracepoint which tells our system profiler (see SystemTracing.h) about JIT code region.
We need to assign good UUID to this JIT code region. And since this is JIT code, each process has different JIT code.
Thus, we create v5 UUID from process ID and namespace UUID and attach it to JIT code region.

* Source/JavaScriptCore/jit/ExecutableAllocator.cpp:
(JSC::initializeJITPageReservation):
* Source/WTF/wtf/ByteOrder.h:
(WTF::bswap64):
* Source/WTF/wtf/UUID.cpp:
(WTF::UUID::createVersion5):
* Source/WTF/wtf/UUID.h:

Canonical link: https://commits.webkit.org/276524@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/JSC-Emit-dyld-tracepoint-to-tell-system-profiler-about-JIT-code-region branch from 564f537 to 2645a1e Compare March 22, 2024 04:04
@webkit-commit-queue
Copy link
Collaborator

Committed 276524@main (2645a1e): https://commits.webkit.org/276524@main

Reviewed commits have been landed. Closing PR #26271 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 2645a1e into WebKit:main Mar 22, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 22, 2024
@rkirsling
Copy link
Member

rkirsling commented Mar 22, 2024

Unfortunately, the names bswap64, bswap32, and bswap16 are #defines on FreeBSD.
https://cgit.freebsd.org/src/tree/sys/sys/endian.h#n67

@Constellation Constellation deleted the eng/JSC-Emit-dyld-tracepoint-to-tell-system-profiler-about-JIT-code-region branch March 22, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.
Projects
None yet
6 participants