Readme-Nintendo_3DS_CPU_Profiler-4_04-en.html

Nintendo 3DS CPU Profiler 4.04

Contents

  1. Introduction
  2. Precautions
  3. System Requirements
  4. Verified Operating Environment
  5. Installation
  6. Package Structure
  7. Revision History

1. Introduction

This package contains the Nintendo 3DS CPU Profiler. It is a statistical sampling profiler that detects which functions are using a significant amount of CPU time.

The manual for the profiler can be found in the root profiler directory or by clicking here.

The API man pages are available here.

This version of the profiler will expire on 2015-12-31.

Important: This package is prohibited from being used in the retail product.

2. Precautions

  • Currently the thread stack must be read into the profiler and then parsed. Because of this, the profiler can only support stacks that are 64 KB deep. If the stack is deeper than 64 KB, only the most recent 64 KB will be reported back, potentially leading to stacks containing UNKNOWN STACK DETAILS or shortened callstacks.
  • It is not be permitted for a game to ship with the profiler code in the executable. Please disable all profiler related code prior to submission (see Nintendo 3DS CPU Profiler Game API for instructions on disabling the Nintendo 3DS CPU Profiler). Additionally, the profiler library should not be linked against your project.

3. System Requirements

4. Verified Operating Environment

  • SDK 7.1.1 or later
  • Firmware 0.20.51 or later
  • One of the following:
    • PARTNER-CTR version 5_70-035 or later with HOSTIO Daemon 1.03.014 or later
    • IS-CTR-DEBUGGER and IS-CTR-HIO version 2.01 or later
  • The profiler makes use of the compiler in order to demangle C++ function names. This is located via the Window's environment variable for the compiler. Either the ARMCC 5 or 4.1 can be installed to make use of this feature. If both are installed, the demangler from ARMCC 5 will be used.
  • The profiler makes use of certain Cygwin features for the Assembly tab. Specifically, the binutils package for Cygwin will need to be installed in order for the profiler to have access to the addr2line application available therein.

5. Installation

Unzip the profiler package to a directory of your choice.

Open the runtime\CTR\SDK-SDKVersionNumber folder corresponding to your SDK revision and copy the contents to your SDK install directory. If there is not an SDKVersionNumber for your SDK revision, use the folder corresponding to the nearest previous SDK revision. For example, if you have SDK 7.x, use the contents of the folder SDK-4_1_0.

  1. Start the Debugger
  2. Save the Profiler to NAND
    • For PARTNER-CTR Debugger: In the command window, type nand write PathToProfilerCIA (for example, nand write C:\profiler\runtime\CTR\SDK-4_1_0\profiler.cia).This will write the profiler.cia file to NAND. After it is written, please reboot the debugger and dev kit.
    • For IS-CTR-DEBUGGER: In the Open dialog, select CIA from the filetype list box and browse to the profiler.cia file.
  3. Optional: Mark frames in your application following the steps in Frame Marking on Nintendo 3DS.

6. Package Structure

The structure of this package is shown below.
Note: Not all files are necessarily listed below.
Nintendo_3DS_CPU_Profiler/
    |
    +- bin/
    |    |
    |    +- Nintendo CPU Profiler.exe - Profiler GUI
    |    |
    |    +- Plugins/
    |    |
    |    +- QuickFilters/
    |
    +- demos/
    |
    +- man/
    |
    +- runtime/
    |    |
    |    +- SDK-<version_num>/
    |        |
    |        +- CTR_SDK/
    |        |    |
    |        |    +- include/
    |        |    |    |
    |        |    |    +- nn/ - Header files
    |        |    |
    |        |    +- libraries/
    |        |         |
    |        |         +- CTR-TS.Process.MPCore/ - Runtime libraries
    |        |
    |        +- profiler.cia - Profiler application
    |
    +- Nintendo_3DS_CPU_Profiler_Manual_en.pdf - Manual (English)
    +- Nintendo_3DS_CPU_Profiler_Manual_ja.pdf - Manual (Japanese)
    |
    +- Readme-Nintendo_3DS_CPU_Profiler-en.html - Readme (English)
    +- Readme-Nintendo_3DS_CPU_Profiler-ja.html - Readme (Japanese)

7. Revision History

