Analyzing Device Application Performance with the .Net Compact Framework Remote Performance Monitor
Service Pack 1 of the .Net Compact Framework version 2 (see https://blogs.msdn.com/netcfteam/archive/2006/04/21/580901.aspx) includes a new utility called the .Net Compact Framework Remote Performance Monitor (RPM). The RPM helps you diagnose performance problems in your application by providing a dynamic, graphical view of various runtime performance statistics. The performance statistics displayed by the RPM are those that are present in the ".stat" files in previous versions of the Compact Framework. See David Kline's blog entry "Monitoring Application Performance..." for a thorough description of all the counters viewable through the RPM.
You have two choices when viewing data using RPM. First, you can view the counters in a textual table format using the RPM tool itself, or you can view all the data the RPM gathers using the standard Windows Performance Monitor.
This post provides instructions for installing and using the RPM. This tool is a big step forward for .Net Compact Framework developers. For the first time, you'll be able to to use standard performance tools to gain insight into your application's performance as it runs!
Installation
The .Net CF Remote Performance Monitor includes some files that reside on the desktop machine and some files that must be present on the device.
Installing the desktop components is easy - just run the SP1 setup program. After the installation completes, the RPM executable (netcfrpm.exe) is placed in the bin directory of Compact Framework SDK. On my machine, this directory is C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin.
Installing the device-side components involves manually copying two files from the desktop machine to the device. The SP1 setup program places the device-side files in the same directory as the cab file that matches your processor type and operation system version. I have a Pocket PC 2003 SE device, so my device-side components are installed in C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce400\armv4. The two files you must copy are netcfrtl.dll and netcflaunch.exe. Both of these files must be copied to the \windows directory of your device.
Installation Notes for Windows Mobile 5.0 Devices
There are two issues you may run into when installing the device-side RPM components on Windows Mobile 5.0 devices.
- Depending on the security configuration chosen by the device manufacturer, you may see a security prompt on the device the first time you launch the RPM. This prompt appears because netcfrpm.dll is not signed.
- An additional installation step is necessary on Windows Mobile 5.0 devices to provision the device so the RPM can run. Provisioning involves copying the following XML text into a file and using the rapiconfig utility to send the XML file to the device.
- <wap-provisioningdoc>
- <characteristic type="Metabase">
- <characteristic type="RAPI\Windows\netcfrtl.dll\*">
<parm name="rw-access" value="3" />
<parm name="access-role" value="152" />
<!-- 152 maps to "CARRIER_TPS | USER_AUTH | MANAGER"-->
</characteristic>
</characteristic>
</wap-provisioningdoc>
For example, if you pasted the above XML text into a file named rpmprov.xml you'd issue the following command from your desktop machine to provision your device:
rapiconfig /p rpmprov.xml
Launching the Remote Performance Monitor
To view dynamic performance statistics for your application, launch netcfrpm.exe from the desktop machine and select the "Live Counters...." option under the File menu. Doing so displays the following window:
Before you can view live statistics, you must connect the RPM to your device and specify the application you'd like to run. The instructions for connecting the RPM to your device vary based on whether the connection between your desktop machine and your device is via Active Sync or an Ethernet connection. If your connection is over ActiveSync, your device will automatically appear in the Device drop down in the RPM user interface. If your desktop machine is connected to the device through a direct network connection, you must know the IP address and port number through which the RPM can connect to your device. This information can be obtained by running netcflauch.exe from the \windows directory of your device. Running netcflaunch.exe displays the following:
Using the data displayed by netcflaunch.exe, enter the IP address and port number in format <IPAddress><single space><port number> in the Device drop down in the RPM user interface.
Before connecting to the device, you must specify the application you'd like to monitor using the Application text box. Be sure to type the fully qualified path name to the executable you wish to run on the device. For example, \Program Files\poomcominterop\poomcominterop.exe. If your applications takes command line parameters, you can specify them in the Parameters text box. If you need to specify more than one parameter, be sure to separate them with a space.
After you've selected the device to connect to, and specified the application to launch, click the Connect button in the lower right corner of RPM's user interface. The RPM will send a command to the device to remotely launch the application and start pulling back performance statistics. RPM displays the statistics in tabular form as shown in the following picture:
Again, a description of the various counters can be found on David Kline's blog.
Viewing Performance Statistics using Perfmon
While viewing performance statistics in RPM is useful, it's often easier to spot performance trends by viewing the data in a graphical form. The RPM enables you to view the statistics graphically by sending all the data it collects to the Windows Performance Monitor. After opening performance monitor, select the "Add Counter" option. In the dialog that is displayed you'll see counters corresponding to each category of performance statistic gathered by the RPM as show below:
After selecting the counters you'd like to view, the values for those counters appear as a line in the Perfmon graph. You may need to adjust the scale Perfmon uses to display a counter depending on the expected range of values. In the picture below I've chosen to view counters representing the size of the GC heap and the total number of bytes allocated while my application runs.
Other RPM Features
In addition to viewing performance statistics, the RPM also allows you to set various configuration options for your device. Selecting the Logging Options item from the Device menu displays the following dialog:
As you can see, the RPM allows you to configure the various types of logging done by the Compact Framework and to put your device into a state in which you can attach the debugger to any managed process. The following links provide more information about the various logging options:
- Loader logging: https://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx
- Interop logging: https://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx
Thanks,
Steven
This posting is provided "AS IS" with no warranties, and confers no rights.
Comments
Anonymous
April 21, 2006
The .NET Compact Framework team has been working on a service pack for .NET Compact Framework 2.0.&nbsp;...Anonymous
April 23, 2006
Ok, so Microsoft may not even have been aware of my
product that integrates the Windows Performance...Anonymous
April 23, 2006
&nbsp;&nbsp;Here’s TMM 138 – TMM back in all its glory.. :)&nbsp;
Software / Hardware&nbsp;
PhoneScoop.com...Anonymous
April 23, 2006
The .NET Compact Framework team have released Beta 1 of their SP1 for .NET Compact Framework v2.0
You...Anonymous
April 24, 2006
.NET Compact Framework 를 사용하시는 분들이라면 확수고대하게 기다려셨던&nbsp; .NET Compact Framework v2.0 서비스 팩 베타1를 공개합니다....Anonymous
April 25, 2006
Ya está en el aire el primer SP de Compact Framewok 2.0, aunque aún en beta. Lo que traerá de nuevo este...Anonymous
May 25, 2006
Steven Pratschner recently posted about one of the coolest new features of the Service Pack 1 beta for...Anonymous
June 19, 2006
.NET Compact Framework SP1 リリース - パフォーマンス診断ツール "リモートパフォーマンスモニタ"Anonymous
June 21, 2006
Microsoft .NET Compact Framework version 2.0 SP1 release has been completed and is in the process of...Anonymous
June 21, 2006
The .NET CF team has released Service Pack 1 for .NET CF 2.0!!!!&nbsp; Read their announcment.
Added...Anonymous
June 22, 2006
就在昨天,MEDC 2006 China的前夜,.NET Compact Framework 2.0 的SP1已经发布。下载地址:http://www.microsoft.com/downloads/details.aspx?FamilyID=0c1b0a88-59e2-4eba-a70e-4cd851c5fcc4&amp;displaylang=en不过目前只是一个单独的安装包,专门针对VS2005的补丁还正在制作之中。新增特性:...Anonymous
June 23, 2006
Come saprete è uscito il service pack 1 per il .NET Compact Framework 2.0. Si tratta della versione redistributable,...Anonymous
June 23, 2006
Come saprete è uscito il service pack 1 per il .NET Compact Framework 2.0. Si tratta della versione redistributable,...Anonymous
June 26, 2006
그동안&nbsp;MEDC 2006&nbsp;행사 때문에 블로깅을 제대로 하지 못했네요! 그러다보니&nbsp;윈도우 모바일/임베디드 개발자에게 전달해야 소식이 한 꾸러미네요~!!
먼저...Anonymous
July 22, 2006
PingBack from https://blogs.msdn.com:443/jinhoseo/archive/2006/06/27/648385.aspxAnonymous
July 31, 2006
PingBack from http://www.centplus.com/moving-oni-havent-really-discussed-that-aspect-of-my-career/Anonymous
August 04, 2006
The .NET Compact Framework v2 SP1 patch can now be downloaded from MSDN. You can get to the download...Anonymous
August 14, 2006
Come saprete è uscito il service pack 1 per il .NET Compact Framework 2.0. Si tratta della versione redistributable,...Anonymous
August 14, 2006
Come saprete è uscito il service pack 1 per il .NET Compact Framework 2.0. Si tratta della versione redistributable,...Anonymous
August 17, 2006
The recent release of Service Pack 1 for the .NET Compact Framework version 2 has added some very useful...Anonymous
September 13, 2006
Le .NET Compact Framework 2.0 Service Pack 1 est maintenant disponible à l'URL suivante :
http://www.microsoft.com/downloads/details.aspx?FamilyID=0C1B0A88-59E2-4EBA-A70E-4CD851C5FCC4&amp;displaylang=en...Anonymous
September 14, 2006
PingBack from http://www.centplus.com/your-yahoo-is-showingtheres-been-some-reports-about-how-google/Anonymous
September 20, 2006
PingBack from http://www.centplus.com/blog-metrics-simplifiedthe-most-well-written-concise-and-understandable/Anonymous
September 29, 2006
The comment has been removedAnonymous
October 01, 2006
PingBack from http://www.centplus.com/calacanisi-rarely-blog-but-i-recently-saw-this-post-by/Anonymous
October 31, 2006
Hier ist der Link dazu MSDN-BLOG.Anonymous
October 31, 2006
In my earlier post on using the .Net Compact Framework Remote Performance Monitor, I describe that youAnonymous
November 12, 2006
A seguito del rilascio del servicepack1 del CF2.0, l'installazione di NETCFRPM (tool per la visualizzazioneAnonymous
November 12, 2006
A seguito del rilascio del servicepack1 del CF2.0, l'installazione di NETCFRPM (tool per la visualizzazioneAnonymous
February 18, 2007
.NET Compact Framework 를 사용하시는 분들이라면 확수고대하게 기다려셨던 .NET Compact Framework v2.0 서비스 팩 베타1를 공개합니다. 정식 릴리즈는Anonymous
March 07, 2007
PingBack from http://blog.opennetcf.org/ncowburn/2007/03/07/RemotePerformanceMonitorAndVista.aspxAnonymous
March 08, 2007
Service Pack 2 of the .Net Compact Framework V2.0 includes some new features in the Remote PerformanceAnonymous
March 16, 2007
前段时间发布了Beta版,还没有来的及试用,现在终于发布了正式版。Anonymous
May 14, 2007
PingBack from http://sakowicz.wordpress.com/2007/05/15/windows-mobile-developer-day/Anonymous
August 10, 2007
Chris Tacke OpenNETCF Consulting August, 2007 Introduction We here at OpenNETCF Consulting just deliveredAnonymous
August 10, 2007
#table table td { border: 1px solid black; } Chris Tacke OpenNETCF Consulting August, 2007 IntroductionAnonymous
September 21, 2007
The last few versions of the Remote Performance Monitor enable you to view snapshots of the GC heap onAnonymous
September 21, 2007
The last few versions of the Remote Performance Monitor enable you to view snapshots of the GC heap onAnonymous
October 17, 2007
Version 3.5 of the .Net Compact Framework contains a new memory profiler called the CLRProfiler. TheAnonymous
October 17, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/10/18/the-clrprofiler-for-the-net-compact-framework-part-1-getting-started/Anonymous
October 26, 2007
The Remote Performance Monitor (RPM) first shipped in version 2 service pack 1 of the .Net Compact Framework. Anonymous
October 26, 2007
The Remote Performance Monitor (RPM) first shipped in version 2 service pack 1 of the .Net Compact FrameworkAnonymous
October 26, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/10/26/whats-new-in-the-remote-performance-monitor-for-net-compact-framework-35/Anonymous
October 28, 2007
What's new in the Remote Performance Monitor for .Net Compact Framework 3.5Anonymous
October 28, 2007
Una veloce sintesi delle novità relative al Remote Performance Monitor per il .NET CF 3.5: The RemoteAnonymous
November 28, 2007
I love tools.  Debuggers , analyzers, performance monitors, profilers, everything.  In versionAnonymous
November 28, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/11/28/steven-pratschner-on-the-clr-profiler-for-the-net-compact-framework/Anonymous
December 18, 2007
PingBack from http://blog.primordial.com/2007/12/18/performance-profiling-in-net-cf-10-review-of-existing-profilers/Anonymous
March 16, 2008
PingBack from http://bordercrossingstatsblog.info/steven-pratschners-net-cf-weblog/Anonymous
July 22, 2008
Over the years, I’ve delivered several “Top 10” sessions and called them different things. Top Snafus,Anonymous
January 18, 2009
PingBack from http://www.keyongtech.com/3029744-remote-performance-monitor-is-notAnonymous
January 21, 2009
PingBack from http://www.keyongtech.com/466481-live-mscoreestat-countersAnonymous
April 09, 2009
The comment has been removedAnonymous
May 31, 2009
PingBack from http://www.codedstyle.com/how-does-the-net-compact-memory-allocator-work-13/