0

[JSC] Add dumpAndClearSamplingProfilerSamples function · WebKit/WebKit@cc1dd7f ·...

 1 month ago
source link: https://github.com/WebKit/WebKit/commit/cc1dd7f1939dc03e9cf8e606067e3b5e90a78ee9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Commit

Permalink

[JSC] Add dumpAndClearSamplingProfilerSamples function

Browse files Browse the repository at this point in the history

https://bugs.webkit.org/show_bug.cgi?id=259411
rdar://112686960

Reviewed by Justin Michaud.

This patch adds dumpAndClearSamplingProfilerSamples behind a flag, which dumps sampling profiler data into temp file.
This allows us to automated sampling data collection for benchmarks by calling this function at the right timing.
We also significantly expand the JSON data generation of SamplingProfiler to reconstruct enough information from this output.

We also attach display-sampling-profiler-output script as the same to display-profiler-output. Which can feed the above JSON
and dump sampling profiler output.

* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::enableSamplingProfiler):
(JSC::VM::disableSamplingProfiler):
(JSC::VM::takeSamplingProfilerSamplesAsJSONString):
* Source/JavaScriptCore/runtime/VM.h:

Canonical link: https://commits.webkit.org/266270@main
Constellation committed Jul 24, 2023
1 parent e812d68 commit cc1dd7f

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK