Hi there,
Ubuntu Touch is an operating system for mobile devices. It is built on an Android kernel in order to use the closed-source graphics drivers.
It has been released on a Bq Aquaris, which has a Mali chip inside. I am interested in enabling this with the Mali Graphics Debugger tool.
I've managed to get it working (most reliably with an older version of MGD - 2.1.0, am having stability issues on the device when profiling with 3.2.0) but I have hit one minor but irritating issue: the Interceptor is unable to distinguish applications, so I cannot selectively profile just 1 application (say) by using processlist.cfg.
When I say "distinguish applications" I mean this is the output of the interceptor (using adb shell /system/bin/logcat | grep Interceptor):
I/mgd_interceptor(10605): (10608): Interceptor: TRACING: On
I/mgd_interceptor(10605): (10613): Interceptor: Capture mode set to 0
I/mgd_interceptor(10643): (10643): Interceptor: Interceptor loaded for 10643:
I/mgd_interceptor(10643): (10643): Interceptor: Activating tracing
Note that line 3 should have an android application name after the process id - but as Ubuntu touch is not using the android runtime/userland, it seems unable to identify the application name, and so there's no naming system I can use which is compatible with processlist.cfg.
So I get to my feature request: if the interceptor is unable to get an android application name for the traced process, can it fall-back to using the binary process name?
Many thanks for the excellent tool guys!
Kind regards
-Gerry Boland
I think we had a bug on one of the 2.x series which meant that the processlist.cfg filtering doesn't work. That should be fixed in the newer version of the tool, if you manage to solve the platform stability problems.
As a workaround for the 2.x series, if you start the mgddaemon process after the OS level applications have started, but before you start the application you want to trace, then it should only trace your application (i.e. the interceptor should just be passthrough if the daemon is not running when the process starts).
HTH, Pete
Hi Gerry,
We'll take a look at your request, it seems fairly sensible to me.
MGD is using /proc/self/cmdline to get the name of the process, is that something that doesn't exist on Ubuntu Touch?
However, it's worth noting that MGD 3.0.0 onwards can separate processes in the host tool, so it's not as important to limit the items being traced.
Maybe it's worth telling us about the issues you're having with MGD v3.2.0, so we can help you with that.
It's also likely that any change we make to add support for binary names will be based off of v3.2.0, so it's probably for the best that we get that working.
Thanks,
Jon.
Hi Peter,
thanks for the quick reply. processlist.cfg being broken in 2.x series explains what I'm seeing also (i.e. all process started after the interceptor appear in the MGD profiler).
I've hit a wall with the 3.x series unfortunately. When I try to trace an application, the application hangs after issuing a few GL calls, then crashes. I see this error in logcat repeated hundreds of times:
W/MALI ( 4234): _gles_set_error:82: [WARNING]Mali GLES errorcode: 500
Here is the entire logcat if it's useful: Ubuntu Pastebin and the trace: http://people.canonical.com/~gerboland/mgd3.2-dialer-app-incomplete.mgd
But I presume it's highly dependent on the driver the device has (it's android 4.4 based, but I know vendors can often customise the driver themselves).
I actually managed to figure out the workaround you proposed, and so I can get by with 2.x series for the moment. Just a shame to be missing out on the 3.x improvements.
Many thanks
-Gerry
Hi Jonathan,
yeah Ubuntu Touch supports /proc/self/cmdline, so that should just have worked. Pasting more of the logcat log, I see the correct binary name ("dialer-app") printed later:
I/mgd_interceptor( 4234): (4234): MarshallerBase: Connecting to daemon. Sending header...
I/mgd_interceptor( 4234): (4234): Interceptor: Interceptor loaded for 4234:
I/mgd_interceptor( 4234): (4234): Interceptor: Activating tracing
I/mgd_interceptor( 4234): (4234): Interceptor: TRACING: On
E/cutils-trace( 4234): Error opening trace file: Operation not permitted (1)
I/mgd_interceptor( 4234): (4258): ListenerThread: Received new message: C:1 E:0 F:0
I/mgd_interceptor( 4234): (4258): Interceptor: Capture mode set to 0
I/mgd_interceptor( 4234): (4234): EglPlugins: Overriding eglSetBlobCacheFuncsANDROID with our own handlers.
W/MALI ( 4234): __egl_set_error:110: [WARNING]Mali EGL errorcode: 3006
I/MaliEGL ( 4234): [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL ( 4234): [Mali]surface->num_buffers=5, surface->num_frames=3, win_min_undequeued=2
I/MaliEGL ( 4234): [Mali]max_allowed_dequeued_buffers=3
E/ ( 4234): appName=dialer-app, acAppName=/system/bin/surfaceflinger
However not long after that the process crashes.
It would be good to get the 3.2 series working. I described the rough issue in my reply to Peter, with whatever logs I knew to supply. What more can I supply that might give you a hints on the problem? Oh, the kernel log will give you our driver revision: Ubuntu Pastebin
Note, I've tried the linux tracers you've supplied but due to the design of Ubuntu Touch (we still use android driver) it doesn't work. In short, the kernel and hardware drivers are all android. But nearly everything on top is typical linux userland. But that means there's a bionic-glibc clash, which we resolve with "libhybris", allowing linux userland to interact with android drivers. I'm guessing your linux interceptor doesn't like libhybris being in between it and the android driver, and more expects a linux driver? </guess>
Thanks for the help
Hey folks,
just as a followup, I've tested version 3.3 of MGD, and it is working much better with Ubuntu Touch. Thank you for the work you put into the tool, it is very valuable!
Cheers from a happy developer