Closed Bug 987162 Opened 10 years ago Closed 10 years ago

Expand the systrace wiki docs

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pehrsons, Unassigned)

References

Details

Attachments

(2 files)

See https://wiki.mozilla.org/B2G/Profiling#Profiling_with_systrace

Expected: instructions on how to enable and use systrace tracing on B2G

Result: "Better instructions coming"


I'd like to use this bug to track those instructions :)
Information that would be nice to have on the wiki:

I managed to get systrace to work but I had to enable tracing in the kernel by changing the defconfig for my device. What's the proper way, and what are the proper kernel config flags?

I didn't get any other processes than b2g to show up when profiling some Homescreen swiping. I had ultimately expected the Homescreen process to show up as well. Is that possible? Clearly a B2G app is not the same as an Android app (which is mentioned in systrace.py).

Benwa and Vincent, I know you have been involved in enabling systrace. Setting needinfo? on you to make you aware of this bug.
Flags: needinfo?(vlin)
Flags: needinfo?(bgirard)
Attached file trace.html.gz
Trace as mentioned in comment #1.
I'm going to defer to vlin who knows systrace better then I do.
Flags: needinfo?(bgirard)
(In reply to Andreas Pehrson [:pehrsons] from comment #1)
> Information that would be nice to have on the wiki:
> 
> I managed to get systrace to work but I had to enable tracing in the kernel
> by changing the defconfig for my device. What's the proper way, and what are
> the proper kernel config flags?
> 
> I didn't get any other processes than b2g to show up when profiling some
> Homescreen swiping. I had ultimately expected the Homescreen process to show
> up as well. Is that possible? Clearly a B2G app is not the same as an
> Android app (which is mentioned in systrace.py).
> 
> Benwa and Vincent, I know you have been involved in enabling systrace.
> Setting needinfo? on you to make you aware of this bug.

Which device were you working on ?
Is it with Android JB 4.2 or 4.3 ?

I just follow steps here.
http://developer.android.com/tools/help/systrace.html#options-4.3

Sometimes, I also got B2G process being profiled only. Don't know why yet, but after reboot the device and profile again, all existing processes can be shown.

SDK version I'm working with for Nexus4 JB 4.3
adt-bundle-linux-x86_64-20131030
Flags: needinfo?(vlin)
By the way, gecko code is tagged as 'gfx', so the command is for your reference.

./systrace.py --time=10 -o mynewtrace.html sched gfx
(In reply to Vincent Lin[:vilin] from comment #4)
> Which device were you working on ?
> Is it with Android JB 4.2 or 4.3 ?

It's Kitkat 4.4.


> I just follow steps here.
> http://developer.android.com/tools/help/systrace.html#options-4.3
> 
> Sometimes, I also got B2G process being profiled only. Don't know why yet,
> but after reboot the device and profile again, all existing processes can be
> shown.

All right, I'll try that.


Could you also add something on the kernel config?
I.e., when systrace.py complains over missing files in /sys/kernel/debug/tracing/, the kernel needs to be recompiled with additional configuration parameters to enable tracing.

I had luck with the following, but don't know which one did the trick.
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_STACK_TRACER=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_FTRACE=y
Flags: needinfo?(vlin)
(In reply to Andreas Pehrson [:pehrsons] from comment #6)
> (In reply to Vincent Lin[:vilin] from comment #4)
> > Which device were you working on ?
> > Is it with Android JB 4.2 or 4.3 ?
> 
> It's Kitkat 4.4.
> 
> 
> > I just follow steps here.
> > http://developer.android.com/tools/help/systrace.html#options-4.3
> > 
> > Sometimes, I also got B2G process being profiled only. Don't know why yet,
> > but after reboot the device and profile again, all existing processes can be
> > shown.
> 
> All right, I'll try that.
> 
> 
> Could you also add something on the kernel config?
> I.e., when systrace.py complains over missing files in
> /sys/kernel/debug/tracing/, the kernel needs to be recompiled with
> additional configuration parameters to enable tracing.
> 
> I had luck with the following, but don't know which one did the trick.
> CONFIG_FUNCTION_TRACER=y
> CONFIG_FUNCTION_GRAPH_TRACER=y
> CONFIG_STACK_TRACER=y
> CONFIG_DYNAMIC_FTRACE=y
> CONFIG_FTRACE=y

That's weird. I've also heard from others that only B2G process is shown in KK. Unfortunately, after rebooting device, it still doesn't work. I'm still working on something based on JB, so haven't paid much attention to this issue on KK yet.

I would suggest to first verify the systrace function with Android instead of B2G.
Anyone complains about the same issue on Android in the internet ?

By the way, locally I encountered this issue and fixed it with reference to the link.
http://stackoverflow.com/questions/16644116/unable-to-view-html-trace-report-generated-by-systrace-tool-in-android-sdk

ni Jerry~
I know you're working on making FireFox browser be able to read Systrace dump.
Please see if it works well on the dump from KK.
Flags: needinfo?(vlin) → needinfo?(jshih)
Re-ni to the right Jerry(hshih).
Sorry to bother jshih.
Flags: needinfo?(jshih) → needinfo?(hshih)
Sorry for late reply.
I will find a nexus5 device to try.
(In reply to Vincent Lin[:vilin] from comment #7)
> That's weird. I've also heard from others that only B2G process is shown in
> KK. Unfortunately, after rebooting device, it still doesn't work. I'm still
> working on something based on JB, so haven't paid much attention to this
> issue on KK yet.
> 

Yes, I have confirmed with Vincent. The android atrace doesn't output other thread's profile data. Thus, we can't see the other thread in the tool view.
We will check command usage, device setting... etc to identify this problem.
Flags: needinfo?(hshih)
Hi Jerry, any luck on being able to produce systrace output with multiple processes? Thanks!
Flags: needinfo?(hshih)
I tried running systrace on b2g but it does not work as expected. I flashed my Nexus 4 to a stock Jelly Bean image from AOSP, as suggested from comment 7 and systrace worked just fine on Android. I tried a fresh copy of b2g and reflashed the nexus 4 to no avail. Interestingly, I also get random threads in the b2g process showing up in my trace files. Only Vsync and the compositor thread are reliable. I also sometimes see 2-3 CPUs depending on the profile trace. Do we have a general systrace bug?
Hi Mason,
I can use nexus4 with JB to dump the multiple processes systrace data.
I will confirm again for the steps in the wiki doc.
[:ctai] finds the reason that why we can't get the non-main process profile info.
There are some conditions that the non-main process doesn't fit. I think [:ctai] can fix this problem soon.
Flags: needinfo?(hshih)
Since Bug 1015860 is landed, I updated the wiki page https://wiki.mozilla.org/FirefoxOS/Performance/Profiling.
Now we can see the systrace result in content process.
Hi Mason and Andreas,
We update the wiki page https://wiki.mozilla.org/FirefoxOS/Performance/Profiling .
And now we can get all process profile data.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(mchang)
Resolution: --- → WONTFIX
Great, thanks for resolving this Jerry.
Flags: needinfo?(mchang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: