All of lore.kernel.org
 help / color / mirror / Atom feed
* [jimc:dd-drm-next 2/11] lib/dynamic_debug.c:609:68: error: invalid use of undefined type 'struct module'
@ 2021-08-20 14:09 kernel test robot
  2021-08-21 14:34 ` jim.cromie
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-08-20 14:09 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2993 bytes --]

tree:   https://github.com/jimc/linux.git dd-drm-next
head:   334f24cc73a3d5051217851d4616cb89c2d152dc
commit: 0322252e3c15fa80be1780ca68dde765a57f2c4b [2/11] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks
config: s390-randconfig-r035-20210820 (attached as .config)
compiler: s390-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://github.com/jimc/linux/commit/0322252e3c15fa80be1780ca68dde765a57f2c4b
        git remote add jimc https://github.com/jimc/linux.git
        git fetch --no-tags jimc dd-drm-next
        git checkout 0322252e3c15fa80be1780ca68dde765a57f2c4b
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   lib/dynamic_debug.c: In function 'param_set_dyndbg':
>> lib/dynamic_debug.c:609:68: error: invalid use of undefined type 'struct module'
     609 |                 matches = dynamic_debug_exec_queries(query, kp->mod->name);
         |                                                                    ^~


vim +609 lib/dynamic_debug.c

   579	
   580	#define FMT_QUERY_SIZE 128 /* typically need <40 */
   581	/**
   582	 * param_set_dyndbg() - drm.debug style bits=>categories setter
   583	 * @instr: string echo>d to sysfs
   584	 * @kp:    struct kernel_param* ->data has bitmap
   585	 * Exported to support DEFINE_DYNAMIC_DEBUG_CATEGORIES
   586	 */
   587	int param_set_dyndbg(const char *instr, const struct kernel_param *kp)
   588	{
   589		unsigned long inbits;
   590		int rc, i, matches = 0, totct = 0;
   591		char query[FMT_QUERY_SIZE];
   592		const struct dyndbg_bitdesc *bitmap = kp->data;
   593	
   594		if (!bitmap) {
   595			pr_err("set_dyndbg: no bits=>queries map\n");
   596			return -EINVAL;
   597		}
   598		rc = kstrtoul(instr, 0, &inbits);
   599		if (rc) {
   600			pr_err("set_dyndbg: failed\n");
   601			return rc;
   602		}
   603		vpr_info("set_dyndbg: input 0x%lx\n", inbits);
   604	
   605		for (i = 0; bitmap->prefix; i++, bitmap++) {
   606			snprintf(query, FMT_QUERY_SIZE, "format '^%s' %cp", bitmap->prefix,
   607				 test_bit(i, &inbits) ? '+' : '-');
   608	
 > 609			matches = dynamic_debug_exec_queries(query, kp->mod->name);
   610	
   611			v2pr_info("bit-%d: %d matches on '%s'\n", i, matches, query);
   612			totct += matches;
   613		}
   614		vpr_info("total matches: %d\n", totct);
   615		return 0;
   616	}
   617	EXPORT_SYMBOL(param_set_dyndbg);
   618	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35631 bytes --]

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

* Re: [jimc:dd-drm-next 2/11] lib/dynamic_debug.c:609:68: error: invalid use of undefined type 'struct module'
  2021-08-20 14:09 [jimc:dd-drm-next 2/11] lib/dynamic_debug.c:609:68: error: invalid use of undefined type 'struct module' kernel test robot
@ 2021-08-21 14:34 ` jim.cromie
  0 siblings, 0 replies; 2+ messages in thread
From: jim.cromie @ 2021-08-21 14:34 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

On Fri, Aug 20, 2021 at 8:10 AM kernel test robot <lkp@intel.com> wrote:
>         # save the attached .config to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
>    lib/dynamic_debug.c: In function 'param_set_dyndbg':
> >> lib/dynamic_debug.c:609:68: error: invalid use of undefined type 'struct module'
>      609 |                 matches = dynamic_debug_exec_queries(query, kp->mod->name);
>          |                                                                    ^~
>

I have fixed this, though I suspect theres a smoother way,
an already defined symbol for this.

+#ifdef MODULES
+#define KP_MOD_NAME kp->mod->name
+#else
+#define KP_MOD_NAME NULL /* wildcard */
+#endif

+               matches = dynamic_debug_exec_queries(query, KP_MOD_NAME);


I bet someone knows :-)

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

end of thread, other threads:[~2021-08-21 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 14:09 [jimc:dd-drm-next 2/11] lib/dynamic_debug.c:609:68: error: invalid use of undefined type 'struct module' kernel test robot
2021-08-21 14:34 ` jim.cromie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.