Bug 11904 - log profiler: --time=FROM-TO doesn't work
Summary: log profiler: --time=FROM-TO doesn't work
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Paolo Molaro
Depends on:
Reported: 2013-04-23 10:00 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2014-06-03 19:23 UTC (History)
6 users (show)

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

test.cs that takes a while to execute (1.09 KB, application/octet-stream)
2013-04-23 10:00 UTC, Rolf Bjarne Kvinge [MSFT]

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 Rolf Bjarne Kvinge [MSFT] 2013-04-23 10:00:05 UTC
Created attachment 3854 [details]
test.cs that takes a while to execute

    mcs test.cs
    mono --profile=log:output=-output.mlpd,zip,noalloc,maxframes=8 test.exe
    mprof-report --traces --time=1-2 --method-sort=self --alloc-sort=bytes --verbose output.mlpd > 1second
    mprof-report --traces --time=2-4 --method-sort=self --alloc-sort=bytes --verbose output.mlpd > 2seconds
    diff 1second 2seconds

There will be no output from the diff, indicating that the --time option does not do anything at all.
Comment 2 Rodrigo Kumpera 2013-05-15 22:04:15 UTC
Paolo, do you plan on work on this?
Comment 3 Marcos Cobeña Morián 2014-05-06 07:28:02 UTC
Hey, I've found this bug while trying to make --time flag work.

It'd quite useful for our company to find the culprit for a performance issue.

Any ETA on this? Thanks in advance for your work guys!
Comment 4 Paolo Molaro 2014-05-13 09:53:32 UTC
There are a few fixes now in git to make the --time option more useful, previously it basically only handled allocations.
Note that for method enter/leave events that cross the time boundaries there can be inconsistencies, since we may consider either the enter or leave events, but not the matching leave/enter, so some of the timings will look wrong. I suggest using the sample mode for this case and you'll only get the sample events for the chosen timeframe.