The goal of this project to provide a performance analysis tool for a MySQL storage engine PrimeBase XT. In contrast to traditional profiling tools, we focus on how to capture the impact of the resource contention through measuring the time spent on waiting critical resources, such as I/O, memory and locks. We also try to provide context information to help developers to identify the critical path. This is a Google Summer Code 2007 Project.

As suggested by Paul, if it is a signal frame, its frame OFFSET is different. It is defined by SIGRETURN_FRAME_OFFSET.

Since we are going to print stacktrace inside a normal function, we don't need consider this.Here, fp (frame pointer) is EBP (Extend Base Pointer) of this caller. Its content *fp is the EBP of its caller.That's why we can trace to the stack frame of callers by usingnew_fp = *fp;

The return address of the callee is next to EBP. In this code segment,we print *(fp + 1) to get it.

I did test on this. The printed address makes sense.

Next, the problem is how to resolve those symbols.http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html