Linux Perf Users
 help / color / mirror / Atom feed
From: Anup Sharma <anupnewsmail@gmail.com>
To: Anup Sharma <anupnewsmail@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	linux-perf-users@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] Adding Support for Firefox's Gecko Profile Format
Date: Tue, 4 Jul 2023 23:22:14 +0530	[thread overview]
Message-ID: <ZKRcTqAsKxF/Q3fQ@yoga> (raw)
In-Reply-To: <ZKQu00bJZwO+Fc6m@yoga>

On Tue, Jul 04, 2023 at 08:08:11PM +0530, Anup Sharma wrote:
> On Thu, Jun 29, 2023 at 09:35:22AM +0300, Adrian Hunter wrote:
> > On 29/06/23 09:26, Namhyung Kim wrote:
> > > Hi Anup,
> > > 
> > > On Wed, Jun 28, 2023 at 1:11 PM Anup Sharma <anupnewsmail@gmail.com> wrote:
> > >>
> > >> On Wed, Jun 14, 2023 at 01:17:52PM -0700, Ian Rogers wrote:
> > >>> On Wed, Jun 14, 2023 at 1:14 PM Anup Sharma <anupnewsmail@gmail.com> wrote:
> > >>>>
> > >>>> On Thu, Jun 08, 2023 at 06:23:49PM +0530, Anup Sharma wrote:
> > >>>> I wanted to take a moment to provide you with an update on the progress
> > >>>> of our Firefox Gecko converter work. While I must emphasize that the code
> > >>>> I'm sharing is not the final version, I wanted to share the advancements
> > >>>> I have made thus far.
> > >>>>
> > >>>> This script can generate a JSON format from the output of the "perf script" command.
> > >>>> I attempted to load this JSON file into profile.firefox.com, and although it
> > >>>> successfully loaded, the call tree are not visible. I'm certain this issue
> > >>>> is related to the format of the JSON file or if there is another underlying
> > >>>> cause. I will continue investigating to determine the cause of this problem.
> > >>>
> > >>> Great Anup, progress can be frustrating slow at first but it is a good
> > >>> milestone to be generating output and having firefox profiler consume
> > >>> it. You can open up the JavaScript console for the firefox profiler
> > >>> and it will give some debug output. This should hopefully help you
> > >>> make progress.
> > >>
> > >> This week I tried playing with perf-script-python, the first challenge was
> > >> figuring out how to parse the data coming from the process_events.
> > >> Understanding the structure and extracting the necessary information
> > >> proved to be more complex than anticipated. This required me to spend
> > >> a significant amount of time researching and experimenting with different
> > >> parsing techniques.
> > > 
> > > I'm not sure what kind of parsing you meant.  IIRC the sample data is
> > > in a dict and all the information should be available there.  Maybe we
> > > missed some new sample data types though.
> > 
> > Most data is there.  There are existing scripts in
> > tools/perf/scripts/python/ for reference.
> > 
> > There is also the dlfilter API:
> > 
> > https://perf.wiki.kernel.org/index.php/Latest_Manual_Page_of_perf-dlfilter.1
> >
> Hello everyone,
> 
> I hope you're all doing well. I have been working on the using process_events function and have made
> progress in developing the converter script. Currently, I am in the testing phase. However, I
> have encountered a problem after performing some recent compilations. I am no longer receiving
> the complete callchains in the output as I used to.
> For Example, when I ran the command perf script -F +pid, the output would include detailed
> information like the following example:
> 
> perf-exec  132554/132554  171854.674582:        356 cycles:P: 
> 	ffffffff8fab3fc6 arch_static_branch+0x6 (inlined)
> 	ffffffff8fab3fc6 static_key_false+0x6 (inlined)
> 	ffffffff8fab3fc6 native_write_msr+0x6 (/lib/modules/6.4.0-rc1/build/vmlinux)
> 	ffffffff8fa12ca5 intel_pmu_enable_all+0x15 (/lib/modules/6.4.0-rc1/build/vmlinux)
> 
> However, in my current situation, the output is limited to the following:
> 
> perf  108107/108107  [000] 67650.031827:          1 cycles:P:  
> ffffffff83ab3fc4 native_write_msr+0x4 (/lib/modules/6.4.0-rc1/build/vmlinux)
> perf  108107/108107  [000] 67650.031832:          1 cycles:P:
> ffffffff83ab3fc4 native_write_msr+0x4 (/lib/modules/6.4.0-rc1/build/vmlinux)
> 
> It seems to be issue in perf record. I would appreciate any suggestions or assistance
> in resolving this issue. Thank you all for your help.

My apologies, I realized that I had mistakenly not included the '-g' option,
and it is now working fine."

> Regards,
> Anup
> > > 
> > >>
> > >> The second challenge revolved around the usage of event hooks provided with the perf script
> > >> python event handlers. I found myself deliberating between two approaches. The first
> > >> approach involved creating custom functions that would be called using the event
> > >> handlers. These functions would then save the data in an organized format within
> > >> globally created data structures. The alternative approach was to write the entire
> > >> logic inside the event handlers themselves.
> > >>
> > >> Additionally, I contemplated whether it would be more suitable to handle the creation of
> > >> a Gecko format for JSON and the profile format within the same script or to separate
> > >> them into different scripts.
> > >>
> > >> I will discuss this points during tomorrow's office hour.
> > >>
> > >> However, I have gained a deeper understanding of the problem at hand and will use this
> > >> knowledge to make more informed decisions and progress more effectively in the coming weeks.
> > > 
> > > Sounds like you did a good amount of research on how perf script
> > > works.  We can talk about the details in the meeting.
> > > 
> > > Thanks,
> > > Namhyung
> > 

  reply	other threads:[~2023-07-04 17:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 19:25 [RFC] Adding Support for Firefox's Gecko Profile Format Anup Sharma
2023-05-25 20:52 ` Namhyung Kim
2023-05-26 15:17   ` Ian Rogers
2023-05-26 19:49     ` Anup Sharma
2023-06-01 20:49       ` Anup Sharma
2023-06-05 21:47         ` Anup Sharma
2023-06-08  6:58           ` Ian Rogers
2023-06-08 12:53             ` Anup Sharma
2023-06-14 20:14               ` Anup Sharma
2023-06-14 20:17                 ` Ian Rogers
2023-06-28 20:11                   ` Anup Sharma
2023-06-29  6:26                     ` Namhyung Kim
2023-06-29  6:35                       ` Adrian Hunter
2023-07-04 14:38                         ` Anup Sharma
2023-07-04 17:52                           ` Anup Sharma [this message]
2023-07-26 18:04                             ` Anup Sharma
2023-07-26 19:22                               ` Arnaldo Carvalho de Melo
2023-08-02 18:59                                 ` Anup Sharma
2023-08-09 20:01                                   ` Anup Sharma
2023-08-16 17:10                                     ` Anup Sharma
2023-09-18  3:39                                       ` Anup Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZKRcTqAsKxF/Q3fQ@yoga \
    --to=anupnewsmail@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox