I'm debugging an C application and I'd like to know how much time it spends in a particular function.
I could change the source code and add some more code to do the measurement, but it doesn't seem right to me. I'd rather do it with external application, without recompiling every time.
I found out it's possible to set up a break point in GDB so I thought, it must be possible to track the time using similar tool by simple procedure: - set breakpoint - when stopped, measure actual time and run the function - when leaving function, measure time again However, i haven't found a way how to do this in gdb :(
any ideas? Thanks
gprof
will show me counts how many times a function was called, but doesn't want to show me times. It just says "no time accumulated" – Punishable