uftrace icon indicating copy to clipboard operation
uftrace copied to clipboard

support firefox profiler with uftrace dump --firefox

Open honggyukim opened this issue 2 years ago • 11 comments

uftrace currently support chrome trace viewer format with uftrace dump --chrome and that is really useful to visualize the workload.

However, there are some requests to support firefox profiler format as well. We can add another firefox option and it can be used as uftrace dump --firefox.

The firefox profiler file can be opened at https://profiler.firefox.com/ and the most interesting thing is that it supports workload comparison at https://profiler.firefox.com/compare/.

honggyukim avatar Jul 05 '22 19:07 honggyukim

The file format can be found at https://github.com/firefox-devtools/profiler/blob/main/docs-developer/gecko-profile-format.md.

honggyukim avatar Jul 05 '22 19:07 honggyukim

We can add similar code to chrome option in cmds/dump.c for this feature. https://github.com/namhyung/uftrace/blob/v0.12/cmds/dump.c#L1644-L1656

honggyukim avatar Jul 05 '22 20:07 honggyukim

If anyone doesn't care of it, I'll give it a try.

dongwooklee96 avatar Jul 31 '22 06:07 dongwooklee96

I'm also interested in firefox profiler. Maybe we could do this job together.

JSYoo5B avatar Jul 31 '22 08:07 JSYoo5B

@JSYoo5B

I got the most basic prototype json file.

empty_profile.json.zip

dongwooklee96 avatar Aug 16 '22 10:08 dongwooklee96

You can refer to the initial patch for --chrome option at c6422d84c6b3239547643f7df8feb420a7ef24f3.

I wrote the patch based on the document at https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#.

honggyukim avatar Aug 17 '22 20:08 honggyukim

As I previously discussed with @dongwooklee96, previous empty_profile.json.zip were converted from chrome trace to firefox trace.
But, the content of this profile doesn't show any event or function information. It may helpful for understanding basic members to create firefox trace.

This is live capture example Firefox 2022-09-12 20.09 profile_formatted.zip with less than a second to capture traces.

As the Gecko profile format says, saving original data (similar to record-based data in RDB) to mapped data (similar to column-based data in NoSQL) helps speed and lack of GC pauses. But, this may hard to implement in native C directly. So I'm trying to implement in python scripting first, then port into C implementation.

JSYoo5B avatar Sep 12 '22 11:09 JSYoo5B

There is a related discussion for perf tool at https://lore.kernel.org/lkml/ZG5kjDN63HqqMuJJ@yoga.

honggyukim avatar Jun 29 '23 23:06 honggyukim

Hi, I'm interested in this issue and if it hasn't been completed yet, would it be okay to join in?

sypark9646 avatar Sep 06 '23 06:09 sypark9646

@sypark9646 Sure. You can go ahead.

honggyukim avatar Sep 06 '23 11:09 honggyukim

At this point, I think we should not add more options for new formats and just convert them something like to --format=firefox. So let's deprecate --chrome and use --format=chrome. Ditto for the other options.

namhyung avatar Sep 07 '23 04:09 namhyung