Version 4.04 - 2015/04/22
  • Added Checkers looking for C++ exception use, profiling a Debug build, and unique word use in function names.
  • Added new Last tab to show functions and their percentages from the previous Sampled profile.
  • Added new Diff feature to show difference between functions in two profiles.
  • The dev kit used to take the profile is now saved into the Info tab.
  • When more than one dev kit is connected, a default is now selected in the Select a Dev Kit window.
  • Improved speed of loading profiles.
  • Reduced memory overhead when loading and taking profiles.
  • Fixed profile loading error related to parsing system idle time.
  • Fixed issue that could lead to Assembly Tab crashing the profiler.
  • Fixed issue where rerunning a checker could lead to the checker appearing twice.
  • Fixed issues where running under .NET 4.5 rather than .NET 4.0 could lead to small differences in behavior and look.
  • Added ability to take an Inferred Callstack profile.
  • Added a dev kit availability manager, so that only one profiler instance can Sync with a dev kit.
  • Updated look of the Forced CTR Compatibility Mode button.
  • Fixed issue where ARM MPCore specific instructions were not being decoded properly.
  • Fixed issue where Unsyncing while a transfer was in progress could lead to a crash.
  • Fixed issue where attempting to demangle a function name containing a '$' would lead to a crash.
Version 4.03.2 - 2015/02/13
  • Fixed issue that could stop the Checker results from displaying.
  • Fixed issue where some tool tips were not displayed properly.
  • Fixed issue where some Japanese text was not displayed properly.
  • Renamed the CTR Back Compat button to Forced CTR Compatibility Mode to align with the terminology used by the debugger.
Version 4.03.1 - 2014/12/02
  • Added additional messaging in case of a failed Sync.
  • Changed how Sample Gaps are calculated. Rather than attributing to the previous sample, they are attributed to the following sample.
  • Updated and improved speed of some checkers.
  • Fixed bug where Margin of Error did not display properly when either Time or Avg Units were selected.
  • Fixed crash that could occur if a drive was removed from the system between profiler runs.
  • Fixed crash that could occur when hovering over Sample Graph when first Syncing to a dev kit.
  • Fixed issue where some errors did not properly display that an error had occurred.
  • Fixed crash issue that could occur when clicking the Sync button.
Version 4.03 - 2014/10/22
  • Added new scripting command PROFILER-TREECONTROL.
  • Added splash screen when profiler is starting.
  • Added information in the Status Bar on which dev kit the profiler is connected to.
  • Added checkers for Too Many Threads and Large Number of Function Calls.
  • Added right-click context menu to Assembly Tab.
  • Removed option to Run Checkers as this is always performed after a profile is loaded or taken.
  • Renamed Debug Output tab to Console tab.
  • Renamed some options on the Sample Graph right-click context menu.
  • Script files can now be drag-dropped onto the profiler window to begin execution.
  • Fixed display bug of tool tips in the Quick Ribbon Bar when Ribbon Bar was collapsed.
  • Fixed bug with Group Filter 'All' option.
  • Fixed crash that could occur when attempting to view assembly.
  • Fixed bug in the Function Info Details that lead to self and total percentages to be ever increasing values if the window was not closed.
  • Profiler can determine the difference between SNAKE and CTR applications.
  • Improvements to the Assembly View.
  • Fixed bug with core selection not working correctly under some circumstances.
Version 4.02.1 - 2014/08/06
  • Added ability to configure Checkers.
  • Added ability to Select Function from Code Coverage tab.
  • Debug output tab now supports selection of either UTF-8 or Shift-JIS for decoding output.
  • Updated middleware search to include additional middleware products.
  • Scripts can be drag-dropped onto the profiler to have them run.
  • Fixed bug with the String Functions checker displaying percentages incorrectly.
  • Corrected capitalization of checker names.
  • Fixed issue keeping CCL files from being found when using the --loadelf option.
  • Fixed issue where using an IS dev kit would result in the profiler resetting to the Home tab on the first use.
