On Sun, Feb 17, 2008 at 10:52:28AM +0000, rubisher wrote: > Has far as the gcc builtin instrument-functions doesn't work as I expected, > I would like to grab manually the address of the functions' begin and end > like something: > void foo(){ > foo_start: > printk ("%s() start at %p.\n, __FUNCTION__, > ???ADDRESS_OF???(foo_start); > [snip] > foo_end: > printk ("%s() start at %p.\n, __FUNCTION__, > ???ADDRESS_OF???(foo_end); > }; > > It seems to me that I read it something like this in the past but no means > to remember how to do it. The kernel already has code to do this -- look at the stack backtraces. They show addresses, function names and length of the function. Start by looking at BUG() and trace through to find out how the kernel does this. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." - To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html