Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Any sort of profiling to see if something is processor bound?


  • Please log in to reply
8 replies to this topic

#1 Pete Brown

Pete Brown

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationAnne Arundel County, MD

Posted 24 January 2011 - 07:26 PM

Does the Netduino Plus (or Netduino) include any type of profiling capability? I'm looking for even pretty basic stuff like whether or not I'm CPU bound (MCU bound? <g>) in some operations. Pete
Pete Brown - http://10rem.net (NETMF, C++, Windows, C64, and general geekery) Twitter: @pete_brown
I work for Microsoft. Opinions expressed here are my own and do not necessarily reflect those of my employer,our partners or customers.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 January 2011 - 07:32 PM

Hi Pete, Not today, although there's an infrastructure there where it could be added. It's on our wish list for a future version of .NET MF for sure (and technically it could be added by the community). Chris

#3 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 24 January 2011 - 08:01 PM

Not today, although there's an infrastructure there where it could be added.

If I understand it correctly, the profiling support is already there ('Instrumented' build configuration), but it is disabled for 'small' platforms.

#4 Pete Brown

Pete Brown

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationAnne Arundel County, MD

Posted 25 January 2011 - 06:23 AM

Not today, although there's an infrastructure there where it could be added. It's on our wish list for a future version of .NET MF for sure (and technically it could be added by the community).


Thanks Chris. Would be a nice to have addition in the future. I'm running into some issues that smell like perf, but I can't be sure without some profiling mechanism.

I use tick counts for now.

Pete
Pete Brown - http://10rem.net (NETMF, C++, Windows, C64, and general geekery) Twitter: @pete_brown
I work for Microsoft. Opinions expressed here are my own and do not necessarily reflect those of my employer,our partners or customers.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 January 2011 - 06:24 AM

Have you seen the System.Diagnostics.Stopwatch class (in the project showcase forum)? Chris

#6 Pete Brown

Pete Brown

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationAnne Arundel County, MD

Posted 25 January 2011 - 06:57 AM

Have you seen the System.Diagnostics.Stopwatch class (in the project showcase forum)?


Yep, thanks. I modified it slightly to get elapsed ticks back as an option. That's what I'm using.

Pete
Pete Brown - http://10rem.net (NETMF, C++, Windows, C64, and general geekery) Twitter: @pete_brown
I work for Microsoft. Opinions expressed here are my own and do not necessarily reflect those of my employer,our partners or customers.

#7 Illishar

Illishar

    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 25 January 2011 - 08:04 AM

If I understand it correctly, the profiling support is already there ('Instrumented' build configuration), but it is disabled for 'small' platforms.


I asked Microsoft about 'profiling' some time ago. The answer was, that it's only 'prepared' at this point. It is however very much prepared. In the PK code you'll find a lot of macros like 'NATIVE_PROFILE_CLR' etc. And in the 'tools/bin/Test' dir (in the PK) you'll find a 'MFProfiler.exe' program. So it's rather close I imagine.

#8 JonnyBoats

JonnyBoats

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts
  • LocationPhillips, ME

Posted 26 January 2011 - 01:28 AM

Thread priority is supported in the micro-framework, correct? Why not just spin off a lowest priority thread and have it update a counter. Then have a "test" program run the thread for one min and check the counter. The thread will have used virtually 100% of the CPU time, so the value returned by the counter represents 100% of the CPU for 1 min. Now add the thread to the "real" program you want to benchmark. Run it for however long it takes and check the time and count at the end. You can now compute what percentage of the time the CPU was idle. Example: Suppose the "test" program counts up to 200 in one minute. Now you put it into your real program which runs for 4.5 minutes and counts up to 300. In 4.5 min if your program did nothing you would expect the count to be 200 times 4.5 or 900. Since the count was only 300 you can compute that the CPU was idle (and thus able to increment the count) 300/900 or 1/3 of the time. This is exactly how Windows on the desktop computes CPU usage.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 26 January 2011 - 02:07 AM

Hi Jonny, The multi-threading priority on .NET MF runs a bit different than on the desktop. High-priority threads get the highest % of CPU cycles, but low-priority threads still get a portion of CPU. It's basically round-robin, but with the highest-priority threads getting more CPU time. Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.