Commit d7ce58b
committed
art: Disable debug tracing on production builds
When opening and closing activities in Settings, a significant amount of
CPU time is spent checking whether ATrace tags are enabled, as measured
by simpleperf:
0.12% /system/lib64/libcutils.so atrace_get_enabled_tag
ART debug tracing (via PALette) is responsible for a significant
portion of the time spent in the checks:
0.10% 0.07% /system/lib64/libcutils.so atrace_get_enabled_tags
|
-- atrace_get_enabled_tags
|
|--30.47%-- PaletteTraceEnabled
| |
| |--96.11%-- art::Monitor::TryLock(art::Thread*, bool)
| | void art::Monitor::Lock<(art::LockReason)1>(art::Thread*)
| | art::Monitor::MonitorEnter(art::Thread*, art::ObjPtr<art::mirror::Object>, bool)
| | artLockObjectFromCode
| | art_quick_lock_object_no_inline
| | |--8.63%-- [hit in function]
| | |
| | |--18.62%-- android.os.Parcel.obtain
|
|--2.44%-- PaletteTraceIntegerValue
| |
| |--25.86%-- art::mirror::String::AllocFromModifiedUtf8(art::Thread*, int, char const*, int)
| |
| |--22.90%-- art::mirror::Object* art::gc::Heap::AllocLargeObject<false, art::mirror::SetLengthVisitor>(art::Thread*, art::ObjPtr<art::mirror::Class>*, unsigned long, art::mirror::SetLengthVisitor const&)
| |
| |--19.85%-- artAllocArrayFromCodeResolvedRegionTLAB
| |
| |--19.71%-- art::mirror::String::AllocFromUtf16(art::Thread*, int, unsigned short const*)
| |
| --11.70%-- art::mirror::Object::Clone(art::Handle<art::mirror::Object>, art::Thread*)
We aren't going to use ATrace for ART in production systems, so disable
debug tracing in non-debug builds.
Test: simpleperf record -a; verify that PaletteTraceEnabled no longer
appears under atrace_get_enabled_tags
Change-Id: If5cdb18adb17b04f5f7eb7c59cfb3f9ceaecb5be1 parent b49effd commit d7ce58b
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| 50 | + | |
43 | 51 | | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
47 | 59 | | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
0 commit comments