From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751209AbdCOCOi (ORCPT ); Tue, 14 Mar 2017 22:14:38 -0400 Received: from mga03.intel.com ([134.134.136.65]:35557 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbdCOCOg (ORCPT ); Tue, 14 Mar 2017 22:14:36 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,166,1486454400"; d="scan'208";a="834729824" From: Andi Kleen To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Andi Kleen , rostedt@goodmis.org Subject: [PATCH 1/7] trace: Move trace_seq_overflowed out of line Date: Tue, 14 Mar 2017 19:14:25 -0700 Message-Id: <20170315021431.13107-2-andi@firstfloor.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170315021431.13107-1-andi@firstfloor.org> References: <20170315021431.13107-1-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen Inlining trace_seq_overflowed takes ~17k in text size in my kernel. The function doesn't seem to be time critical, so we can just out of line it. Function Total Avg Num trace_seq_has_overflowed 17134 (0.00%) 33 514 This saves around 6k here text data bss dec hex filename 9102881 5367568 11116544 25586993 1866d31 vmlinux-orig 9096494 5367568 11116544 25580606 186543e vmlinux-trace-seq Cc: rostedt@goodmis.org Signed-off-by: Andi Kleen --- include/linux/trace_seq.h | 12 +----------- kernel/trace/trace_seq.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index cfaf5a1d4bad..442e4f087b95 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h @@ -56,17 +56,7 @@ trace_seq_buffer_ptr(struct trace_seq *s) return s->buffer + seq_buf_used(&s->seq); } -/** - * trace_seq_has_overflowed - return true if the trace_seq took too much - * @s: trace sequence descriptor - * - * Returns true if too much data was added to the trace_seq and it is - * now full and will not take anymore. - */ -static inline bool trace_seq_has_overflowed(struct trace_seq *s) -{ - return s->full || seq_buf_has_overflowed(&s->seq); -} +bool trace_seq_has_overflowed(struct trace_seq *s); /* * Currently only defined when tracing is enabled. diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c index e694c9f9efa4..4367cd43e38c 100644 --- a/kernel/trace/trace_seq.c +++ b/kernel/trace/trace_seq.c @@ -375,3 +375,18 @@ int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, int cnt) return seq_buf_to_user(&s->seq, ubuf, cnt); } EXPORT_SYMBOL_GPL(trace_seq_to_user); + + + +/** + * trace_seq_has_overflowed - return true if the trace_seq took too much + * @s: trace sequence descriptor + * + * Returns true if too much data was added to the trace_seq and it is + * now full and will not take anymore. + */ +bool trace_seq_has_overflowed(struct trace_seq *s) +{ + return s->full || seq_buf_has_overflowed(&s->seq); +} +EXPORT_SYMBOL_GPL(trace_seq_has_overflowed); -- 2.9.3