Skip to main content
GameDev.net gamedev.net
🔒 Locked

How do profilers work?

Started by CloudNine Apr 7, 2005 at 7:10 AM 2 replies 900+ views
Original Post
CloudNine
CloudNine
Lo, How do code profilers like Intel's VTune profile the code? Do they instrument the code with timers etc. automatically, and if so, how? I know GNU gprof is a good free software profiler, is it a typical example of a profiler? I've always been interested in how they work, and the detail of VTune surprises me. CloudNine
Trap
Trap
There essentially are 2 ways to do profiling:
a) intrusive (place timers in code)
b) statistical (every x cycles check location in code)

Usually statistical profiling is what you want to use because it shows the behaviour of the real code.
Skizz
Skizz
You can also do it through simulation, which VTune does as well as the above. By this I mean analysing the code for potential stalls and such like.

Skizz
CloudNine
CloudNine
Ah, interesting. Is the statistical profiling performed from outside the application, and if so, how is it possible to get the instruction pointer of the task?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.