Reland: Reland: Add statsd logging to perfetto_cmd

This reverts commit 64f2e052525af1d1c06eb5eea7348346db6c0819.

Reason for revert: Required code is present in aosp as of aosp/1181211

Change-Id: I3747992a319cdd7a0b8c225fa2c916fe60e06c1f
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
index fa38f37..fa689ca 100755
--- a/tools/gen_android_bp
+++ b/tools/gen_android_bp
@@ -93,22 +93,29 @@
 module_prefix = 'perfetto_'
 
 # Shared libraries which are directly translated to Android system equivalents.
-library_whitelist = [
-    "android.hardware.atrace@1.0",
-    'android.hardware.health@2.0',
-    "android.hardware.power.stats@1.0",
+shared_library_whitelist = [
     'android',
+    'android.hardware.atrace@1.0',
+    'android.hardware.health@2.0',
+    'android.hardware.power.stats@1.0',
     'base',
     'binder',
+    'cutils',
     'hidlbase',
     'hidltransport',
     'hwbinder',
     'incident',
     'log',
     'services',
+    'statssocket',
     'utils',
 ]
 
+# Static libraries which are directly translated to Android system equivalents.
+static_library_whitelist = [
+    'statslog_perfetto',
+]
+
 # Name of the module which settings such as compiler flags for all other
 # modules.
 defaults_module = module_prefix + 'defaults'
@@ -628,8 +635,10 @@
       # Generally library names should be mangled as 'libXXX', unless they
       # are HAL libraries (e.g., android.hardware.health@2.0).
       android_lib = lib if '@' in lib else 'lib' + lib
-      if lib in library_whitelist:
+      if lib in shared_library_whitelist:
         module.shared_libs.add(android_lib)
+      if lib in static_library_whitelist:
+        module.static_libs.add(android_lib)
 
   # If the module is a static library, export all the generated headers.
   if module.type == 'cc_library_static':