Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v3] tracing: Show last module text symbols in the stacktrace
       [not found] <174161444691.1063601.16690699136628689205.stgit@devnote2>
@ 2025-03-11 15:03 ` kernel test robot
  2025-03-11 15:24 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-03-11 15:03 UTC (permalink / raw)
  To: Masami Hiramatsu (Google), Steven Rostedt
  Cc: llvm, oe-kbuild-all, Masami Hiramatsu, linux-kernel,
	linux-trace-kernel, Mark Rutland, Mathieu Desnoyers

Hi Masami,

kernel test robot noticed the following build errors:

[auto build test ERROR on trace/for-next]
[cannot apply to linus/master v6.14-rc6 next-20250311]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Masami-Hiramatsu-Google/tracing-Show-last-module-text-symbols-in-the-stacktrace/20250310-214849
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
patch link:    https://lore.kernel.org/r/174161444691.1063601.16690699136628689205.stgit%40devnote2
patch subject: [PATCH v3] tracing: Show last module text symbols in the stacktrace
config: i386-buildonly-randconfig-004-20250311 (https://download.01.org/0day-ci/archive/20250311/202503112205.joXgt8gR-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250311/202503112205.joXgt8gR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503112205.joXgt8gR-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/trace/trace.c:6072:38: error: incomplete definition of type 'struct module'
    6072 |         entry->mod_addr = (unsigned long)mod->mem[MOD_TEXT].base;
         |                                          ~~~^
   include/linux/printk.h:394:8: note: forward declaration of 'struct module'
     394 | struct module;
         |        ^
   kernel/trace/trace.c:6072:44: error: use of undeclared identifier 'MOD_TEXT'
    6072 |         entry->mod_addr = (unsigned long)mod->mem[MOD_TEXT].base;
         |                                                   ^
   kernel/trace/trace.c:6073:30: error: incomplete definition of type 'struct module'
    6073 |         strscpy(entry->mod_name, mod->name);
         |                                  ~~~^
   include/linux/string.h:114:55: note: expanded from macro 'strscpy'
     114 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |                                                              ^~~
   include/linux/string.h:80:21: note: expanded from macro '__strscpy0'
      80 |         sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) +    \
         |                            ^~~
   include/linux/printk.h:394:8: note: forward declaration of 'struct module'
     394 | struct module;
         |        ^
   kernel/trace/trace.c:9411:18: error: incomplete definition of type 'struct module'
    9411 |                 if (!strcmp(mod->name, entry->mod_name)) {
         |                             ~~~^
   include/linux/printk.h:394:8: note: forward declaration of 'struct module'
     394 | struct module;
         |        ^
   kernel/trace/trace.c:9412:11: error: incomplete definition of type 'struct module'
    9412 |                         if (mod->state == MODULE_STATE_GOING)
         |                             ~~~^
   include/linux/printk.h:394:8: note: forward declaration of 'struct module'
     394 | struct module;
         |        ^
>> kernel/trace/trace.c:9412:22: error: use of undeclared identifier 'MODULE_STATE_GOING'
    9412 |                         if (mod->state == MODULE_STATE_GOING)
         |                                           ^
   kernel/trace/trace.c:9415:41: error: incomplete definition of type 'struct module'
    9415 |                                 module_delta[i] = (unsigned long)mod->mem[MOD_TEXT].base
         |                                                                  ~~~^
   include/linux/printk.h:394:8: note: forward declaration of 'struct module'
     394 | struct module;
         |        ^
   kernel/trace/trace.c:9415:47: error: use of undeclared identifier 'MOD_TEXT'
    9415 |                                 module_delta[i] = (unsigned long)mod->mem[MOD_TEXT].base
         |                                                                           ^
   8 errors generated.


vim +/MODULE_STATE_GOING +9412 kernel/trace/trace.c

  9398	
  9399	static int make_mod_delta(struct module *mod, void *data)
  9400	{
  9401		struct trace_scratch *tscratch;
  9402		struct trace_mod_entry *entry;
  9403		struct trace_array *tr = data;
  9404		long *module_delta;
  9405		int i;
  9406	
  9407		tscratch = tr->scratch;
  9408		module_delta = READ_ONCE(tscratch->module_delta);
  9409		for (i = 0; i < tscratch->nr_entries; i++) {
  9410			entry = &tscratch->entries[i];
  9411			if (!strcmp(mod->name, entry->mod_name)) {
> 9412				if (mod->state == MODULE_STATE_GOING)
  9413					module_delta[i] = 0;
  9414				else
  9415					module_delta[i] = (unsigned long)mod->mem[MOD_TEXT].base
  9416							 - entry->mod_addr;
  9417				break;
  9418			}
  9419		}
  9420		return 0;
  9421	}
  9422	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] tracing: Show last module text symbols in the stacktrace
       [not found] <174161444691.1063601.16690699136628689205.stgit@devnote2>
  2025-03-11 15:03 ` [PATCH v3] tracing: Show last module text symbols in the stacktrace kernel test robot
@ 2025-03-11 15:24 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-03-11 15:24 UTC (permalink / raw)
  To: Masami Hiramatsu (Google), Steven Rostedt
  Cc: llvm, oe-kbuild-all, Masami Hiramatsu, linux-kernel,
	linux-trace-kernel, Mark Rutland, Mathieu Desnoyers

Hi Masami,

kernel test robot noticed the following build errors:

