Open Bug 1836477 Opened 1 year ago Updated 2 months ago

Measure CPU speed and core when sampling on Android/Linux

Categories

(Core :: Gecko Profiler, enhancement, P1)

Unspecified
Android
enhancement

Tracking

()

People

(Reporter: aabh, Unassigned)

References

Details

(Whiteboard: [fxp-profiler] )

At present, the profiler shows the CPU usage percentage when sampling, but does not report the current CPU speed/frequency, nor which specific core the sample is taken from.

These measurements would be particularly useful to have on Android platforms (and other ARM big.LITTLE platforms), as there can be a wide variety of CPU speeds.


This could be technically achieved by querying the CPU frequency at the point of sampling, for example: http://paul.cx/public/cpu.c

Flags: needinfo?(smaug)
Flags: needinfo?(padenot)
Whiteboard: [fxp-profiler]

Currently I'm using https://developer.android.com/agi (unlike the name hints, it is useful for CPU too).
One needs to enable frequency tracing (and possibly disable some not so useful features) and it works quite well.
But the UI is rather bad, and obviously it doesn't do similar kind of profiling as Firefox profiler.

Flags: needinfo?(smaug)

(In reply to Adam Brouwers-Harries [:aabh] [he/him] ⌚GMT from comment #0)

These measurements would be particularly useful to have on Android platforms (and other ARM big.LITTLE platforms), as there can be a wide variety of CPU speeds.

Intel chips can be big.LITTLE starting from gen 13. But this is really important to understand frequency stepping in any case.

The standard way of doing this on Android is to use system tracing, available on device, on the command line or on a computer connected to the device

This can be done on Linux using ebpf trace points, on macOS using dtrace / Instruments, on Windows using ETW. Florian has a prototype to integrate this in the profiler.

Flags: needinfo?(padenot) → needinfo?(florian)

Ah, I attached my patch in a new bug (bug 1838497). I'll change the bug number at the next update of the patch, and close bug 1838497 as a duplicate.

Flags: needinfo?(florian)
Component: Performance Tools (Profiler/Timeline) → Gecko Profiler
Product: DevTools → Core
Severity: -- → N/A
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.