Version 4.02 - 2014/07/30
  • Added Checkers.
  • Added Function Details.
  • Added Stack Graph.
  • Added Icicle Selected graph.
  • Added ability to drag-drop a file on the profiler.
  • Added ability to sort Assembly Tab columns.
  • The title bar will now reflect the active platform.
  • Improved profiler's handling of template functions.
  • Minor updates to Classifications.
  • Reordered Sample Graph toolbar to account for new features.
  • Fixed a timing issue that could result in the profiler crashing.
  • Fixed an issue where a crash could occur when attempting to resolve function names from addresses.
  • Fixed an issue with the automatic connection that could result in the profiler becoming unresponsive.
  • Fixed instances where certain informational and warning message boxes were not acting as a modal dialogs.
  • Removed restrictions on Debug Output tab display.
  • Fixed issue where some Idle time was not properly displayed in the Icicle Graph.
  • Added ability to see data as either text or a function in the Assembly Tab.
  • Two-part branch statements in THUMB now show the branch target in the Assembly Tab.
  • Improved speed of scripting system and Quick Filters.
  • Improved stability of multi-core profiling.
  • Updated Operating Environment.
  • Re-enabled the ability to load profiles from pre 1.0 versions of the profiler.
  • Fixed Thread Selection drop-down to use base-16 IDs to correspond with the rest of the displayed thread IDs in the profiler.
  • Fixed issue where profiles from version 3.01f and earlier with performance counter might not load correctly.
  • Fixed an issue where starting multiple profiler instances could lead to a crash.
  • Fixed an issue with misidentified UNKNOWN STACK DETAILS.
  • Fixed issue when attempting to record a specific thread that was running on Core 1 (the System Core).
Version 4.01 - 2014/04/16
  • Added Debug Output tab.
  • Added two new Spike Detection algorithms.
  • Removed Clear and Evaluate buttons from Code Coverage tab.
  • Sample Graph tool tips are now more informative.
  • Code Coloring (Classifications) and Quick Filters can now share regular expressions.
  • Sampled and Instrumented profiling tabs now only appear if Synced to a def kit.
  • Fixed issue where Heatmap Mode did not work with non-Callstack profiles.
  • Fixed issue where Heatmap Mode could display functions beyond the end of a frame.
  • Fixed issue where settings for plugins could be lost.
  • Fixed measuring to always show time value.
  • Fixed problem with hiding Load per Frame graph on start-up.
  • Fixed issue where Recorded Module unload times were incorrectly displayed.
  • Fixed issue where the Info line for Inferred Heartbeats would display incorrectly.
  • Fixed issue in Icicle Graphs for recursive functions.
  • Fixed an issue that could lead to a profiler crash.
  • Fixed minor memory leak and performance issues.
  • Added additional error messages when problems occurred in the profiler.
  • Enhanced multi-core profiling support.
  • The AXF is now only reloaded if it has changed since the last Sync or Reload.
  • Fixed issue where the profiler did not respect or show errors that occurred during Reload.
  • Fixed issue where Reload might fail on IS kits.
  • Fixed the tool tip text for the Code Directory.
  • Fixed crashing issue related to disconnecting from a dev kit.
Version 4.00 - 2014/02/28
  • New branding of the Wii U CPU Profiler GUI.
  • Platforms are now treated as plugins to allow for a single, unified user interface experience.
  • Added function classification and Icicle Graph.
  • Added Heatmap Mode.
  • Added additional Quick Filters.
  • Added a dev kit selection window.
  • Decreased memory footprint.
  • Decreased loading times.
  • Scripting system will now stop executing if a problem occurs in a command.
  • Combined the Profiler-Asm* scripting commands into a single Profiler-Assembly command.
  • Fixed a memory leak in the Sample Graph.
  • Greatly modified the Nintendo 3DS CPU Profiler user interface to look more like the Wii U CPU Profiler.
  • Added ability to profile both cores at the same time.
  • Added ability to take an instrumented profile without performance counters.
  • Added CTR Assembly View interleaved source code (using Cygwin binutils package).
  • Sync button will now only light up if a dev kit is found to connect to.
  • Removed support for Ring Buffer.
  • Moved API reference to their own man pages.
  • Fixed issue where no errors would be displayed if the loadrun_ctr DLLs were not found.
Version 3.01f - 2013/12/17
  • Fixed a bug that kept the profiler from working with IS-CTR-DEBUGGER on 64-bit systems.
Version 3.01e - 2013/12/13
  • Fixed issue that kept profiler from loading ELF files made with ARMCC 5.04.
Version 3.01d - 2013/10/29
  • Fixed an issue with callstacks.
