MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001193XdebugFeature/Change requestpublic2015-11-04 09:472017-01-13 16:50
Reportergekkie 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusacknowledgedResolutionopen 
PlatformOSOS Version
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 (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/ [^]) 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: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/ [^]

- an article by Riotgames about how they (amongst other things) use this for their application: https://engineering.riotgames.com/news/random-acts-optimization [^]

- usage of the tracing tool from chromium: https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/trace-event-reading [^]
TagsNo tags attached.
Operating Systemn/a
PHP Version5.6.10-5.6.14
Attached Files

- Relationships

-  Notes
(0003198)
derick (administrator)
2015-11-04 10:26

This looks like a good add. I'll do some more checking later, after PHP 7 support is out and stable.
(0003976)
derick (administrator)
2016-12-10 09:53

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.
(0004132)
derick (administrator)
2017-01-03 18:51

Are you still interested in this gekkie?
(0004157)
gekkie (reporter)
2017-01-04 15:33

@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...

right?

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. blackfire.io this might be less usefull ?
(0004175)
derick (administrator)
2017-01-11 23:52

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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker