Jan 22, 2009

Running NetBeans profiler with WTK emulator

Sadly, as JVMPI/JVMTI is not available on KVM, running netbeans profiler with WTK emulator collects only the statistics of emulator. But I'd still like to put a note here for myself.

P.S. Monty (Sun CLDC HotSpot Implementation) does support JVMPI/JPDA.
  1. Download and install NetBeans
  2. NetBeans IDE 6.5 bundled with Java.
  3. Make sure you have standard JDK 5.0_04 VM or later installed
  4. C:\jdk1.5.0_13
  5. Of course, get WTK installed
  6. Wireless Toolkit 2.5.2
  7. Start NetBeans, and run profiler calibration
  8. Attach profiler
  9. Choose whatever you're going to monitor, here I picked Entire application.Then you should be able to see this progress window, which is waiting for target VM connecting.
  10. Use -agentpath argument of java command
  11. This is for loading the profiler agent into JVM, and I made it by modifying `C:\WTK2.5.2\bin\emulator.vm' to
    C:\jdk1.5.0_13\bin\java -agentpath:"C:\Program Files\NetBeans 6.5\profiler3\lib\deployed\jdk15\windows\profilerinterface.dll=\"C:\Program Files\NetBeans 6.5\profiler3\lib\"",5140 -Dkvem.home="%KVEM_HOME%" ...
    If you're insrested in the syntax, please check here.
  12. Launch WTK emulator
  13. C:\WTK2.5.2\bin>emulator -Xdescriptor:..\apps\UiDemo\bin\UiDemo.jad
    If the emulator is running correctly, the progress window at step 4 will be disappered.
  14. Stop WTK emulator
  15. Choose yes here, unless you're happy with killing time. Here you go!
References:
- NetBeans profiler

No comments:

Post a Comment