[auto build test ERROR on trace/for-next]
[cannot apply to linus/master v6.14-rc6 next-20250311]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Masami-Hiramatsu-Google/tracing-Show-last-module-text-symbols-in-the-stacktrace/20250310-214849
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
patch link:    https://lore.kernel.org/r/174161444691.1063601.16690699136628689205.stgit%40devnote2
patch subject: [PATCH v3] tracing: Show last module text symbols in the stacktrace
config: i386-buildonly-randconfig-001-20250311 (https://download.01.org/0day-ci/archive/20250311/202503112303.D7g66VSd-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250311/202503112303.D7g66VSd-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503112303.D7g66VSd-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/trace/trace.c: In function 'save_mod':
   kernel/trace/trace.c:6072:45: error: invalid use of undefined type 'struct module'
    6072 |         entry->mod_addr = (unsigned long)mod->mem[MOD_TEXT].base;
         |                                             ^~
   kernel/trace/trace.c:6072:51: error: 'MOD_TEXT' undeclared (first use in this function)
    6072 |         entry->mod_addr = (unsigned long)mod->mem[MOD_TEXT].base;
         |                                                   ^~~~~~~~
   kernel/trace/trace.c:6072:51: note: each undeclared identifier is reported only once for each function it appears in
   In file included from arch/x86/include/asm/page_32.h:18,
                    from arch/x86/include/asm/page.h:14,
                    from arch/x86/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:60,
                    from include/linux/spinlock.h:60,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/mm.h:7,
                    from include/linux/ring_buffer.h:5,
                    from kernel/trace/trace.c:15:
   kernel/trace/trace.c:6073:37: error: invalid use of undefined type 'struct module'
    6073 |         strscpy(entry->mod_name, mod->name);
         |                                     ^~
   include/linux/string.h:80:28: note: in definition of macro '__strscpy0'
      80 |         sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) +    \
         |                            ^~~
   kernel/trace/trace.c:6073:9: note: in expansion of macro 'strscpy'
    6073 |         strscpy(entry->mod_name, mod->name);
         |         ^~~~~~~
   In file included from include/asm-generic/bug.h:5,
                    from arch/x86/include/asm/bug.h:99,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:6:
   kernel/trace/trace.c:6073:37: error: invalid use of undefined type 'struct module'
    6073 |         strscpy(entry->mod_name, mod->name);
         |                                     ^~
   include/linux/compiler.h:197:79: note: in definition of macro '__BUILD_BUG_ON_ZERO_MSG'
     197 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                               ^
   include/linux/compiler.h:211:33: note: in expansion of macro '__annotated'
     211 |         __BUILD_BUG_ON_ZERO_MSG(__annotated(p, nonstring), "must be cstr (NUL-terminated)")
         |                                 ^~~~~~~~~~~
   include/linux/string.h:81:55: note: in expansion of macro '__must_be_cstr'
      81 |                                 __must_be_cstr(dst) + __must_be_cstr(src))
         |                                                       ^~~~~~~~~~~~~~
   include/linux/args.h:25:24: note: in expansion of macro '__strscpy0'
      25 | #define __CONCAT(a, b) a ## b
         |                        ^
   kernel/trace/trace.c:6073:9: note: in expansion of macro 'strscpy'
    6073 |         strscpy(entry->mod_name, mod->name);
         |         ^~~~~~~
   kernel/trace/trace.c: In function 'make_mod_delta':
   kernel/trace/trace.c:9411:32: error: invalid use of undefined type 'struct module'
    9411 |                 if (!strcmp(mod->name, entry->mod_name)) {
         |                                ^~
   kernel/trace/trace.c:9412:32: error: invalid use of undefined type 'struct module'
    9412 |                         if (mod->state == MODULE_STATE_GOING)
         |                                ^~
>> kernel/trace/trace.c:9412:43: error: 'MODULE_STATE_GOING' undeclared (first use in this function)
    9412 |                         if (mod->state == MODULE_STATE_GOING)
         |                                           ^~~~~~~~~~~~~~~~~~
   kernel/trace/trace.c:9415:69: error: invalid use of undefined type 'struct module'
    9415 |                                 module_delta[i] = (unsigned long)mod->mem[MOD_TEXT].base
         |                                                                     ^~
   kernel/trace/trace.c:9415:75: error: 'MOD_TEXT' undeclared (first use in this function)
    9415 |                                 module_delta[i] = (unsigned long)mod->mem[MOD_TEXT].base
         |                                                                           ^~~~~~~~


vim +/MODULE_STATE_GOING +9412 kernel/trace/trace.c

  9398	
  9399	static int make_mod_delta(struct module *mod, void *data)
  9400	{
  9401		struct trace_scratch *tscratch;
  9402		struct trace_mod_entry *entry;
  9403		struct trace_array *tr = data;
  9404		long *module_delta;
  9405		int i;
  9406	
  9407		tscratch = tr->scratch;
  9408		module_delta = READ_ONCE(tscratch->module_delta);
  9409		for (i = 0; i < tscratch->nr_entries; i++) {
  9410			entry = &tscratch->entries[i];
> 9411			if (!strcmp(mod->name, entry->mod_name)) {
> 9412				if (mod->state == MODULE_STATE_GOING)
  9413					module_delta[i] = 0;
  9414				else
  9415					module_delta[i] = (unsigned long)mod->mem[MOD_TEXT].base
  9416							 - entry->mod_addr;
  9417				break;
  9418			}
  9419		}
  9420		return 0;
  9421	}
  9422	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-11 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <174161444691.1063601.16690699136628689205.stgit@devnote2>
2025-03-11 15:03 ` [PATCH v3] tracing: Show last module text symbols in the stacktrace kernel test robot
2025-03-11 15:24 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox