[Mesa-dev] [PATCH 03/14] intel: Move definition of LOG_TAG from header into Makefiles

Chad Versace chadversary at chromium.org
Mon Oct 9 16:17:13 UTC 2017


On Mon 09 Oct 2017, Tapani Pälli wrote:
> 
> 
> On 09/28/2017 03:11 AM, Chad Versace wrote:
> > This patch prevents compilation failures in upcoming Android Vulkan
> > patches, failures due to redefinition of LOG_TAG in Android system
> > headers.
> > 
> > This patch does not change the value of LOG_TAG. It remains
> > "INTEL-MESA". (I don't like it, though. The all-caps smells like
> > FORTRAN).
> > 
> > Only one Intel header defined LOG_TAG: gen_debug.h. I believe I defined
> > it correctly in all the necessary Automake and Android.mk files, but one
> > can never truly know when touching build systems.
> > 
> > This patch is ugly and too big. If someone knows a better way, please
> > speak up.
> 
> Currently we have INTEL-MESA, EGL-DRI2 and EGL_MAIN. IMO we could simplify
> and have just 'MESA' or 'mesa'? Debug messages from EGL could indicate 'EGL'
> in the message if that is not clear from the context already.
> 
> After such change we could just have it defined once in Android.common.mk
> for Android build.

(Rob, opinions?)

I'm in favor of unifying all LOG_TAGs to a single tag. That would
simplify debugging.

Currently, sometimes I misremember the LOG_TAG, type the wrong one in
`logcat -s "$TAG1,$TAG2,$TAG3"`, and then waste time because I get
a false negative when searching through the logs. "Hmm... that ALOGD
message never appeared... we must never hit that path!". If there was
a single log, the likelihood of bad logcat searches greatly diminishes.

Let's choose a LOG_TAG that follows the conventions of other tags in the
system.  I just scanned the logcat on a running system for examples, and
I found a single ALL-CAPS tag. I find these three classes of tags:

  - CamelCase. I suspect these mirror the names of Java classes or
    C++ classes.

    Examples:
      BackupManagerService
      PlayCommon
      NetworkStats
      ArcAppTaskTracker

  - snake_case and hyphen-case. This case seems to be used for low-level
    system components.

    Examples:
      libc
      art
      wayland-service

  - ALLCAPS. I found one case of this: 'DEBUG'.

Based on that evidence, 'mesa' is probably the best choice, with 'Mesa'
as second best.


More information about the mesa-dev mailing list