From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030899AbdD0QIq (ORCPT ); Thu, 27 Apr 2017 12:08:46 -0400 Received: from smtprelay0191.hostedemail.com ([216.40.44.191]:46662 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S937502AbdD0QIb (ORCPT ); Thu, 27 Apr 2017 12:08:31 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 40,2.5,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:334:355:368:369:379:541:599:960:967:973:981:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2525:2560:2563:2682:2685:2691:2828:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3354:3622:3865:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6120:8660:9025:10011:10400:10450:10455:10848:11026:11232:11658:11914:12043:12296:12438:12663:12740:12760:12895:13069:13148:13230:13311:13357:13439:14096:14097:14181:14659:14721:14775:19904:19999:21080:21433:21451:21611:30036:30054:30075:30089:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:1:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: test96_2c249618c770b X-Filterd-Recvd-Size: 2929 Message-ID: <1493309301.18659.47.camel@perches.com> Subject: Re: [RFC PATCH] printk: Make functions of pr_ macros From: Joe Perches To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org, Sergey Senozhatsky Date: Thu, 27 Apr 2017 09:08:21 -0700 In-Reply-To: <20170427151121.GX3452@pathway.suse.cz> References: <20170302053509.GA398@jagdpanzerIV.localdomain> <1488434334.2179.1.camel@perches.com> <20170427151121.GX3452@pathway.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-04-27 at 17:11 +0200, Petr Mladek wrote: > On Wed 2017-03-01 21:58:54, Joe Perches wrote: > > On Thu, 2017-03-02 at 14:35 +0900, Sergey Senozhatsky wrote: > > > On (02/28/17 19:17), Joe Perches wrote: > > > > Can save the space that the KERN_ headers require. > > > > > > > > The biggest negative here is the %pV use which needs > > > > recursion and adds stack depth. [] > > Maybe more like 12k, still the goal is to > > create singletons for the pr_fmt prefixes > > and whatever __func__ uses that are most > > common via a SOH + flag and using > > __builtin_return_address where possible and > > appropriate. That could shrink another 10k > > or so. [] > > #define define_pr_func(func, level) asmlinkage __visible int func(const char *fmt, ...) > > > { > > > va_start(args, fmt); > > > r = vprintk_emit(level[0], level[1], NULL, 0, fmt, args); > > > va_end(); > > > } > > > > > > but this won't do the trick. because func()->vprintk_emit() shortcut > > > disables the printk-safe mechanism: > > > func()->printk()->vprintk_func()->this_cpu(printk_context)::print() > > > > That was what I had done originally a while ago > > https://lkml.org/lkml/2016/6/23/652 > > BTW: The above mentioned commit adds one argument to > vprintk_default(). But the symbol is exported. I am > not sure if we could break the API. I believe EXPORT_SYMBOL functions have been modified in the past, but don't have an example at hand. > We might need to create alternative vprintk_* functions > (called vlprintk_* or so) that would have the extra parameter. > And call them from the existing vprintk_* ones. Sigh. That might work. > Also note that we might need to pass more information > via the extra parameter, for example, KERN_ERR + KERN_CONT. > > > Now the with "safe" version, it's a bit more complicated. > > :-( Yeah, that too.