From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09ECBC433EF for ; Mon, 10 Jan 2022 23:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345762AbiAJXvE (ORCPT ); Mon, 10 Jan 2022 18:51:04 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:43034 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242563AbiAJXvD (ORCPT ); Mon, 10 Jan 2022 18:51:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2514C61499 for ; Mon, 10 Jan 2022 23:51:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B622C36AE5; Mon, 10 Jan 2022 23:51:02 +0000 (UTC) Date: Mon, 10 Jan 2022 18:51:00 -0500 From: Steven Rostedt To: kernel test robot Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org Subject: Re: WARNING: modpost: vmlinux.o(.text.unlikely+0x2c44): Section mismatch in reference from the function trace_define_generic_fields() to the variable .init.data:initcall_level_names Message-ID: <20220110185100.6c4c226c@gandalf.local.home> In-Reply-To: <202112210114.CFpCHRci-lkp@intel.com> References: <202112210114.CFpCHRci-lkp@intel.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Dec 2021 01:12:12 +0800 kernel test robot wrote: > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > >> WARNING: modpost: vmlinux.o(.text.unlikely+0x2c44): Section mismatch in reference from the function trace_define_generic_fields() to the variable .init.data:initcall_level_names > The function trace_define_generic_fields() references > the variable __initdata initcall_level_names. > This is often because trace_define_generic_fields lacks a __initdata > annotation or the annotation of initcall_level_names is wrong. I keep getting this, and it looks like a bug in the compiler not the kernel code. We have: int filter_assign_type(const char *type) { if (strstr(type, "__data_loc") && strstr(type, "char")) return FILTER_DYN_STRING; if (strstr(type, "__rel_loc") && strstr(type, "char")) return FILTER_RDYN_STRING; if (strchr(type, '[') && strstr(type, "char")) return FILTER_STATIC_STRING; if (strcmp(type, "char *") == 0 || strcmp(type, "const char *") == 0) return FILTER_PTR_STRING; return FILTER_OTHER; } static int __trace_define_field(struct list_head *head, const char *type, const char *name, int offset, int size, int is_signed, int filter_type) { struct ftrace_event_field *field; field = kmem_cache_alloc(field_cachep, GFP_TRACE); if (!field) return -ENOMEM; field->name = name; field->type = type; if (filter_type == FILTER_OTHER) field->filter_type = filter_assign_type(type); else field->filter_type = filter_type; field->offset = offset; field->size = size; field->is_signed = is_signed; list_add(&field->link, head); return 0; } #define is_signed_type(type) (((type)(-1)) < (type)1) static LIST_HEAD(ftrace_generic_fields); #define __generic_field(type, item, filter_type) \ ret = __trace_define_field(&ftrace_generic_fields, #type, \ #item, 0, 0, is_signed_type(type), \ filter_type); \ if (ret) \ return ret; static int trace_define_generic_fields(void) { int ret; __generic_field(int, CPU, FILTER_CPU); __generic_field(int, cpu, FILTER_CPU); __generic_field(char *, COMM, FILTER_COMM); __generic_field(char *, comm, FILTER_COMM); return ret; } Please tell me where initcall_level_names is being referenced? Either fix the compiler or tell me exactly what the bug is. Otherwise, stop sending me this. -- Steve From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4845350362173168858==" MIME-Version: 1.0 From: Steven Rostedt To: kbuild-all@lists.01.org Subject: Re: WARNING: modpost: vmlinux.o(.text.unlikely+0x2c44): Section mismatch in reference from the function trace_define_generic_fields() to the variable .init.data:initcall_level_names Date: Mon, 10 Jan 2022 18:51:00 -0500 Message-ID: <20220110185100.6c4c226c@gandalf.local.home> In-Reply-To: <202112210114.CFpCHRci-lkp@intel.com> List-Id: --===============4845350362173168858== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, 21 Dec 2021 01:12:12 +0800 kernel test robot wrote: > All warnings (new ones prefixed by >>, old ones prefixed by <<): > = > >> WARNING: modpost: vmlinux.o(.text.unlikely+0x2c44): Section mismatch i= n reference from the function trace_define_generic_fields() to the variable= .init.data:initcall_level_names = > The function trace_define_generic_fields() references > the variable __initdata initcall_level_names. > This is often because trace_define_generic_fields lacks a __initdata > annotation or the annotation of initcall_level_names is wrong. I keep getting this, and it looks like a bug in the compiler not the kernel code. We have: int filter_assign_type(const char *type) { if (strstr(type, "__data_loc") && strstr(type, "char")) return FILTER_DYN_STRING; if (strstr(type, "__rel_loc") && strstr(type, "char")) return FILTER_RDYN_STRING; if (strchr(type, '[') && strstr(type, "char")) return FILTER_STATIC_STRING; if (strcmp(type, "char *") =3D=3D 0 || strcmp(type, "const char *") =3D=3D= 0) return FILTER_PTR_STRING; return FILTER_OTHER; } static int __trace_define_field(struct list_head *head, const char *type, const char *name, int offset, int size, int is_signed, int filter_type) { struct ftrace_event_field *field; field =3D kmem_cache_alloc(field_cachep, GFP_TRACE); if (!field) return -ENOMEM; field->name =3D name; field->type =3D type; if (filter_type =3D=3D FILTER_OTHER) field->filter_type =3D filter_assign_type(type); else field->filter_type =3D filter_type; field->offset =3D offset; field->size =3D size; field->is_signed =3D is_signed; list_add(&field->link, head); return 0; } #define is_signed_type(type) (((type)(-1)) < (type)1) static LIST_HEAD(ftrace_generic_fields); #define __generic_field(type, item, filter_type) \ ret =3D __trace_define_field(&ftrace_generic_fields, #type, \ #item, 0, 0, is_signed_type(type), \ filter_type); \ if (ret) \ return ret; static int trace_define_generic_fields(void) { int ret; __generic_field(int, CPU, FILTER_CPU); __generic_field(int, cpu, FILTER_CPU); __generic_field(char *, COMM, FILTER_COMM); __generic_field(char *, comm, FILTER_COMM); return ret; } Please tell me where initcall_level_names is being referenced? Either fix the compiler or tell me exactly what the bug is. Otherwise, stop sending me this. -- Steve --===============4845350362173168858==--