View Issue Details

IDProjectCategoryView StatusLast Update
0001193XdebugFeature/Change requestpublic2017-01-13 16:50
ReportergekkieAssigned Toderick 
PrioritynormalSeverityminorReproducibilityhave not tried
Status acknowledgedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001193: Feature request: Chrome Trace format
DescriptionI'd like to request a feature to allow the traceoutput to be in the Chrome tracing format. From my understanding this is a simple(ish) JSON format that would allow easier viewing inside the browser instead of kcachegrind-like applications.

I ask this due to the fact that it's becomming more and more of a go to visualization technique for quickly analyzing a tracefile.

The spec is defined ( but my actual C skills are non existent otherwise i would have liked to provide some kind of implementation ;)
Additional InformationLinks to various articles and documentation:

- the file format spec:

- an article by Riotgames about how they (amongst other things) use this for their application:

- usage of the tracing tool from chromium:
TagsNo tags attached.
Operating Systemn/a
PHP Version5.6.10-5.6.14



2015-11-04 10:26

administrator   ~0003198

This looks like a good add. I'll do some more checking later, after PHP 7 support is out and stable.


2016-12-10 09:53

administrator   ~0003976

I have (finally) had another look at this, but I can't see how I can make it nest depending on function. It doesn't seem that there is a way to show dependencies with this.

If you could make me a JSON file, accompanying a script, of how the tracer would/could visualise a run of a PHP script, then I'm happy to look at this again.


2017-01-03 18:51

administrator   ~0004132

Are you still interested in this gekkie?


2017-01-04 15:33

reporter   ~0004157

@derick, thanks for looking into this! (lost my credentials for a while hence the long delay in my response)

Since my original request things have changed and the need for replacing webgrind has diminished somewhat. (although i still believe in the usefullness to have flamegraphs of PHP processes)

But to answer your question the format for 'nested' calls would be this:
{ ..., "ts": 1.0, "tid": 1, "ph": "B", "name": "A"},
{ ..., "ts": 1.1, "tid": 1, "ph": "B", "name": "Asub"},
{ ..., "ts": 3.9, "tid": 1, "ph": "E"},
{ ..., "ts": 4.0, "tid": 1, "ph": "E"}

This seems to follow the ftrace format in that it's more about timings of events (function calls in php i guess?) than for individual memory usage increases etc...


If anything, i thougth this might have been usefull to visualize the duration / weight of a PHP execution at that time. Since then, with the launch of i.e. this might be less usefull ?


2017-01-11 23:52

administrator   ~0004175

Better does something like this work:

{ "pid": 1, "ts": 1.0, "dur": 15, "tid": 1, "ph": "X", "name": "A"},
{ "pid": 1, "ts": 3.1, "dur": 5, "tid": 1, "ph": "X", "name": "Asub", "args": { "1" : "fasdf" } },
{ "pid": 1, "ts": 10.3, "dur": 1, "tid": 1, "ph": "X", "name": "Bsub" },
{ "pid": 1, "ts": 4.1, "dur": 2.55, "tid": 1, "ph": "X", "name": "Csub", "args": { "1" : "fasdf" } },
{ "pid": 1, "ts": 9.1, "dur": 0.5, "tid": 1, "ph": "X", "name": "Asub", "args": { "1" : "fasdf" } }

Issue History

Date Modified Username Field Change
2015-11-04 09:47 gekkie New Issue
2015-11-04 10:26 derick Note Added: 0003198
2016-12-10 09:53 derick Note Added: 0003976
2016-12-10 09:53 derick Assigned To => derick
2016-12-10 09:53 derick Status new => feedback
2017-01-03 18:51 derick Note Added: 0004132
2017-01-04 15:33 gekkie Note Added: 0004157
2017-01-04 15:33 gekkie Status feedback => assigned
2017-01-11 23:52 derick Note Added: 0004175
2017-01-13 16:50 derick Status assigned => acknowledged