traced_perf: in-tree builds: arm register parsing basics

This adds libunwindstack as a dependency for traced_perf, and has the necessary
logic to sample the userspace register state of sampled processes. The
registers are converted to libunwindstack's representation and, for now,
printed.

Only supporting arm32/arm64 at the moment. x86 coming soon, standalone builds
require figuring out where to source the uapi constant definitions from.

Sorry, no tests at this point, more of a "I've ran this and it printed
something sensible according to /proc/pid/maps".

Also changes traced_perf to only build in the Android tree atm.

Change-Id: Id0df3b8c3901d733480d4289cf9b37562c3427d8
diff --git a/Android.bp b/Android.bp
index 8c4649f..3dff741 100644
--- a/Android.bp
+++ b/Android.bp
@@ -5416,6 +5416,14 @@
   ],
 }
 
+// GN: //src/profiling/perf:unwind_support
+filegroup {
+  name: "perfetto_src_profiling_perf_unwind_support",
+  srcs: [
+    "src/profiling/perf/unwind_support.cc",
+  ],
+}
+
 // GN: //src/profiling:unittests
 filegroup {
   name: "perfetto_src_profiling_unittests",
@@ -6589,6 +6597,7 @@
     ":perfetto_src_profiling_memory_wire_protocol",
     ":perfetto_src_profiling_perf_producer",
     ":perfetto_src_profiling_perf_producer_unittests",
+    ":perfetto_src_profiling_perf_unwind_support",
     ":perfetto_src_profiling_unittests",
     ":perfetto_src_protozero_protozero",
     ":perfetto_src_protozero_testing_messages_cpp_gen",
@@ -6728,6 +6737,9 @@
     "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
     "-DHAVE_HIDDEN",
   ],
+  include_dirs: [
+    "bionic/libc/kernel",
+  ],
   data: [
     "src/traced/probes/filesystem/testdata/**/*",
     "src/traced/probes/ftrace/test/data/**/*",
@@ -7055,6 +7067,7 @@
     ":perfetto_src_ipc_ipc",
     ":perfetto_src_profiling_perf_producer",
     ":perfetto_src_profiling_perf_traced_perf_main",
+    ":perfetto_src_profiling_perf_unwind_support",
     ":perfetto_src_protozero_protozero",
     ":perfetto_src_tracing_common",
     ":perfetto_src_tracing_ipc",
@@ -7062,7 +7075,10 @@
     "src/profiling/perf/main.cc",
   ],
   shared_libs: [
+    "libbase",
     "liblog",
+    "libprocinfo",
+    "libunwindstack",
   ],
   generated_headers: [
     "perfetto_protos_perfetto_common_cpp_gen_headers",
@@ -7110,6 +7126,9 @@
     "-DGOOGLE_PROTOBUF_NO_RTTI",
     "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
   ],
+  include_dirs: [
+    "bionic/libc/kernel",
+  ],
 }
 
 // GN: //src/traced/probes:traced_probes