2004-11-07 23:14:32

by Peter Breuer

[permalink] [raw]
Subject: kernel analyser to detect sleep under spinlock


ftp://?boe.it.uc3m.es/pub/Programs/c-1.2.tgz

To use the application, compile and then use "c" in place of
"gcc" on a typical kernel compile line.

This is currently tested only on kernel 2.4 and probably will need some
slight mods to the parser for kernel 2.6 code, as it has to
inverse engineer some of the assembler produced by macros in kernel
headers.

Here's some typical output ...

% ./c -D__KERNEL__ -DMODULE \
-I/usr/local/src/linux-2.4.25-xfs/include ../dbr/1/sbull.c
*************** sleepy functions *******************************
* function line calls
*
* - /usr/local/src/linux-2.4.25-xfs/include/linux/smb_fs_sb.h
* smb_lock_server 63 down
*
* - /usr/local/src/linux-2.4.25-xfs/include/linux/fs.h
* lock_parent 1624 down
* double_down 1647 down
* triple_down 1668 down
* double_lock 1718 double_down
*
* - /usr/local/src/linux-2.4.25-xfs/include/linux/locks.h
* lock_super 38 down
*
* - ../dbr/1/sbull.c
* sbull_ioctl 171 interruptible_sleep_on
*
* - /usr/local/src/linux-2.4.25-xfs/include/linux/blk.h
* sbull_request 358 interruptible_sleep_on
*
* - ../dbr/1/sbull.c
* sbull_init 431 kmalloc
* sbull_init 431 kfree
* sbull_cleanup 542 kfree
*
****************************************************************
*************** sleep_under_spinlock ****************************
* function line calls
*
* - ../dbr/1/sbull.c
* sbull_request 420 interruptible_sleep_on
*
*
* *** found 1 instances of sleep under spinlock ***
*
***********************************************

It's GPL/LGPL.

Peter ([email protected])


2004-11-08 01:19:09

by Randy.Dunlap

[permalink] [raw]
Subject: Re: kernel analyser to detect sleep under spinlock

Peter T. Breuer wrote:
> ftp://ųboe.it.uc3m.es/pub/Programs/c-1.2.tgz

That URL fails for me... is it correct?

> To use the application, compile and then use "c" in place of
> "gcc" on a typical kernel compile line.
>
> This is currently tested only on kernel 2.4 and probably will need some
> slight mods to the parser for kernel 2.6 code, as it has to
> inverse engineer some of the assembler produced by macros in kernel
> headers.
>
> Here's some typical output ...


--
~Randy

2004-11-08 04:39:34

by ptb

[permalink] [raw]
Subject: Re: kernel analyser to detect sleep under spinlock

In article <[email protected]> you wrote:
> Peter T. Breuer wrote:
> > ftp://??boe.it.uc3m.es/pub/Programs/c-1.2.tgz

> That URL fails for me... is it correct?

Well, it is, if you guess that's an "oboe". I don't know why the
original came out with a pair of question marks. Sorry.

ftp://oboe.it.uc3m.es/pub/Programs/c-1.2.tgz


Peter

2004-11-08 04:45:07

by Randy.Dunlap

[permalink] [raw]
Subject: Re: kernel analyser to detect sleep under spinlock

Peter T. Breuer wrote:
> In article <[email protected]> you wrote:
>
>>Peter T. Breuer wrote:
>>
>>> ftp://??boe.it.uc3m.es/pub/Programs/c-1.2.tgz
>
>
>>That URL fails for me... is it correct?
>
>
> Well, it is, if you guess that's an "oboe". I don't know why the
> original came out with a pair of question marks. Sorry.
>
> ftp://oboe.it.uc3m.es/pub/Programs/c-1.2.tgz

Thanks, that works now.
The original was not ??, my mail client did that on reply.

The original was
ftp://%c5%b3boe.it.uc3m.es/pub/Programs/c-1.2.tgz
whatever those are...


--
~Randy