SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Refactor TraceEvent format (#48269)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48269

# Changelog: [Internal]

I've noticed that our definition of Trace Event is different from the one that is defined in Google's doc / V8 / Chrome. This has some flaws:
* It creates fragmentation, like with custom track ids or with mocked process ids.
* Current implementation is strict the relationship between `performance.mark()`, `performance.measure` APIs and Instant, Complete Trace Events. Basically only something recorded with `performance.mark` can be an instant trace event.

This should unblock recording custom trace events inside `PerformanceTracer`, such as when tracing started and others. Same could be said about events related to CPU profiling from Hermes, which will be based on these APIs.

This is the pre-requisite for next diff that will add emitting `TracingStartedInPage` event. With this event, the trace should look similar to the one recorded in the browser, and Timings / Main tracks no longer should be registered manually.

Reviewed By: huntie

Differential Revision: D67207107

fbshipit-source-id: fd7f55dd82167c14a63c2d93aaa649072c5a2a2c
R
Ruslan Lesiutin committed
03a1246c352fe1c75f6356400699cae3930ee8ef
Parent: 4368368
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 12/16/2024, 11:19:16 PM