Open Bug 1969379 Opened 1 year ago Updated 1 year ago

Support profiler markers in the shell

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

People

(Reporter: iain, Assigned: iain)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

To allow samply and other profilers to identify which parts of a benchmark run count as measured time, the browser supports dumping information to an external file for each call to performance.mark/measure.

To help with tooling for JetStream 3, we should add similar functionality to the shell.

This patch supports a limited version of performance.mark/measure to emit entries in an external marker file for use in profiling.

Note that the semantics of mark/measure are different here than in the browser. In the browser:

  1. mark and measure both return objects.
  2. The startMark and endMark arguments to measure are expected to be strings.
  3. mark adds a durationless marker to the performance timeline, and measure adds a range to the timeline.

In this implementation:

  1. mark returns an object, but measure doesn't return anything.
  2. measure only supports the (name, startMark) version, and startMark must be the object returned by an earlier call to mark.
  3. mark has no side-effects. measure adds a line to the external marker file with the start and end timestamps, and the label.

This currently dumps whatever PRMJ_Now returns (which I think is unix timestamps).

To work with JetStream, the runner must be modified to treat SM the same way it already treats V8:
https://github.com/iainireland/JetStream/commit/d9e1781ed834d778f605400fd03346aeae13b4cd

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: