Bug 11904

Summary: log profiler: --time=FROM-TO doesn't work
Product: [Mono] Runtime Reporter: Rolf Bjarne Kvinge [MSFT] <rolf>
Component: GeneralAssignee: Paolo Molaro <lupus>
Status: RESOLVED FIXED    
Severity: normal CC: kumpera, mcobena, mono-bugs+mono, mono-bugs+runtime, rolf, shaw
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: test.cs that takes a while to execute

Description Rolf Bjarne Kvinge [MSFT] 2013-04-23 10:00:05 UTC
Created attachment 3854 [details]
test.cs that takes a while to execute

Repro:
    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.