Bug 60517 - mprof-report not setting line number correctly in xml file.
Summary: mprof-report not setting line number correctly in xml file.
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Profiler ()
Version: 5.4 (2017-06)
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-11-03 14:36 UTC by Alex Logan
Modified: 2017-11-22 10:06 UTC (History)
5 users (show)

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


Attachments
repro.cs (158 bytes, text/plain)
2017-11-21 19:09 UTC, Ludovic Henry
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 GitHub or Developer Community 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 FIXED

Description Alex Logan 2017-11-03 14:36:56 UTC
On Mac OS, mprof-report behaves correctly and the xml output produced for each statement looks like:

<statement offset="0" counter="1" line="103" column="0"/>

However on Linux Ubuntu, the same command produces the same value for offser and counter, but the line number and column are always 1:

<statement offset="0" counter="1" line="1" column="1"/>
Comment 1 Ludovic Henry 2017-11-21 19:08:45 UTC
Hi,

I tried to reproduce with both Mono 5.4.1.7 (2017-06/e66d9abbb27) and 5.8.0.70 (2017-10/efce3b256a5) on macOS with the attached reproduction case, but I get line="1" column="1" with both versions.

Could you please provide a reproduction case that expose the behaviour you are observing?

Thank you,
Comment 2 Ludovic Henry 2017-11-21 19:09:48 UTC
Created attachment 25781 [details]
repro.cs

I ran:

> mcs repro.cs
> mono --profile=log:coverage repro.exe
> mprof-report --coverage-out=coverage.xml output.mlpd

Are you running it differently?
Comment 3 Alex Logan 2017-11-22 10:06:39 UTC
I have solved this issue. Turns out on Circle I was using a release configuration of my project with code optimisation turned on. This was the reason the line numbers were not being recorded properly. This can be closed now.