From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [PATCH] drm: Reduce object size of drm_dev_printk/DRM_DEV_ uses Date: Mon, 25 Sep 2017 05:28:17 -0700 Message-ID: <1506342497.29089.1.camel@perches.com> References: <693db79230a414560005936cedf4080d20235c03.1506340959.git.joe@perches.com> <87mv5j3reg.fsf@nikula.org> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <87mv5j3reg.fsf@nikula.org> Sender: linux-kernel-owner@vger.kernel.org To: Jani Nikula , Daniel Vetter , Sean Paul , David Airlie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org On Mon, 2017-09-25 at 15:16 +0300, Jani Nikula wrote: > On Mon, 25 Sep 2017, Joe Perches 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.