Re: [PATCH] drm: Reduce object size of drm_dev_printk/DRM_DEV_<LEVEL> uses

From: Joe Perches
Date: Mon Sep 25 2017 - 08:28:25 EST


On Mon, 2017-09-25 at 15:16 +0300, Jani Nikula wrote:
> On Mon, 25 Sep 2017, Joe Perches <joe@xxxxxxxxxxx> wrote:
> > Remove unnecessary function_name and prefix arguments.
> > Removing these arguments reduces object size.
> >
> > prefix is used to add an "ERROR" prefix to the format for
> > DRM_DEV_ERROR and is an empty string for all other uses.
> > This string can be added instead by the DRM_DEV_ERROR macro.
> >
> > function_name is used to emit the calling function.
> > This can be done by using %ps and __builtin_return_address(0).
>
> Did you diff the dmesgs to see how much that gets skewed from __func__
> by optimizations?

It depends on kallsyms.

$ps shows either an address without kallsyms
or the calling function name with.

In either case, it reduces object size by
removing the argument from the call stack.

As far as I know, there are no functions that
are inlined by this change that would not show
the existing calling function name.