From patchwork Mon Jul 4 13:09:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102061 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1544598qgy; Mon, 4 Jul 2016 06:07:36 -0700 (PDT) X-Received: by 10.66.127.47 with SMTP id nd15mr22750509pab.74.1467637656289; Mon, 04 Jul 2016 06:07:36 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hg8si4191388pac.239.2016.07.04.06.07.35; Mon, 04 Jul 2016 06:07:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753893AbcGDNH2 (ORCPT + 30 others); Mon, 4 Jul 2016 09:07:28 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:51520 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753817AbcGDNHX (ORCPT ); Mon, 4 Jul 2016 09:07:23 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MfHZq-1avDAr3kqY-00OoXo; Mon, 04 Jul 2016 15:07:03 +0200 From: Arnd Bergmann To: Steven Rostedt , Ingo Molnar Cc: Arnd Bergmann , Dmitry Safonov <0x7f454c46@gmail.com>, linux-kernel@vger.kernel.org Subject: [PATCH] ftrace: move function_stats out of __initdata Date: Mon, 4 Jul 2016 15:09:44 +0200 Message-Id: <20160704131005.933647-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:HL1L/wSoi7QRKSVbmQO2TCKPWxoHIyl2lmDrFhxbWlhkh4QrXne VtmF/Fm9Kb2RBuf73jF+Vdn8PyVzZY0Jhoue0w1M/CD5t77gJ5HkvJj8oRwzHTM1FKKc4XC w05ydLIcpP76g+DBX+RCysH6yFuuewbEPB1rXeGfiXG/uKOjmyGH96xhZaKBdUDxMltR4VH k7dkDjI4r5DNuggvOBNiQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:0r+2A+1gM10=:Y+oquF/znabRY6ke7pvsma JMdPfJs5NIczSDePU2NYfSkVN+bWq8FB2qKQopAGJ0OByCVn4GKgbSQ+LCQBItrQCCP2CtL+c NbQS0uWWNTM8NanpKXyxHHXEBU2j+0jqUEkWeyl1WUp5FHQS1suZ/da0mK45fuEOB2eLvUPf2 kO5F6s6dlpV1xWoEU7jQtZwUyuOpw84yfbPhKaKxumcu8ayvX+W3MDK80qPe2WlaQ3STLcmXn gnQQzW80ych0KligZhVF4sDfmPK7ty2PdwNj5Pj3h+JzlS1TZHzehowc+ntjn+yMlJjT0arPq 60Y8I3dtUO+sqZAHtN1kSX/Z1bSB6m+RkaK6aPPd7Np50JH/tYMwcFq+JnZOd10cKHGc45qEC JHg6uqWTtnJTZjjXreRkNYQIw4CsVqiJ4pj5iUcKqT9ydCzaoCA/O2bjrTKK2xufUmXaxv2Nc uOUwIO80A0gCvW1+evaMd/d4BF2FmfJgz6B6hdwSKv4pl+pnmNt3l8Kb4Qwu54HZ9MtOElzpI X2QMrcvAo0L7KnfWMRsDEqE8+pFHNFCnQFI6RjqK+nAa35tXW73fPEWij5nk/P8OYlCf7Bruw 7bffc24VNtzMZvJYgEIv5k8yvU6B8O4S5+H8W90qv6xOtXh5rf0lwXRW/yhizNYxx8wYYqvab U9IzywQnMVUnREOCyLmf27rYY+zzCnARYUekxp/lPUZZEUTXdr4cM9WZGIxm9miG6tv0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Not marking ftrace_init_tracefs() as __init causes a link time warning: WARNING: vmlinux.o(.text+0xf5fcc): Section mismatch in reference from the function ftrace_init_tracefs() to the (unknown reference) .init.data:(unknown) The problem here is that ftrace_init_tracefs() now gets called by init_tracer_tracefs(), which cannot be __init because it is called post init-time from instance_mkdir(). The function calls to the init-time ftrace_init_dyn_tracefs() and ftrace_profile_tracefs() functions apparently only happen for the initial call to ftrace_init_tracefs(), so we could safely ignore the warning, but at the same time, it all gets inlined anyway and we may as well remove the annotations. The alternative would be restructuring the code so we only call trace_create_file() from init_tracer_tracefs(), but not the other init-time functions. Signed-off-by: Arnd Bergmann Fixes: 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do") --- kernel/trace/ftrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a486d7def6f4..815170769022 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1011,7 +1011,7 @@ static const struct file_operations ftrace_profile_fops = { }; /* used to initialize the real stat files */ -static struct tracer_stat function_stats __initdata = { +static struct tracer_stat function_stats = { .name = "functions", .stat_start = function_stat_start, .stat_next = function_stat_next, @@ -1020,7 +1020,7 @@ static struct tracer_stat function_stats __initdata = { .stat_show = function_stat_show }; -static __init void ftrace_profile_tracefs(struct dentry *d_tracer) +static void ftrace_profile_tracefs(struct dentry *d_tracer) { struct ftrace_profile_stat *stat; struct dentry *entry; @@ -1061,7 +1061,7 @@ static __init void ftrace_profile_tracefs(struct dentry *d_tracer) } #else /* CONFIG_FUNCTION_PROFILER */ -static __init void ftrace_profile_tracefs(struct dentry *d_tracer) +static void ftrace_profile_tracefs(struct dentry *d_tracer) { } #endif /* CONFIG_FUNCTION_PROFILER */ @@ -4797,7 +4797,7 @@ void ftrace_destroy_filter_files(struct ftrace_ops *ops) mutex_unlock(&ftrace_lock); } -static __init int ftrace_init_dyn_tracefs(struct dentry *d_tracer) +static int ftrace_init_dyn_tracefs(struct dentry *d_tracer) { trace_create_file("available_filter_functions", 0444,