Backtrace Call Stack

Harish G. Naik harishgnaik at gmail.com
Fri Sep 30 15:32:56 EDT 2011


Hi,

I have been trying to get some debug information from a point in the
kernel where I am seeing some errors. I am actually trying to figure
out how a particular point in code was reached. Here is what I did:

if (case_when_error_happens) {
        extern int sprint_symbol(char *buffer, unsigned long address);

       for (i = 0; i < depth; i++)
               sprint_symbol(bt[i], (unsigned long)__builtin_return_address(i));

       printk("%s < %s ...", bt[0], bt[1] ...);
}

I get most of the information I want. But I was wondering if there was
any other cleaner, more straight forward way to do this.

Thanks.

-Harish



More information about the Kernelnewbies mailing list