use MACRO __FUNCTION__ with inline function

Posted by Kurzack on Stack Overflow See other posts from Stack Overflow or by Kurzack
Published on 2011-01-04T06:33:05Z Indexed on 2011/01/04 7:53 UTC
Read the original article Hit count: 229

Filed under:

Hi all,

I want to add debug message in kmalloc function in linux kernel. So my goal is to print all functions that call kmalloc.

I tried to add

printk("caller : %s size : %d",FUNCTION, size);

in kmalloc function in slab.h

but, the result of FUNCTION is kmalloc itself. I realised that MACRO is processed first before inline function (fyi, kmalloc is an inline function).

Now, my question is, what is the simplest way to add debug message to kmalloc?

Thanks in advance guys.

© Stack Overflow or respective owner

Related posts about linux-kernel