android builds (incl. standalone): switch from Oz to O2
This speeds up ftrace parsing by about ~25% (12% little
core -> 9% little core) on a crosshatch under medium load.
In terms of binary size (android tree builds on master):
HEAD:
12K bin/traced_probes
12K bin/traced
600K bin/perfetto
316K bin/trigger_perfetto
940K lib64/libperfetto.so
32K lib64/libperfetto_android_internal.so
This topic:
12K bin/traced_probes
12K bin/traced
708K bin/perfetto
364K bin/trigger_perfetto
1.1M lib64/libperfetto.so
28K lib64/libperfetto_android_internal.so
On GetStaticEventInfo in particular:
* without the posted change, we're about +75K on libperfetto.so
when switching to O2.
I've kept the return type as a vector since the proto translation
table ends up operating on a dynamic vector in the end. I've also
kept it separate from trace_processor's ftrace descriptor array,
since they are different enough that a shared definition ends up
being more convoluted.
"bloaty" diff on libperfetto.so (this topic (O2) vs head (Oz)):
file size +165K
vm size +203K
https://paste.googleplex.com/5528773631934464
Change-Id: I442d42914dcc7ab56a09f068cb86b2842c2c3297
diff --git a/Android.bp b/Android.bp
index f88ae78..e6fe23b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -900,7 +900,7 @@
cc_defaults {
name: "perfetto_defaults",
cflags: [
- "-Oz",
+ "-O2",
"-Wno-error=return-type",
"-Wno-sign-compare",
"-Wno-sign-promo",