Game Development Community

Profiler question

by Greg Houston · in Torque Game Engine · 10/30/2004 (7:56 pm) · 5 replies

Hello guys. I've been working with Torque for a bit now, and I thought I'd try out the profiler to find what's causing the slowdown in one of the missions our mapper whipped up. Problem is the profiler refuses to work. To be more accurate, I type in the proper command to enable it and the console accepts that just fine. I tour the map, visit the trouble areas, and give it a good deal of time to come up with some results. However, when it comes time to see those results by entering "profilerDump();" or "profilerDumpToFile();" nothing happens. No error is returned; nothing is returned. There is simply no response. Now in the other maps, I can do the exact same thing, enable the profiler, gather information, and print that information, without a problem. Just this mission, which really needs some looking into, has problems with it. Is the mission missing something perhaps? I know #define ENABLE_PROFILER is all set, and as I said, the profiler works perfectly with our other missions. Any ideas? Thanks a lot for reading. The team and I are in love with Torque :)

About the author

Recent Threads

  • Strange shader bug

  • #1
    10/30/2004 (8:53 pm)
    Do you call profilerEnable(1); first?
    #2
    10/30/2004 (8:57 pm)
    Yes. I made sure to call profilerEnable(1); first thing.
    #3
    10/30/2004 (9:59 pm)
    Hmm. Mysterious. Try setting some breakpoints in the profiler code? One thing to be aware of is that it won't print stuff out if the PROFILE_START/END macros don't match up perfectly. It only prints once the stack hits zero depth. Sometimes if you get off by one it will keep running for some time without crashing with a profiler stack overflow but never respond to your input.

    More likely maybe a macro isn't taking effect or somesuch...
    #4
    10/31/2004 (3:20 pm)
    I've gone through each and every PROFILE_START/END macro, and they match up. One suggestion I received from Galdor on IRC was to modify the macros for the file causing the trouble so that it will print out every push/pop with depth, and then just do a visual inspection of the log and see where it's not popping. I'm not quite sure how I'd go about doing that though I'm afraid. More specifically, I'm not quite sure how to find the file causing the trouble. I'm sorry if I'm missing the obvious. I'm rather new to Torque. If anyone could expand a bit on Galdors suggestion I would really appreciate it. Thanks again.
    #5
    10/31/2004 (6:38 pm)
    What I've done in this situation is copy the PROFILE_START/END macro definitions to the start of the file, and add some printf's to them. It's a bit hacky but it's good for short-term debugging.