From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933354AbbDQSjf (ORCPT ); Fri, 17 Apr 2015 14:39:35 -0400 Received: from smtprelay0074.hostedemail.com ([216.40.44.74]:37622 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932944AbbDQSjc (ORCPT ); Fri, 17 Apr 2015 14:39:32 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:4605:5007:6119:6261:8603:10004:10400:10848:11026:11658:11914:12043:12296:12517:12519:12555:13069:13311:13357:14394:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: prose83_8d323e78fa547 X-Filterd-Recvd-Size: 1837 Message-ID: <1429295968.2850.105.camel@perches.com> Subject: [PATCH] sched/debug: Reduce SEQ_printf footprint From: Joe Perches To: Peter Zijlstra Cc: LKML Date: Fri, 17 Apr 2015 11:39:28 -0700 Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 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 This macro can be converted to a static inline to reduce object size. (x86-64 defconfig, with SCHED_DEBUG) $ size kernel/sched/debug.o* text data bss dec hex filename 13885 8 4098 17991 4647 kernel/sched/debug.o.new 20413 8 4098 24519 5fc7 kernel/sched/debug.o.old Signed-off-by: Joe Perches --- kernel/sched/debug.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index a245c1f..c7932cc 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -25,13 +25,20 @@ static DEFINE_SPINLOCK(sched_debug_lock); * This allows printing both to /proc/sched_debug and * to the console */ -#define SEQ_printf(m, x...) \ - do { \ - if (m) \ - seq_printf(m, x); \ - else \ - printk(x); \ - } while (0) +__printf(2, 3) +static void SEQ_printf(struct seq_file *m, const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + + if (m) + seq_vprintf(m, fmt, args); + else + vprintk(fmt, args); + + va_end(args); +} /* * Ease the printing of nsec fields: