It looks like recompiling the application with -p probably broke it. IMO, profiling with gprof is almost always a last resort as it is so intrusive that it may skew your profile.
This may be an unwanted advert, but you can use the statistical profiler I am working on now -
Zoom. It does calltrees and side by side source and asm, which I believe are huge value-adds.
If you're only want open source solutions, search for oprofile and sysprof.