2016-03-13 08:38:57

by Fengguang Wu

[permalink] [raw]
Subject: include/linux/kprobes.h:361:2: error: invalid use of undefined type 'struct kprobe_ctlblk'

Hi Russell,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f414ca64be4b36c30deb5b5fa25c5a8ff42ea56b
commit: b2c0b2cbb282f0cf42518ffacbe197e6f2884168 nmi: create generic NMI backtrace implementation
date: 8 months ago
config: mn10300-allmodconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b2c0b2cbb282f0cf42518ffacbe197e6f2884168
# save the attached .config to linux build tree
make.cross ARCH=mn10300

All errors (new ones prefixed by >>):

In file included from lib/nmi_backtrace.c:17:0:
include/linux/kprobes.h: In function 'get_kprobe_ctlblk':
>> include/linux/kprobes.h:361:2: error: invalid use of undefined type 'struct kprobe_ctlblk'
return this_cpu_ptr(&kprobe_ctlblk);
^

vim +361 include/linux/kprobes.h

e6584523 Ananth N Mavinakayanahalli 2005-11-07 355 {
b76834bc Christoph Lameter 2010-12-06 356 __this_cpu_write(current_kprobe, NULL);
e6584523 Ananth N Mavinakayanahalli 2005-11-07 357 }
e6584523 Ananth N Mavinakayanahalli 2005-11-07 358
e6584523 Ananth N Mavinakayanahalli 2005-11-07 359 static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
e6584523 Ananth N Mavinakayanahalli 2005-11-07 360 {
bdffd893 Christoph Lameter 2014-04-29 @361 return this_cpu_ptr(&kprobe_ctlblk);
e6584523 Ananth N Mavinakayanahalli 2005-11-07 362 }
e6584523 Ananth N Mavinakayanahalli 2005-11-07 363
^1da177e Linus Torvalds 2005-04-16 364 int register_kprobe(struct kprobe *p);

:::::: The code at line 361 was first introduced by commit
:::::: bdffd893a0e9c431304142d12d9a0a21d365c502 tracing: Replace __get_cpu_var uses with this_cpu_ptr

:::::: TO: Christoph Lameter <[email protected]>
:::::: CC: Steven Rostedt <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (2.08 kB)
.config.gz (33.72 kB)
Download all attachments

2016-03-13 16:00:30

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: include/linux/kprobes.h:361:2: error: invalid use of undefined type 'struct kprobe_ctlblk'

On Sun, Mar 13, 2016 at 04:37:14PM +0800, kbuild test robot wrote:
> Hi Russell,
>
> FYI, the error/warning still remains.

Sorry, I've no clue about this. From what I can see, kprobes.h is
correct.

#ifdef CONFIG_KPROBES
DECLARE_PER_CPU(struct kprobe *, current_kprobe);
DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
...
static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
{
return this_cpu_ptr(&kprobe_ctlblk);
}

The only way I can see that kprobe_ctlblk would be undefined is if
MN10300 were doing something totally weird with DECLARE_PER_CPU().

Since I know precisely nothing about MN10300, and it doesn't seem to
touch the definition of DECLARE_PER_CPU(), I'm at a total loss to
understand how this error can occur.

Some help would be nice - as right now I have absolutely no idea on
this.

--
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.