[Mesa-dev] [PATCH 03/14] intel: Move definition of LOG_TAG from header into Makefiles
Rob Herring
robh at kernel.org
Mon Oct 9 16:56:27 UTC 2017
On Mon, Oct 9, 2017 at 11:17 AM, Chad Versace <chadversary at chromium.org> wrote:
> 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.
That's fine with me.
> 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.
I worry more about the ones we just drop on the floor (i.e. stderr).
logwrapper used to work at least for anything in SF process, but
thanks to SELinux that's a pain to get working.
> 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.
Either color of shed is okay with me.
Rob
More information about the mesa-dev
mailing list