Version 3.01c - 2013/10/29
  • Added support for ARMCC 5.x.
Version 3.01b - 2013/02/19
  • Removed the expiration date.
  • Fixed a bug where-in functions existing in a cro were only displayed in the functions list for the first profile.
  • Fixed a bug where-in callstacks for applications that used nn::ro showed mainly as UNKNOWN STACK DETAILS.
  • General Bug Fixes
Version 3.01a - 2012/11/19
  • Fixed a bug where profiling an application that uses the nn::ro library causes the profiler to crash.
  • Fixed an issue where profiling release builds of applications that use the nn::ro library causes profile data to become corrupt.
Version 3.01 - 2012/08/23
  • Added support for profiling the System Core (SDK-3_X and higher)
  • General Bug Fixes
Version 3.00a - 2012/05/23
  • Fixed a bug where the time of the profile (in the info window) was being shown as the runtime of the application instead of the duration of the profile taken.
  • Added support for SDK 4_X
Version 3.00 - 2012/05/07
  • Added support for profiling applications that make use of the nn::ro library.
  • Added a more explicit error message for when an application crashes under the profiler.
  • General Bug Fixes.
Version 2.01 - 2012/01/24
  • Fixed a minor bug that prevented a message box from spawning when no development kit is connected.
  • Fixed a bug that prevented Auto-frame tracking.
  • Added support for .ccl files.
  • Initial support for IS-CTR-DEBUGGER.
Version 2.00 - 2011/11/30
  • Integrated communications into Nintendo 3DS CPU Profiler GUI application
  • Added support for firmware 0.15.35 and later
  • Added support for SDK-3_X
  • Added "Function Calls (Average)" to Instrumented Function/Blocks
  • Minor GUI improvements
  • Removed PCCOM Server
  • Fixed some minor formatting issues
  • Fixed a bug that allowed some functions to be instrumented even though they used parameters stored on the stack
  • Fixed crash bug caused by modifying the Additional Info when no profile was loaded
  • Fixed bug that would incorrectly report the percentage of samples when frames were selected
Version 1.01 - 2011/10/19
  • License extension
  • Removed SDK-1_X requirements
Version 1.00 - 2011/07/05
  • Fixed a problem with the menu tabs
  • Fixed an issue with the versioning in the SDK 1.X profiler build
Version 1.00 - 2011/07/01
  • Fixed a problem with Callstack parsing when floating-point values were stored on the stack
  • Reduced the number of UNKNOWN STACK DETAILS reported
Version 1.00 - 2011/06/22
  • New product name: Nintendo 3DS CPU Profiler
  • Added button to launch the manual
  • Fixed an issue with instrumented enum names not being displayed
  • New NPROF file format with backwards compatibility
  • Added connected dev kit identifier to status bar
  • Increased size of progress bar
Version 0.14 - 2011/04/28
  • Improved messaging when an error occurs during Sync
  • Fixed an issue in 64-bit mode that occurred during Unsync
Version 0.14 - 2011/04/27
  • Extended expiration date
  • The profiler GUI now runs in 64-bit mode rather than using 32-bit emulation when possible
  • Improved recognition of functions that have arguments on the stack
Version 0.14 - 2011/03/18
  • Added build for SDK 2.0
  • Added notes about further restrictions on what kind of functions can be instrumented
  • Changed package layout for multiple SDK versions
  • Removed the Plotting Game API functions as they will never be supported by the GUI
  • Fixed issue where an Access Violation would occasionally occur once a profile had finished
  • Fixed issue where a Game Crash would cause a lockup if a profile was being transferred
  • Fixed issue with sampling by performance counters
  • Fixed issue that would occur when attempting to Instrument a function that started with a PC-relative instruction
  • Fixed a Heatmap mode display bug
Version 0.14 - 2011/02/25
  • Reverse Call Tree
  • Added callstack trace to Game Crash Report
  • Added check to AXF & CCI timestamps to display a warning if there appears to be a mismatch
  • Changed 'Profiled Application Crash Report' to 'Game Crash Report'
  • Changed Instrumented profiling to allow for CodeBlock-only profiles
  • Changed behavior of progress bar
  • Improved profile loading/analyzing speed
  • Fixed issue where enum names were not being displayed properly for some profiles
