[webkit-changes] [WebKit/WebKit] cc1dd7: [JSC] Add dumpAndClearSamplingProfilerSamples func...

Yusuke Suzuki noreply at github.com
Mon Jul 24 16:42:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc1dd7f1939dc03e9cf8e606067e3b5e90a78ee9
      https://github.com/WebKit/WebKit/commit/cc1dd7f1939dc03e9cf8e606067e3b5e90a78ee9
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-07-24 (Mon, 24 Jul 2023)

  Changed paths:
    M JSTests/stress/sampling-profiler-anonymous-function.js
    M JSTests/stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js
    M JSTests/stress/sampling-profiler/samplingProfiler.js
    M Source/JavaScriptCore/jsc.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/SamplingProfiler.cpp
    M Source/JavaScriptCore/runtime/SamplingProfiler.h
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/JavaScriptCore/runtime/VM.h
    A Tools/Scripts/display-sampling-profiler-output

  Log Message:
  -----------
  [JSC] Add dumpAndClearSamplingProfilerSamples function
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




More information about the webkit-changes mailing list