littlewhywhat / extrace

Extrace
Other
0 stars 0 forks source link

Events doesn't apply to all processes #39

Open littlewhywhat opened 6 years ago

littlewhywhat commented 6 years ago

for example, command:

./data/extrace -a com.android.dialer -e sched -t 10 -p 1000000 -m 1000 -pids 2045,1343 -o /data/out 2>/dev/null > /data/after_out

creates output like this:

---------------------------------------------------------------------------------------
 | 2045|onBindViewHolder: 6
---------------------------------------------------------------------------------------
 |  1343 |   0 % |  783228K |  125480K |   72107K |   63060K |  3928317006 | SLEEPING |
---------------------------------------------------------------------------------------
 | 2045|RV CreateView
---------------------------------------------------------------------------------------
 |  1343 |   0 % |  783228K |  125480K |   72107K |   63060K |  3928319100 | SLEEPING |
---------------------------------------------------------------------------------------
 | 2045|RV OnBindView
---------------------------------------------------------------------------------------
 |  1343 |   0 % |  783228K |  125480K |   72107K |   63060K |  3928319106 | SLEEPING |
---------------------------------------------------------------------------------------
 | 2045|onBindViewHolder: 7
---------------------------------------------------------------------------------------
 |  1343 |   0 % |  783228K |  125560K |   72189K |   63144K |  3928337821 | SLEEPING |
---------------------------------------------------------------------------------------
 | MemTrace
--------------------------------------------------------------------------------------- 
 |  1343 |   0 % |  783228K |  125560K |   72189K |   63144K |  3928342621 |    AWAKE |
---------------------------------------------------------------------------------------
 | SchedWakeup
---------------------------------------------------------------------------------------

but these events 2045|onBindViewHolder - doesn't appear in list of events for pid 2045.

first onBindView is 3928044195 on line 11931. first record for 2045 is 3922135822 on line 96.

in fact no onBindView is applied to process 2045... after_out.txt init_out.txt

littlewhywhat commented 6 years ago

once I remove filter algorithms - events are present. putting back cpu filter also preserves records. The problem is with memory filter.

littlewhywhat commented 6 years ago

memory filter works by taking first record memory and removing all that are less then record memory + limit. If limit is zero (as it is with no arguments), all records that have memory less are removed. Therefore, records for onBindView are removed. They have less memory.

// first record with valid USS
---------------------------------------------------------------------------------------
 | SchedSwitch
---------------------------------------------------------------------------------------
 |  2045 |  10 % |  733804K |   93868K |   39750K |   31712K |  3922135822 | SLEEPING |
---------------------------------------------------------------------------------------

// onBindView
---------------------------------------------------------------------------------------
 |  2045 |   2 % |  733804K |   93468K |   39350K |   31312K |  3928044195 |  RUNNING |
---------------------------------------------------------------------------------------
 | 2045|RV OnBindView
---------------------------------------------------------------------------------------

difference is in -400 K - so it's not displayed. Filters should be applied only on user intent.