Sign in to follow this  

Enginuity/GPGems Profiler Problem

This topic is 4734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having a problem with the Profiler code presented in the Enginuity series (which was taken from Game Programming Gems I). A few days ago, I got the first volume of GP Gems. I was playing around with the Profiler on the CD. They provide an executable. (aka, i didn't change any code, so there "shouldn't be" any coding issues). I get weird output, though: See the dollar signs? I come back from vacation today, and decide to figure out what the problem is. I run the SAME executable, and I get the CORRECT output. I opened/closed the executable numerous times, so it wasn't a one time thing. Here is a screenshot of how it's supposed to look: I decide to take a break and I load up Doom 3. I play this for 30 minutes. After that, I go back to the profiler. I run the SAME executable again, and I get the original output (as seen in the 1st screenshot). I am totally perplexed at this moment... and am hoping someone can shed some light. I am sometimes getting the correct output, and sometimes the incorrect output, without changing any code... My only thought is that there is some sort of buffer overflow or something... But looking over the code, I don't think that is it. Also, if it were a coding error, A). GP Gems would've posted the error on their website, or B). Someone, somewhere, would've posted the error about GP Gems, or Enginuity. I haven't found either of those. Thanks :)

Share this post


Link to post
Share on other sites
If you're using a laptop and the profile functions use QueryPerformanceCounter or something rdtsc-based that could be the problem - Many laptop processors can change their clock speed while executing, and the Query..Frequency(or manual calibration w/ rdtsc) function might return the fast clock used for doom3 and then before profiling is done the laptop downclocks itself since it doesn't need that much power anymore and suddenly the frequency it expects the clock to be and the actual frequency don't match up. That could cause all kinds of math problems which could result in the $ (depending on the number->string function's handling of 'special' floating point values like NAN and INF)

Share this post


Link to post
Share on other sites
I think I had the same problem as well.
Try assigning values (0.0) to the member variables in the constructor.
( I think of CProfileSample() )
As far as I remember that helped in my case.

It might be a scope problem too. But I guess it would happen all the time then.
See this thread

Share this post


Link to post
Share on other sites

This topic is 4734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this