Using the Firefox Profiler on Android just got a lot easier

27 views
Skip to first unread message

Julien Wajsberg

unread,
Apr 10, 2025, 6:16:34 AM4/10/25
to dev-pl...@mozilla.org, firef...@mozilla.org

Hey folks,

Yesterday Bug 1803607 [1] landed. What this brings is a new way to control the Firefox Profiler on Android, and a new way to capture MOZ_LOGs on Android.

All this in just one interface, that you may already know and use on desktop.

Follow these simple steps:

  1. Open a tab, and go to about:logging.
  2. Select a suitable preset depending on your use case. This preset will define appropriate log modules as well as the right set of profiler options and captured threads for this use case.
  3. Start logging with the button at the top.
  4. Stop logging with the same button.

After stopping, you'll be given the choice to either save the profile to a local file, or upload the profile to the common storage.

If you pick the upload option, you'll be able to easily share the link either with a messaging platform or with Firefox Sync if it's configured. Note that opening the profiler URL on Fenix doesn't work properly currently, but we're working on this!


You want to add a new logging preset for your use case? It's possible! Just add an item to the object in [2].

Would you want to add a profiler preset, you can do it as well in [3].


Feedback very welcome! Come and talk with us on the Firefox Profiler channel in Element :-)

Best,

--
Julien



[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1803607 

[2] https://searchfox.org/mozilla-central/rev/601256c3cc6f397b018995810fd3f586570f50ee/toolkit/content/aboutLogging/aboutLogging.mjs#71

[3] https://searchfox.org/mozilla-central/source/devtools/shared/performance-new/prefs-presets.sys.mjs

Nick Alexander

unread,
Apr 11, 2025, 12:51:29 PM4/11/25
to Julien Wajsberg, dev-pl...@mozilla.org, firef...@mozilla.org
On Thu, Apr 10, 2025 at 3:16 AM 'Julien Wajsberg' via firef...@mozilla.org <firef...@mozilla.org> wrote:

Hey folks,

Yesterday Bug 1803607 [1] landed. What this brings is a new way to control the Firefox Profiler on Android, and a new way to capture MOZ_LOGs on Android.

All this in just one interface, that you may already know and use on desktop.

Follow these simple steps:

  1. Open a tab, and go to about:logging.
  2. Select a suitable preset depending on your use case. This preset will define appropriate log modules as well as the right set of profiler options and captured threads for this use case.
  3. Start logging with the button at the top.
  4. Stop logging with the same button.

After stopping, you'll be given the choice to either save the profile to a local file, or upload the profile to the common storage.


Julien and team -- this is great!

Can I ask 2 follow-up questions?

1.  Can we connect `MOZ_LOG` and `adb logcat` together at some level so that we can use this mechanism to get logcat logs from users?  This has historically been hard but could be a big win if possible.
2.  How does `about:logging` interact with startup profiling?  That's a focus for the mobile and perf teams.  Could we arrange for `about:logging` to be the/an entrypoint to startup profiling?

Thanks again for investing in our Android tooling!
Nick

Julien Wajsberg

unread,
Apr 14, 2025, 5:13:16 AM4/14/25
to dev-pl...@mozilla.org, firef...@mozilla.org

Hey!

Here is a quick note that it's finally in the latest nightly in the Android Play Store. Update your nightly to try it!

Cheers,

--
Julien

Julien Wajsberg

unread,
Apr 14, 2025, 7:48:57 AM4/14/25
to Nick Alexander, dev-pl...@mozilla.org, firef...@mozilla.org
Le 11/04/2025 à 18:51, Nick Alexander a écrit :


On Thu, Apr 10, 2025 at 3:16 AM 'Julien Wajsberg' via firef...@mozilla.org <firef...@mozilla.org> wrote:

Hey folks,

Yesterday Bug 1803607 [1] landed. What this brings is a new way to control the Firefox Profiler on Android, and a new way to capture MOZ_LOGs on Android.

All this in just one interface, that you may already know and use on desktop.

Follow these simple steps:

  1. Open a tab, and go to about:logging.
  2. Select a suitable preset depending on your use case. This preset will define appropriate log modules as well as the right set of profiler options and captured threads for this use case.
  3. Start logging with the button at the top.
  4. Stop logging with the same button.

After stopping, you'll be given the choice to either save the profile to a local file, or upload the profile to the common storage.


Julien and team -- this is great!

Thanks!



Can I ask 2 follow-up questions?

1.  Can we connect `MOZ_LOG` and `adb logcat` together at some level so that we can use this mechanism to get logcat logs from users?  This has historically been hard but could be a big win if possible.

I've been told that unfortunately it's not possible currently, for android security reasons.


2.  How does `about:logging` interact with startup profiling?  That's a focus for the mobile and perf teams.  Could we arrange for `about:logging` to be the/an entrypoint to startup profiling?


Interestingly I did something like that in about:profiling very recently, but it's not exposed in about:logging. This uses this bit of code to restart the browser, but I don't know if the same code would work on Android too. If somebody here knows, please tell me!


Best,

--
Julien

Reply all
Reply to author
Forward
0 new messages