Re: [PATCH 0/9] Add support for Firefox's gecko profile format

From: Anup Sharma
Date: Thu Jun 22 2023 - 16:03:28 EST


On Thu, Jun 22, 2023 at 07:43:13AM +0300, Adrian Hunter wrote:
> On 21/06/23 22:35, Anup Sharma wrote:
> > This patch series adds support for Firefox's gecko profile format.
> > The format is documented here [1]
> >
> > The series adds a new python script that can be used to convert the
> > perf script to gecko profile format. To use this script, use the
> > following commands:
> >
> > perf record
> > perf script -F +pid > perf_data.txt
> > python3 firefox-gecko-converter.py > gecko_profile.json
>
> Why not use the perf script python interface?

Hi Adrian,
Thank you for your suggestion. I am working on it and will try to implement
it in the next version.

> https://perf.wiki.kernel.org/index.php/Latest_Manual_Page_of_perf-script-python.1
>
> >
> > Also dont forget to change the chown of the output file to the user[2].
> >
> > [1] https://github.com/firefox-devtools/profiler/blob/main/docs-developer/gecko-profile-format.md
> > [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1823421
> >
> > Anup Sharma (9):
> > scripts: python: Add check for correct perf script format
> > scripts: python: implement add sample function and return it
> > scripts: python: Introduce thread sample processing in
> > convertPerfScriptProfile
> > scripts: python: Implement parsing of input data in
> > convertPerfScriptProfile
> > scripts: python: implement function for thread creation
> > scripts: python: implement get or create stack function
> > scripts: python: implement get or create frame function
> > scripts: python: Finalize convertPerfScriptProfile and return profile
> > data
> > scripts: python: Add temporary main function for testing purposes
> >
> > .../scripts/python/firefox-gecko-converter.py | 249 ++++++++++++++++++
> > 1 file changed, 249 insertions(+)
> > create mode 100644 tools/perf/scripts/python/firefox-gecko-converter.py
> >
>