Re: [PATCH 6/6] MIPS: add DYNAMIC_FTRACE_WITH_REGS and KPROBES_ON_FTACE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Huang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/perf/core]
[also build test ERROR on trace/for-next linus/master v5.12-rc2 next-20210312]
[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/Huang-Pei/MIPS-replace-pg-with-CC_FLAGS_FTRACE/20210313-154234
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8bcfdd7cad3dffdd340f9a79098cbf331eb2cd53
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.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/c81a1cbcfd0d4b65f668fd824466b9bce02cee74
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Huang-Pei/MIPS-replace-pg-with-CC_FLAGS_FTRACE/20210313-154234
        git checkout c81a1cbcfd0d4b65f668fd824466b9bce02cee74
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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

All errors (new ones prefixed by >>):

>> arch/mips/kernel/ftrace.c:170:6: error: conflicting types for 'kprobe_ftrace_handler'
     170 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
         |      ^~~~~~~~~~~~~~~~~~~~~
   In file included from arch/mips/kernel/ftrace.c:10:
   include/linux/kprobes.h:362:13: note: previous declaration of 'kprobe_ftrace_handler' was here
     362 | extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
         |             ^~~~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/ftrace.c:226:15: warning: no previous prototype for 'prepare_ftrace_return' [-Wmissing-prototypes]
     226 | unsigned long prepare_ftrace_return(unsigned long parent, unsigned long self_ra,
         |               ^~~~~~~~~~~~~~~~~~~~~


vim +/kprobe_ftrace_handler +170 arch/mips/kernel/ftrace.c

   169	
 > 170	void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
   171				   struct ftrace_ops *ops, struct pt_regs *regs)
   172	{
   173		struct kprobe *p;
   174		struct kprobe_ctlblk *kcb;
   175		unsigned long orig_ip;
   176	
   177		p = get_kprobe((kprobe_opcode_t *)ip);
   178		if (unlikely(!p) || kprobe_disabled(p))
   179			return;
   180	
   181		kcb = get_kprobe_ctlblk();
   182		if (kprobe_running()) {
   183			kprobes_inc_nmissed_count(p);
   184		} else {
   185			/*
   186			 * pre_handler need epc point to the kprobe
   187			 *
   188			 */
   189			orig_ip = instruction_pointer(regs);
   190			instruction_pointer_set(regs, (unsigned long)p->addr);
   191			__this_cpu_write(current_kprobe, p);
   192			kcb->kprobe_status = KPROBE_HIT_ACTIVE;
   193			if (!p->pre_handler || !p->pre_handler(p, regs)) {
   194				/*
   195				 * Emulate singlestep (and also recover regs->nip)
   196				 * as if there is a nop
   197				 */
   198				if (unlikely(p->post_handler)) {
   199					kcb->kprobe_status = KPROBE_HIT_SSDONE;
   200					if ((unsigned long)p->addr == (ip + 4))
   201	
   202						ip = (unsigned long)p->addr + 8;
   203					else
   204						ip = (unsigned long)p->addr + 4;
   205					instruction_pointer_set(regs, ip);
   206					p->post_handler(p, regs, 0);
   207				}
   208			}
   209			instruction_pointer_set(regs, orig_ip);
   210			/*
   211			 * If pre_handler returns !0, we have to
   212			 * skip emulating post_handler.
   213			 */
   214			__this_cpu_write(current_kprobe, NULL);
   215		}
   216	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux