tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/wchan head: 48f17ab32afc56a67359efc5b8889cb8cb42ec80 commit: 48f17ab32afc56a67359efc5b8889cb8cb42ec80 [7/7] arch: Fix STACKTRACE_SUPPORT config: nds32-defconfig (attached as .config) compiler: nds32le-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/peterz/queue.git/commit/?id=48f17ab32afc56a67359efc5b8889cb8cb42ec80 git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git git fetch --no-tags peterz-queue sched/wchan git checkout 48f17ab32afc56a67359efc5b8889cb8cb42ec80 # 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=nds32 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): arch/nds32/kernel/stacktrace.c: In function '__save_stack_trace_tsk': >> arch/nds32/kernel/stacktrace.c:13:13: error: 'savesched' redeclared as different kind of symbol 13 | int savesched; | ^~~~~~~~~ arch/nds32/kernel/stacktrace.c:9:93: note: previous definition of 'savesched' with type 'bool' {aka '_Bool'} 9 | static void __save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace, bool savesched) | ~~~~~^~~~~~~~~ vim +/savesched +13 arch/nds32/kernel/stacktrace.c 2923f5ea7738cb9 Greentime Hu 2017-10-24 8 48f17ab32afc56a Peter Zijlstra 2021-09-30 9 static void __save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace, bool savesched) 2923f5ea7738cb9 Greentime Hu 2017-10-24 10 { 2923f5ea7738cb9 Greentime Hu 2017-10-24 11 unsigned long *fpn; 2923f5ea7738cb9 Greentime Hu 2017-10-24 12 int skip = trace->skip; 2923f5ea7738cb9 Greentime Hu 2017-10-24 @13 int savesched; 1e377ae9b04aef4 Zong Li 2018-08-15 14 int graph_idx = 0; 2923f5ea7738cb9 Greentime Hu 2017-10-24 15 2923f5ea7738cb9 Greentime Hu 2017-10-24 16 if (tsk == current) { 2923f5ea7738cb9 Greentime Hu 2017-10-24 17 __asm__ __volatile__("\tori\t%0, $fp, #0\n":"=r"(fpn)); 2923f5ea7738cb9 Greentime Hu 2017-10-24 18 } else { 2923f5ea7738cb9 Greentime Hu 2017-10-24 19 fpn = (unsigned long *)thread_saved_fp(tsk); 2923f5ea7738cb9 Greentime Hu 2017-10-24 20 } 2923f5ea7738cb9 Greentime Hu 2017-10-24 21 2923f5ea7738cb9 Greentime Hu 2017-10-24 22 while (!kstack_end(fpn) && !((unsigned long)fpn & 0x3) 2923f5ea7738cb9 Greentime Hu 2017-10-24 23 && (fpn >= (unsigned long *)TASK_SIZE)) { 2923f5ea7738cb9 Greentime Hu 2017-10-24 24 unsigned long lpp, fpp; 2923f5ea7738cb9 Greentime Hu 2017-10-24 25 95f93ed7fe92c16 Zong Li 2018-08-20 26 lpp = fpn[LP_OFFSET]; 2923f5ea7738cb9 Greentime Hu 2017-10-24 27 fpp = fpn[FP_OFFSET]; 2923f5ea7738cb9 Greentime Hu 2017-10-24 28 if (!__kernel_text_address(lpp)) 2923f5ea7738cb9 Greentime Hu 2017-10-24 29 break; 1e377ae9b04aef4 Zong Li 2018-08-15 30 else 1e377ae9b04aef4 Zong Li 2018-08-15 31 lpp = ftrace_graph_ret_addr(tsk, &graph_idx, lpp, NULL); 2923f5ea7738cb9 Greentime Hu 2017-10-24 32 2923f5ea7738cb9 Greentime Hu 2017-10-24 33 if (savesched || !in_sched_functions(lpp)) { 2923f5ea7738cb9 Greentime Hu 2017-10-24 34 if (skip) { 2923f5ea7738cb9 Greentime Hu 2017-10-24 35 skip--; 2923f5ea7738cb9 Greentime Hu 2017-10-24 36 } else { 2923f5ea7738cb9 Greentime Hu 2017-10-24 37 trace->entries[trace->nr_entries++] = lpp; 2923f5ea7738cb9 Greentime Hu 2017-10-24 38 if (trace->nr_entries >= trace->max_entries) 2923f5ea7738cb9 Greentime Hu 2017-10-24 39 break; 2923f5ea7738cb9 Greentime Hu 2017-10-24 40 } 2923f5ea7738cb9 Greentime Hu 2017-10-24 41 } 2923f5ea7738cb9 Greentime Hu 2017-10-24 42 fpn = (unsigned long *)fpp; 2923f5ea7738cb9 Greentime Hu 2017-10-24 43 } 2923f5ea7738cb9 Greentime Hu 2017-10-24 44 } 48f17ab32afc56a Peter Zijlstra 2021-09-30 45 void save_stack_trace(struct stack_trace *trace) 48f17ab32afc56a Peter Zijlstra 2021-09-30 46 { 48f17ab32afc56a Peter Zijlstra 2021-09-30 47 __save_stack_trace_tsk(current, trace, true); 48f17ab32afc56a Peter Zijlstra 2021-09-30 48 } 48f17ab32afc56a Peter Zijlstra 2021-09-30 49 EXPORT_SYMBOL_GPL(save_stack_trace); 48f17ab32afc56a Peter Zijlstra 2021-09-30 50 :::::: The code at line 13 was first introduced by commit :::::: 2923f5ea7738cb9f5372bb9d7ac9886cf4193003 nds32: Exception handling :::::: TO: Greentime Hu :::::: CC: Greentime Hu --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org