* 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
@ 2021-12-20 17:12 kernel test robot
2022-01-10 23:51 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-12-20 17:12 UTC (permalink / raw)
To: Steven Rostedt (VMware); +Cc: kbuild-all, linux-kernel
Hi Steven,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a7904a538933c525096ca2ccde1e60d0ee62c08e
commit: a55f224ff5f238013de8762c4287117e47b86e22 tracing: Fix pid filtering when triggers are attached
date: 3 weeks ago
config: xtensa-randconfig-r005-20211220 (https://download.01.org/0day-ci/archive/20211221/202112210114.CFpCHRci-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a55f224ff5f238013de8762c4287117e47b86e22
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a55f224ff5f238013de8762c4287117e47b86e22
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=xtensa SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
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.
Note: the below error/warnings can be found in parent commit:
<< WARNING: modpost: vmlinux.o(.text+0xb451e8): Section mismatch in reference from the function sonic_get_stats() to the function .init.text:set_reset_devices()
<< WARNING: modpost: vmlinux.o(.text+0xb4524e): Section mismatch in reference from the function xtsonic_probe() to the function .init.text:sonic_probe1()
<< WARNING: modpost: vmlinux.o(.text.unlikely+0x2a8c): Section mismatch in reference from the function __trace_event_discard_commit() to the variable .init.data:initcall_level_names
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* 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
2021-12-20 17:12 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 kernel test robot
@ 2022-01-10 23:51 ` Steven Rostedt
2022-01-17 8:32 ` [kbuild-all] " Chen, Rong A
0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2022-01-10 23:51 UTC (permalink / raw)
To: kernel test robot; +Cc: kbuild-all, linux-kernel
On Tue, 21 Dec 2021 01:12:12 +0800
kernel test robot <lkp@intel.com> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [kbuild-all] 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
2022-01-10 23:51 ` Steven Rostedt
@ 2022-01-17 8:32 ` Chen, Rong A
2022-01-17 15:14 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: Chen, Rong A @ 2022-01-17 8:32 UTC (permalink / raw)
To: Steven Rostedt, kernel test robot; +Cc: kbuild-all, linux-kernel
On 1/11/2022 7:51 AM, Steven Rostedt wrote:
> On Tue, 21 Dec 2021 01:12:12 +0800
> kernel test robot <lkp@intel.com> 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
Hi Steve,
I'm not familiar with the code, the warning can be silenced with the
below change:
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -162,7 +162,7 @@ EXPORT_SYMBOL_GPL(trace_define_field);
if (ret) \
return ret;
-static int trace_define_generic_fields(void)
+static __init int trace_define_generic_fields(void)
{
int ret;
@@ -174,7 +174,7 @@ static int trace_define_generic_fields(void)
return ret;
}
-static int trace_define_common_fields(void)
+static __init int trace_define_common_fields(void)
{
int ret;
struct trace_entry ent;
If the warning can't be fixed, we'll add the warning to the ignore list.
Best Regards,
Rong Chen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [kbuild-all] 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
2022-01-17 8:32 ` [kbuild-all] " Chen, Rong A
@ 2022-01-17 15:14 ` Steven Rostedt
0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2022-01-17 15:14 UTC (permalink / raw)
To: Chen, Rong A; +Cc: kernel test robot, kbuild-all, linux-kernel
On Mon, 17 Jan 2022 16:32:38 +0800
"Chen, Rong A" <rong.a.chen@intel.com> wrote:
> >
> > 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
>
> Hi Steve,
>
> I'm not familiar with the code, the warning can be silenced with the
> below change:
>
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -162,7 +162,7 @@ EXPORT_SYMBOL_GPL(trace_define_field);
> if (ret) \
> return ret;
>
> -static int trace_define_generic_fields(void)
> +static __init int trace_define_generic_fields(void)
> {
> int ret;
>
> @@ -174,7 +174,7 @@ static int trace_define_generic_fields(void)
> return ret;
> }
>
> -static int trace_define_common_fields(void)
> +static __init int trace_define_common_fields(void)
> {
> int ret;
> struct trace_entry ent;
>
> If the warning can't be fixed, we'll add the warning to the ignore list.
>
So the issue is that an __init function calls a static function that
isn't marked as __init?
I guess it can be updated, but seriously, there's nothing bad that can
happen with the above, and it still looks to me as an over aggressive
compiler.
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-17 15:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 17:12 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 kernel test robot
2022-01-10 23:51 ` Steven Rostedt
2022-01-17 8:32 ` [kbuild-all] " Chen, Rong A
2022-01-17 15:14 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).