[profiler] Add mlpd stats dumping, use --reports=stats.
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 23 Sep 2015 20:40:55 +0000 (16:40 -0400)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 23 Sep 2015 20:43:53 +0000 (16:43 -0400)
commitf4255e7a9c1e100b70e495f116173acc94b517d1
tree0760e5f2bb918bc38ecaf8533412b55076680db3
parente2bd97b939955fdff868a564b5954344c0a597a0
[profiler] Add mlpd stats dumping, use --reports=stats.

This add statistical collection of mlpd files. Right now it reports basic statics on number of events
and their overhead, plus general buffer overhead.

This should enable us better understand what a file is made of when figuring out ways to optimize it.

Here's a sample output:

```
Mlpd statistics
    Buffer count 13499  overhead 647952 (48 bytes per header)

Event details:
             TYPE_GC                 TYPE_GC_EVENT  count   6313    min   4 max      8  bytes 35802
             TYPE_GC                  TYPE_GC_MOVE  count  17737    min  12 max    262  bytes 4138055
             TYPE_GC        TYPE_GC_HANDLE_CREATED  count  29833    min   6 max     14  bytes 296379
             TYPE_GC      TYPE_GC_HANDLE_DESTROYED  count   6620    min   5 max     10  bytes 42515
       TYPE_METADATA                 TYPE_END_LOAD  count  15926    min  12 max    271  bytes 1112068
         TYPE_METHOD                      TYPE_JIT  count  10246    min  26 max   1015  bytes 1043018
      TYPE_EXCEPTION                   TYPE_CLAUSE  count      2    min   6 max      6  bytes 12
      TYPE_EXCEPTION             TYPE_EXCEPTION_BT  count      2    min  50 max     50  bytes 100
           TYPE_HEAP               TYPE_HEAP_START  count      1    min   3 max      3  bytes 3
           TYPE_HEAP                 TYPE_HEAP_END  count      1    min   4 max      4  bytes 4
           TYPE_HEAP              TYPE_HEAP_OBJECT  count 284536    min   5 max    654  bytes 4823852
           TYPE_HEAP                TYPE_HEAP_ROOT  count 2508919   min  11 max    355  bytes 750970914
         TYPE_SAMPLE     TYPE_SAMPLE_COUNTERS_DESC  count      3    min 256 max   2835  bytes 3712
         TYPE_SAMPLE          TYPE_SAMPLE_COUNTERS  count   1089    min   3 max    402  bytes 66219
        TYPE_RUNTIME                TYPE_JITHELPER  count  21191    min   6 max     29  bytes 252473
```
mono/profiler/decode.c