Find the calling function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to determine, in run-time, the where a function was called from. I believe that the standard way of doing this on an x86 is by looking at the top of the stack pointed to by the EBP register. I.e., the following code should yield the return address in 'addr':

asm volatile("movl 0x4(%%ebp), %0\n" : "=r"(addr));

However, looking at the assembly code of the function I'm interested in (update_process_times), the calling convention looks odd: EBP is not pushed, and RET is not invoked at the end. I assume this has something to do with the function being called in interrupt context?

So, my questions:
1. Why is update_process_times() not using the standard function invocation/return procedure? 2. How is this determined in compile time? I can see no special attribute associated with the function declaration/definition
3. How can the calling function be determined in run-time?

Thanks,
Elad


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux