Bug 34080 - No symbols shown for user code when using Instruments to profile a XM app
Summary: No symbols shown for user code when using Instruments to profile a XM app
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: MSBuild ()
Version: 2.0.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-09-18 21:40 UTC by Jon Goldberger [MSFT]
Modified: 2015-09-20 19:10 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (14.51 KB, application/zip)
2015-09-18 21:40 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Jon Goldberger [MSFT] 2015-09-18 21:40:08 UTC
Created attachment 12973 [details]
Test Project

## Description

Trying to use Instruments Time Profiler to profile a XM app does not show any user symbols. I tested this in Debug and in Release configurations with a very simple test app and noted that a .dSYM file is never generated, not in the app bundle or in the bin folder alongside the .app file. I looked in the .app bundle due to this bug report: bug #33628

## Steps to reproduce:

1. Open the attached test project.

2. Build for Debug (and/or Release)

3. Open Instruments (Tools->Launch Instruments)

4. Select Time Profiler and click "Choose"

5. In the upper left of the Instruments Window, click where it says "All Processes" and Select "Choose Target"

6. Navigate to the .app bundle that you build in step 2, select it and click "Choose"

7. Press the Record button (red circle) to launch the app and start profiling

Expected result: I will see symbol names for all user added code in the Call Tree

Actual result: No symbol names for any user code, only memory addresses in the Call Tree for user code. 

## Version info:

=== Xamarin Studio ===

Version 5.9.7 (build 9)
Installation UUID: 964c531b-d928-456b-a9ae-e1f82266b360
Runtime:
	Mono 4.0.4 ((detached/cb6d6b2)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040002

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

Version: 9.0.1.18 (Business Edition)
Hash: d230615
Branch: master
Build date: 2015-09-16 17:04:13-0400

=== Xamarin.Android ===

Version: 5.1.6.7 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.0.2.111 (Business Edition)

=== Build Information ===

Release ID: 509070009
Git revision: 31fa64709030b3edb971237780a452a4c69943c4
Build date: 2015-09-17 11:44:37-04
Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

=== Operating System ===

Mac OS X 10.10.5
Darwin Jons-iMac.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 1 Jon Goldberger [MSFT] 2015-09-20 18:59:26 UTC
From a discussion with Rolf, at appears that Instruments will not show symbols for C# code. From Rolf:
"it's normal that C# frames only show up as memory addresses in Instruments for XM apps

It's because XM apps are JITed. There is no dSYM because dSYMs are created at build time (and at that moment it's not possible to create a memory address -> symbol map, since it all happens at runtime through the JIT)"

It was suggested that our own Profiler should work, but I am not seeing the "Start Profiling" option in the Run menu for a Xam.Mac project. I will investigate that further and file bug if need be.
Comment 2 Jon Goldberger [MSFT] 2015-09-20 19:10:53 UTC
The "Start Profiling" Option is not available for Xam.Mac app projects in the current Stable/Beta release of Xamarin Studio v. 5.9.7 and Xam.Mac v. 2.0.2.111 but is in the current Alpha update channel with Xamarin Studio v. 5.10 and Xam.Mac v. 2.4.0.48.

Switching to the Alpha channel I was able to profile a Xam.Mac app with our Profiler. 
To get our profiler: 
> https://developer.xamarin.com/guides/cross-platform/deployment%2C_testing%2C_and_metrics/xamarin-profiler/

See also the release forum post: 
> https://forums.xamarin.com/discussion/50735/xamarin-profiler-0-22-preview-released#latest

Note that support for Xamarin.Mac app profiling is preliminary.