Measure CPU speed and core when sampling on Android/Linux
Categories
(Core :: Gecko Profiler, enhancement, P1)
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
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
•
|
||
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.
Comment 2•2 years ago
|
||
(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.
Comment 3•2 years ago
|
||
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.
Updated•2 years ago
|
Description
•