Andrew Klofas
Andrew Klofas

Reputation: 620

Linux library for profiling

Is there a Linux library that can run performance profiling within a running process?

I have a rather large linux program that is heavily script-based. Depending on the scripts, the program can have wildly different behaviors (and performance problems). What would be nice is a low-overhead performance library that I can embed in the same process that monitors and provides real-time feedback to the process about it's own performance.

Oprofile would be fantastic, if I could start it within the program and keep it isolated to only that program. From the documentation I've read, it doesn't appear possible.

Does anyone know of any such library?

Thanks!
Andrew Klofas

Upvotes: 3

Views: 399

Answers (2)

karunski
karunski

Reputation: 4090

I think gperftools works well for profiling. The runtime performance penalty for CPU profile data is very small.

Upvotes: 2

sholsapp
sholsapp

Reputation: 16080

Check out gprof - it should do what you want.

Upvotes: 5

Related Questions