Hi Jim,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on linus/master v5.14-rc7 next-20210820]
[cannot apply to linux/master]
[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]
url:
https://github.com/0day-ci/linux/commits/Jim-Cromie/use-DYNAMIC_DEBUG-to-...
base:
git://anongit.freedesktop.org/drm-intel for-linux-next
config: m68k-randconfig-r025-20210822 (attached as .config)
compiler: m68k-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/0day-ci/linux/commit/4d886cec521fe5747753921aab07fa15d...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Jim-Cromie/use-DYNAMIC_DEBUG-to-implement-DRM-debug/20210823-062136
git checkout 4d886cec521fe5747753921aab07fa15dad79b3c
# 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=m68k SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
lib/dynamic_debug.c: In function 'ddebug_exec_queries':
> lib/dynamic_debug.c:593:9: error: 'query' undeclared
(first use in this function); did you mean 'query_in'?
593 |
query = kstrndup(query_in, PAGE_SIZE, GFP_KERNEL);
| ^~~~~
| query_in
lib/dynamic_debug.c:593:9: note: each undeclared identifier is reported only once for
each function it appears in
lib/dynamic_debug.c: In function 'dynamic_debug_exec_queries':
> lib/dynamic_debug.c:613:36: error: 'qry' undeclared
(first use in this function); did you mean 'query'?
613 |
return ddebug_exec_queries(qry, modname, NULL);
| ^~~
| query
lib/dynamic_debug.c: In function 'ddebug_exec_queries':
> lib/dynamic_debug.c:611:1: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
611 | int
dynamic_debug_exec_queries(const char *query, const char *modname)
| ^~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> lib/dynamic_debug.c:615:19: error: non-static declaration of
'dynamic_debug_exec_queries' follows static declaration
615 |
EXPORT_SYMBOL_GPL(dynamic_debug_exec_queries);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym;
\
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:164:41: note: in expansion of macro '_EXPORT_SYMBOL'
164 | #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:615:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
615 | EXPORT_SYMBOL_GPL(dynamic_debug_exec_queries);
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:611:5: note: previous definition of
'dynamic_debug_exec_queries' with type 'int(const char *, const char *)'
611 | int dynamic_debug_exec_queries(const char *query, const char *modname)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> include/linux/export.h:67:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
67 | static
const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:9: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:152:41: note: in expansion of macro '___EXPORT_SYMBOL'
152 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:164:41: note: in expansion of macro '_EXPORT_SYMBOL'
164 | #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:615:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
615 | EXPORT_SYMBOL_GPL(dynamic_debug_exec_queries);
| ^~~~~~~~~~~~~~~~~
> lib/dynamic_debug.c:659:15: error: non-static declaration of
'param_set_dyndbg' follows static declaration
659 |
EXPORT_SYMBOL(param_set_dyndbg);
| ^~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym;
\
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:659:1: note: in expansion of macro 'EXPORT_SYMBOL'
659 | EXPORT_SYMBOL(param_set_dyndbg);
| ^~~~~~~~~~~~~
lib/dynamic_debug.c:629:5: note: previous definition of 'param_set_dyndbg' with
type 'int(const char *, const struct kernel_param *)'
629 | int param_set_dyndbg(const char *instr, const struct kernel_param *kp)
| ^~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> include/linux/export.h:67:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
67 | static
const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:9: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:152:41: note: in expansion of macro '___EXPORT_SYMBOL'
152 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:659:1: note: in expansion of macro 'EXPORT_SYMBOL'
659 | EXPORT_SYMBOL(param_set_dyndbg);
| ^~~~~~~~~~~~~
> lib/dynamic_debug.c:673:15: error: non-static declaration of
'param_get_dyndbg' follows static declaration
673 |
EXPORT_SYMBOL(param_get_dyndbg);
| ^~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym;
\
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:673:1: note: in expansion of macro 'EXPORT_SYMBOL'
673 | EXPORT_SYMBOL(param_get_dyndbg);
| ^~~~~~~~~~~~~
lib/dynamic_debug.c:668:5: note: previous definition of 'param_get_dyndbg' with
type 'int(char *, const struct kernel_param *)'
668 | int param_get_dyndbg(char *buffer, const struct kernel_param *kp)
| ^~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> include/linux/export.h:67:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
67 | static
const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:9: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:152:41: note: in expansion of macro '___EXPORT_SYMBOL'
152 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:673:1: note: in expansion of macro 'EXPORT_SYMBOL'
673 | EXPORT_SYMBOL(param_get_dyndbg);
| ^~~~~~~~~~~~~
> lib/dynamic_debug.c:680:15: error: extern declaration of
'param_ops_dyndbg' follows declaration with no linkage
680 |
EXPORT_SYMBOL(param_ops_dyndbg);
| ^~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym;
\
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:680:1: note: in expansion of macro 'EXPORT_SYMBOL'
680 | EXPORT_SYMBOL(param_ops_dyndbg);
| ^~~~~~~~~~~~~
lib/dynamic_debug.c:675:31: note: previous definition of 'param_ops_dyndbg'
with type 'const struct kernel_param_ops'
675 | const struct kernel_param_ops param_ops_dyndbg = {
| ^~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> include/linux/export.h:67:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
67 | static
const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:9: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:152:41: note: in expansion of macro '___EXPORT_SYMBOL'
152 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:680:1: note: in expansion of macro 'EXPORT_SYMBOL'
680 | EXPORT_SYMBOL(param_ops_dyndbg);
| ^~~~~~~~~~~~~
> lib/dynamic_debug.c:684:12: error: invalid storage class for
function 'remaining'
684 | static int remaining(int wrote)
| ^~~~~~~~~
> lib/dynamic_debug.c:691:14: error: invalid storage class for
function '__dynamic_emit_prefix'
691 | static char
*__dynamic_emit_prefix(const struct _ddebug *desc, char *buf)
| ^~~~~~~~~~~~~~~~~~~~~
> lib/dynamic_debug.c:721:21: error: invalid storage class for
function 'dynamic_emit_prefix'
721 | static inline char
*dynamic_emit_prefix(struct _ddebug *desc, char *buf)
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> lib/dynamic_debug.c:758:15: error: non-static declaration of
'__dynamic_pr_debug' follows static declaration
758 |
EXPORT_SYMBOL(__dynamic_pr_debug);
| ^~~~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym;
\
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:758:1: note: in expansion of macro 'EXPORT_SYMBOL'
758 | EXPORT_SYMBOL(__dynamic_pr_debug);
| ^~~~~~~~~~~~~
lib/dynamic_debug.c:728:6: note: previous definition of '__dynamic_pr_debug'
with type 'void(struct _ddebug *, const char *, ...)'
728 | void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> include/linux/export.h:67:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
67 | static
const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:9: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:152:41: note: in expansion of macro '___EXPORT_SYMBOL'
152 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:758:1: note: in expansion of macro 'EXPORT_SYMBOL'
758 | EXPORT_SYMBOL(__dynamic_pr_debug);
| ^~~~~~~~~~~~~
> lib/dynamic_debug.c:787:15: error: non-static declaration of
'__dynamic_dev_dbg' follows static declaration
787 |
EXPORT_SYMBOL(__dynamic_dev_dbg);
| ^~~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym;
\
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:787:1: note: in expansion of macro 'EXPORT_SYMBOL'
787 | EXPORT_SYMBOL(__dynamic_dev_dbg);
| ^~~~~~~~~~~~~
lib/dynamic_debug.c:760:6: note: previous definition of '__dynamic_dev_dbg'
with type 'void(struct _ddebug *, const struct device *, const char *, ...)'
760 | void __dynamic_dev_dbg(struct _ddebug *descriptor,
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from lib/dynamic_debug.c:16:
> include/linux/export.h:67:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
67 | static
const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:9: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:152:41: note: in expansion of macro '___EXPORT_SYMBOL'
152 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec,
"")
| ^~~~~~~~~~~~~~~
include/linux/export.h:163:41: note: in expansion of macro '_EXPORT_SYMBOL'
163 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
lib/dynamic_debug.c:787:1: note: in expansion of macro 'EXPORT_SYMBOL'
787 | EXPORT_SYMBOL(__dynamic_dev_dbg);
| ^~~~~~~~~~~~~
> lib/dynamic_debug.c:866:19: error: invalid storage class for
function 'ddebug_setup_query'
866 | static __init int
ddebug_setup_query(char *str)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:6,
from include/linux/kernel.h:19,
from lib/dynamic_debug.c:16:
> lib/dynamic_debug.c:876:26: error: initializer element is not
constant
876 | __setup("ddebug_query=", ddebug_setup_query);
| ^~~~~~~~~~~~~~~~~~
include/linux/init.h:321:46: note: in definition of macro '__setup_param'
321 | = { __setup_str_##unique_id, fn, early }
| ^~
lib/dynamic_debug.c:876:1: note: in expansion of macro '__setup'
876 | __setup("ddebug_query=", ddebug_setup_query);
| ^~~~~~~
lib/dynamic_debug.c:876:26: note: (near initialization for
'__setup_ddebug_setup_query.setup_func')
876 | __setup("ddebug_query=", ddebug_setup_query);
| ^~~~~~~~~~~~~~~~~~
include/linux/init.h:321:46: note: in definition of macro '__setup_param'
321 | = { __setup_str_##unique_id, fn, early }
| ^~
lib/dynamic_debug.c:876:1: note: in expansion of macro '__setup'
876 | __setup("ddebug_query=", ddebug_setup_query);
| ^~~~~~~
lib/dynamic_debug.c:883:16: error: invalid storage class for function
'ddebug_proc_write'
883 | static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf,
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:914:24: error: invalid storage class for function
'ddebug_iter_first'
914 | static struct _ddebug *ddebug_iter_first(struct ddebug_iter *iter)
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:933:24: error: invalid storage class for function
'ddebug_iter_next'
933 | static struct _ddebug *ddebug_iter_next(struct ddebug_iter *iter)
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:955:14: error: invalid storage class for function
'ddebug_proc_start'
955 | static void *ddebug_proc_start(struct seq_file *m, loff_t *pos)
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:978:14: error: invalid storage class for function
'ddebug_proc_next'
978 | static void *ddebug_proc_next(struct seq_file *m, void *p, loff_t *pos)
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:997:12: error: invalid storage class for function
'ddebug_proc_show'
997 | static int ddebug_proc_show(struct seq_file *m, void *p)
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1023:13: error: invalid storage class for function
'ddebug_proc_stop'
1023 | static void ddebug_proc_stop(struct seq_file *m, void *p)
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1029:18: error: initializer element is not constant
1029 | .start = ddebug_proc_start,
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1029:18: note: (near initialization for
'ddebug_proc_seqops.start')
lib/dynamic_debug.c:1030:17: error: initializer element is not constant
1030 | .next = ddebug_proc_next,
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1030:17: note: (near initialization for
'ddebug_proc_seqops.next')
lib/dynamic_debug.c:1031:17: error: initializer element is not constant
1031 | .show = ddebug_proc_show,
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1031:17: note: (near initialization for
'ddebug_proc_seqops.show')
lib/dynamic_debug.c:1032:17: error: initializer element is not constant
1032 | .stop = ddebug_proc_stop
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1032:17: note: (near initialization for
'ddebug_proc_seqops.stop')
lib/dynamic_debug.c:1035:12: error: invalid storage class for function
'ddebug_proc_open'
1035 | static int ddebug_proc_open(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1043:17: error: initializer element is not constant
1043 | .open = ddebug_proc_open,
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1043:17: note: (near initialization for
'ddebug_proc_fops.open')
lib/dynamic_debug.c:1047:18: error: initializer element is not constant
1047 | .write = ddebug_proc_write
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1047:18: note: (near initialization for
'ddebug_proc_fops.write')
lib/dynamic_debug.c:1051:22: error: initializer element is not constant
1051 | .proc_open = ddebug_proc_open,
| ^~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1051:22: note: (near initialization for
'proc_fops.proc_open')
lib/dynamic_debug.c:1055:23: error: initializer element is not constant
1055 | .proc_write = ddebug_proc_write
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1055:23: note: (near initialization for
'proc_fops.proc_write')
lib/dynamic_debug.c:1091:12: error: invalid storage class for function
'ddebug_dyndbg_param_cb'
1091 | static int ddebug_dyndbg_param_cb(char *param, char *val,
| ^~~~~~~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1112:12: error: invalid storage class for function
'ddebug_dyndbg_boot_param_cb'
1112 | static int ddebug_dyndbg_boot_param_cb(char *param, char *val,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1130:13: error: invalid storage class for function
'ddebug_table_free'
1130 | static void ddebug_table_free(struct ddebug_table *dt)
| ^~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1159:13: error: invalid storage class for function
'ddebug_remove_all_tables'
1159 | static void ddebug_remove_all_tables(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1173:19: error: invalid storage class for function
'dynamic_debug_init_control'
1173 | static int __init dynamic_debug_init_control(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dynamic_debug.c:1196:19: error: invalid storage class for function
'dynamic_debug_init'
1196 | static int __init dynamic_debug_init(void)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:6,
from include/linux/kernel.h:19,
from lib/dynamic_debug.c:16:
lib/dynamic_debug.c:1267:16: error: initializer element is not constant
1267 | early_initcall(dynamic_debug_init);
| ^~~~~~~~~~~~~~~~~~
include/linux/init.h:250:55: note: in definition of macro
'____define_initcall'
250 | __attribute__((__section__(__sec))) = fn;
| ^~
vim +593 lib/dynamic_debug.c
584
585 static int ddebug_exec_queries(const char *query_in, const char *modname, void
*tracer)
586 {
587 int rc;
588
589 if (!query_in) {
590 pr_err("non-null query/command string expected\n");
591 return -EINVAL;
592 }
593 query = kstrndup(query_in, PAGE_SIZE, GFP_KERNEL);
594 if (!query)
595 return -ENOMEM;
596
597 rc = __ddebug_exec_queries(query, modname, tracer);
598 kfree(query);
599 return rc;
600
601 /**
602 * dynamic_debug_exec_queries - select and change dynamic-debug prints
603 * @query: query-string described in admin-guide/dynamic-debug-howto
604 * @modname: string containing module name, usually &module.mod_name
605 *
606 * This uses the >/proc/dynamic_debug/control reader, allowing module
607 * authors to modify their dynamic-debug callsites. The modname is
608 * canonically struct module.name, but can also be null or a
609 * module-wildcard, for example: "drm*".
610 */
611 int dynamic_debug_exec_queries(const char *query, const char
*modname)
612 {
613 return ddebug_exec_queries(qry, modname, NULL);
614 }
615 EXPORT_SYMBOL_GPL(dynamic_debug_exec_queries);
616
617 #ifdef MODULES
618 #define KP_MOD_NAME kp->mod->name
619 #else
620 #define KP_MOD_NAME NULL /* wildcard */
621 #endif
622 #define FMT_QUERY_SIZE 128 /* typically need <40 */
623 /**
624 * param_set_dyndbg() - drm.debug style bits=>categories setter
625 * @instr: string echo>d to sysfs
626 * @kp: struct kernel_param* ->data has bitmap
627 * Exported to support DEFINE_DYNAMIC_DEBUG_CATEGORIES
628 */
629 int param_set_dyndbg(const char *instr, const struct kernel_param *kp)
630 {
631 unsigned long inbits;
632 int rc, i, matches = 0, totct = 0;
633 char query[FMT_QUERY_SIZE];
634 const struct dyndbg_bitdesc *bitmap = kp->data;
635
636 if (!bitmap) {
637 pr_err("set_dyndbg: no bits=>queries map\n");
638 return -EINVAL;
639 }
640 rc = kstrtoul(instr, 0, &inbits);
641 if (rc) {
642 pr_err("set_dyndbg: bad input: %s\n", instr);
643 return rc;
644 }
645 vpr_info("set_dyndbg: input 0x%lx\n", inbits);
646
647 for (i = 0; bitmap->prefix; i++, bitmap++) {
648 snprintf(query, FMT_QUERY_SIZE, "format '^%s' %cp",
bitmap->prefix,
649 test_bit(i, &inbits) ? '+' : '-');
650
651 matches = __ddebug_exec_queries(query, KP_MOD_NAME, NULL);
652
653 v2pr_info("bit-%d: %d matches on '%s'\n", i, matches, query);
654 totct += matches;
655 }
656 vpr_info("total matches: %d\n", totct);
657 return 0;
658 }
659 EXPORT_SYMBOL(param_set_dyndbg);
660
661 /**
662 * param_get_dyndbg() - drm.debug style bitmap to format-prefix categories
663 * @buffer: string returned to user via sysfs
664 * @kp: struct kernel_param*
665 * Exported to provide required .get interface, not useful.
666 * pr_debugs may be altered after .set via `echo $foo >control`
667 */
668 int param_get_dyndbg(char *buffer, const struct kernel_param *kp)
669 {
670 return scnprintf(buffer, PAGE_SIZE, "%u\n",
671 *((unsigned int *)kp->arg));
672 }
673 EXPORT_SYMBOL(param_get_dyndbg);
674
675 const struct kernel_param_ops param_ops_dyndbg = {
676 .set = param_set_dyndbg,
677 .get = param_get_dyndbg,
678 };
679 /* support DEFINE_DYNAMIC_DEBUG_CATEGORIES users */
680 EXPORT_SYMBOL(param_ops_dyndbg);
681
682 #define PREFIX_SIZE 64
683
684 static int remaining(int wrote)
685 {
686 if (PREFIX_SIZE - wrote > 0)
687 return PREFIX_SIZE - wrote;
688 return 0;
689 }
690
691 static char *__dynamic_emit_prefix(const struct _ddebug *desc,
char *buf)
692 {
693 int pos_after_tid;
694 int pos = 0;
695
696 if (desc->flags & _DPRINTK_FLAGS_INCL_TID) {
697 if (in_interrupt())
698 pos += snprintf(buf + pos, remaining(pos), "<intr> ");
699 else
700 pos += snprintf(buf + pos, remaining(pos), "[%d] ",
701 task_pid_vnr(current));
702 }
703 pos_after_tid = pos;
704 if (desc->flags & _DPRINTK_FLAGS_INCL_MODNAME)
705 pos += snprintf(buf + pos, remaining(pos), "%s:",
706 desc->modname);
707 if (desc->flags & _DPRINTK_FLAGS_INCL_FUNCNAME)
708 pos += snprintf(buf + pos, remaining(pos), "%s:",
709 desc->function);
710 if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO)
711 pos += snprintf(buf + pos, remaining(pos), "%d:",
712 desc->lineno);
713 if (pos - pos_after_tid)
714 pos += snprintf(buf + pos, remaining(pos), " ");
715 if (pos >= PREFIX_SIZE)
716 buf[PREFIX_SIZE - 1] = '\0';
717
718 return buf;
719 }
720
721 static inline char *dynamic_emit_prefix(struct _ddebug *desc,
char *buf)
722 {
723 if (unlikely(desc->flags & _DPRINTK_FLAGS_INCL_ANY))
724 return __dynamic_emit_prefix(desc, buf);
725 return buf;
726 }
727
728 void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
729 {
730 va_list args;
731 struct va_format vaf;
732 char buf[PREFIX_SIZE] = "";
733
734 BUG_ON(!descriptor);
735 BUG_ON(!fmt);
736
737 va_start(args, fmt);
738
739 vaf.fmt = fmt;
740 vaf.va = &args;
741
742 if (descriptor->flags & _DPRINTK_ENABLED)
743 dynamic_emit_prefix(descriptor, buf);
744
745 if (descriptor->flags & _DPRINTK_FLAGS_PRINT)
746 printk(KERN_DEBUG "%s%pV", buf, &vaf);
747
748 if (descriptor->flags & _DPRINTK_FLAGS_PRINT_TRACE) {
749
750 if (descriptor->tracer) {
751 (*descriptor->tracer)("%s:%ps %pV", buf,
752 __builtin_return_address(0), &vaf);
753 }
754 /* else shouldn't matter, but maybe for consistency */
755 }
756 va_end(args);
757 }
758 EXPORT_SYMBOL(__dynamic_pr_debug);
759
760 void __dynamic_dev_dbg(struct _ddebug *descriptor,
761 const struct device *dev, const char *fmt, ...)
762 {
763 struct va_format vaf;
764 va_list args;
765
766 BUG_ON(!descriptor);
767 BUG_ON(!fmt);
768
769 va_start(args, fmt);
770
771 vaf.fmt = fmt;
772 vaf.va = &args;
773
774 if (!dev) {
775 printk(KERN_DEBUG "(NULL device *): %pV", &vaf);
776 } else {
777 char buf[PREFIX_SIZE] = "";
778
779 dev_printk_emit(LOGLEVEL_DEBUG, dev, "%s%s %s: %pV",
780 dynamic_emit_prefix(descriptor, buf),
781 dev_driver_string(dev), dev_name(dev),
782 &vaf);
783 }
784
785 va_end(args);
786 }
787 EXPORT_SYMBOL(__dynamic_dev_dbg);
788
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org