> As soon as profiling is started,
> POSE hangs, i.e. it sucks up most of the CPU power on my NT machine. My
> program in POSE freezes. If I use the menu then in order to stop
> profiling or to dump results I get dialog boxes, stating "Unhandled
> Exception in WinMain. Dying like a log.".

Naturally, I couldn't try out your example since you only provided a snippet.
But when using the following complete application, profiling appears to work OK.

    #include <PalmOS.h>
    #include "StarterRsc.h"

    UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
    {
        if (cmd == sysAppLaunchCmdNormalLaunch)
        {
            HostProfileInit(1000, 10);
            HostProfileStart();

            SysRandom (0);

            HostProfileStop();
            HostProfileDump("RazorDump");
            HostProfileCleanup();
        }

        return 0;
    }

> Also: What are reasonable values for the parameters to
> HostProfileInit()?

As you can tell from the Poser source code, when selecting the menu items, the
following values are used:

    HostProfileInit (0x10000, 200);

-- Keith Rollin
-- Palm OS Emulator engineer






Tilo Christ <[EMAIL PROTECTED]> on 12/22/2000 10:00:05 AM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  Tilo Christ <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  Profiling API in POSE broken?



Hello!

I am using POSE 3.0a8 to profile my software. So far, I have only used
the profiling menu commands, which works perfectly. Now I tried to
switch to the HostProfilexxx API, to get more comparable results. I
tried to instrument my code as illustrated below, where the nextPeriod()
method is invoked in regular intervals. As soon as profiling is started,
POSE hangs, i.e. it sucks up most of the CPU power on my NT machine. My
program in POSE freezes. If I use the menu then in order to stop
profiling or to dump results I get dialog boxes, stating "Unhandled
Exception in WinMain. Dying like a log.".

Also: What are reasonable values for the parameters to
HostProfileInit()?

Cheers,
Tilo


void MyActionEngine::nextPeriod()
{
 if (state.periodCounter == 5)
 {
  // Turn on profiling
  HostProfileInit(1000, 10);
  HostProfileStart();
 }
 else if (state.periodCounter == 250)
 {
  // Turn off profiling after a while
  HostProfileStop();
  HostProfileDump("RazorDump");
  HostProfileCleanup();

  SoundEngine::playFx(0);
 }

 state.periodCounter++;

.... My code ....
}





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to