[Mesa-dev] [PATCH 12/23] intel: Add simple logging façade for Android

Chad Versace chadversary at chromium.org
Wed Sep 6 20:23:28 UTC 2017


On Tue 05 Sep 2017, Rob Herring wrote:
> On Sat, Sep 2, 2017 at 3:17 AM, Chad Versace <chadversary at chromium.org> wrote:
> > I'm bringing up Vulkan in the Android container of Chrome OS (ARC++).
> >
> > On Android, stdio goes to /dev/null. On Android, remote gdb is even more
> > painful than the usual remote gdb. On Android, nothing works like you
> > expect and debugging is hell. I need logging.
> 
> We do!
> 
> You used to be able to do logwrapper at least for system level
> services, but that now is a pain to get working thanks to SELinux.
> 
> > This patch introduces a small, simple logging API that can easily wrap
> > Android's API. On non-Android platforms, this logger does nothing fancy.
> > It follows the time-honored Unix tradition of spewing everything to
> > stderr with minimal fuss.
> >
> > My goal here is not perfection. My goal is to make a minimal, clean API,
> > that people hate merely a little instead of a lot, and that's good
> > enough to let me bring up Android Vulkan.  And it needs to be fast,
> > which means it must be small. No one wants to their game to miss frames
> > while aiming a flaming bow into the jaws of an angry robot t-rex, and
> > thus become t-rex breakfast, because some fool had too much fun desiging
> > a bloated, ideal logging API.
> >
> > If people like it, perhaps we should quickly promote it to src/util.
> 
> The only thing I don't like is being Intel specific.

Of course, I would rename everything to be generic non-Intel (u_log,
perhaps?) when promoting to src/util.

> There's already a
> gallium API (with Android support floating around) as well as ddebug
> (which I started Android support for, but haven't gotten that working
> yet). Of course, some things still just call fprintf(strerr,...) or
> other C lib functions directly. I've hacked up files with "#define
> fprintf() ALOGE()" in places I've needed it.


More information about the mesa-dev mailing list