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

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

repro.cs (158 bytes, text/plain)
2017-11-21 19:09 UTC, Ludovic Henry

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:

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

I tried to reproduce with both Mono (2017-06/e66d9abbb27) and (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]

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.