Version 0.13 - 2011/01/28
  • Increased buffer size cap to 16MB along with appropriate warnings
  • Added automatic perf Hide for profiles above 1MB
  • Added alpha toggle for Sample Graph
  • Improved profile loading/analyzing speed
  • Improved Sample Graph rendering speed
  • Improved accuracy of Sample Graph Heatmap mode
Version 0.13 - 2011/01/24
  • Added dialog box when buffer size is changed
  • Fixed some memory leaks in the GUI
Version 0.13 - 2011/01/21
  • Possible to select larger buffer size
  • Added CodeBlock functionality
  • Added graphing of subfields for Instrumented Functions & CodeBlocks
  • Added Heatmap view for Instrumented Functions
  • Reduced restrictions on ARM functions that can be instrumented
  • Removed BufferSize API function
Version 0.12 - 2010/12/20
  • Added information about API requirements for Instrumented Profiling to GUI and Manual
  • Fixed crash when using Intrumented Profiling after Sampled Profiling w/ Callstacks
Version 0.12 - 2010/12/15
  • ARM function instrumentation
  • Greatly increase speed for saving reports with a large number of functions
  • Increased the maximum size of AXF that can be loaded for profiling
  • Changed profiler GUI layout due to addition of instrumentation
  • Fixed bugs surrounding Call Trees with THUMB code
  • Fixed some memory leaks in the profiler GUI
  • Fixed bug that would cause GUI to crash if last used drive was no longer available
Version 0.11 - 2010/10/29
  • Automatic frame marking
  • SYSTEM WAITING now shows in Sample Graph
  • Added line in Sample Graph for nnprofWaitForVSync call
  • Added ability to select frames based on fps
  • Added new Game API function to specify profiling method
  • Added ability to select top 15 functions in function list, as well as the 2nd, 3rd, and 4th top 15 functions
  • Added Error button to turn on margin of error metrics for Percent and Time values
  • Added fps buttons to select particular frames based on frame rate
  • Changed Time units to be more useful by showing average time per frame when frames are marked
  • Changed how Game API specifies which Performance Counters to profile
  • Functions displayed without args in Sample Graph, for easier reading
  • Profiler now uses HIO Channel 11 instead of 1
  • Fixed bugs causing nnprofGetProfilerStatus to return incorrect values
Version 0.10 - 2010/10/14
  • Added Enable/Disable Profiling runtime control
  • Fixed bug where system buffer size was not properly reflected in GUI
  • Profiler GUI shows Stop button when runtime control starts profiling
  • Fixed bug where app froze when runtime control stopped profiling
  • Updates to profiler manual
Version 0.10 - 2010/10/07
  • Profile by Performance Counter
  • Added Heatmap view
  • Added RuntimeControl API
  • Added function to check profiler's status
  • Added some command-line options to profiler GUI
  • Ability to specify a slightly larger buffer
  • C++ and Macro Game APIs removed -- please use the C API
Version 0.09 - 2010/09/10
  • Changed Reload to only reload AXF/CCI if modified since last load
  • Fixed bug where profiler could not correctly switch between dev kits
  • Fixed erroneous display of starting profiler error
  • Fixed bug with pressing STOP while profile was transferring
Version 0.09 - 2010/09/03
  • Basic Performance Counter support
  • Made starting a profile more automatic
  • Implemented Reload button
  • Fixed 100% CPU usage bug in PCCOM Server on 64-bit machines
Version 0.08 - 2010/08/12
  • Fixed bug with GUI highlighting when switching viewed thread
  • Fixed crash bug with Profiler Game API functions
  • Fixed 100% CPU usage bug in PCCOM Server
  • Fixed other bugs
Version 0.08 - 2010/08/06
  • Added profiling of the Active thread (Replaces "Default" behavior)
  • Added file association
  • Changed how callstack profiling works
  • Removed some extraneous file creations
  • Fixed selection crash in the Functions tab
  • Fixed bug that occurred when profiling multiple times in a row
  • Fixed find results to update after profiling/loading
Version 0.07 - 2010/08/02
  • Improved loading speed
  • Profiler Game API is now C compatible
  • Fixed THUMB compatibility issues
  • Fixed other bugs
Version 0.07 - 2010/07/27
  • Initial Version