Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cf0fe2d4 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Use sampling for faster measuring of CPU time

Calling SystemClock.currentThreadTimeMicro() is expensive (order of
1 microsecond).

To mitigate that, we use sampling by measuring every 10th call for the
given class/transaction combination and extrapolate results.

Sampling is not used when --enable-detailed-tracking option is set,

For more compact output, only 90th percentile is printed, unless -a
option is set. Example output:

Per-UID Summary (cpu_time, % of total cpu_time, call_count, exception_count, package/uid):
    13095032  43%    44663   0 com.package1/u0a35
     8872156  29%     5831   0 com.package2/u0a75
     2379684   8%     1549   0 com.package3/u0a23

Test: manual dumpsys binder_calls_stats
Test: BinderCallsStatsTest + BinderCallsStatsPerfTest
Bug: 75318418
Change-Id: I535e796c17e75d70970e227411cdf0e1a4afd81c
parent f74c9832
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment