Merge "dumpstate: Collect PCIe link statistics"
diff --git a/battery_mitigation/battery_mitigation.rc b/battery_mitigation/battery_mitigation.rc
index dd86344..6c8f5cc 100644
--- a/battery_mitigation/battery_mitigation.rc
+++ b/battery_mitigation/battery_mitigation.rc
@@ -15,76 +15,76 @@
 on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,sub && property:sys.boot.reason=reboot,uvlo,pmic,sub
     setprop vendor.brownout_reason "uvlo,pmic,sub"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck1m && property:sys.boot.reason=reboot,ocp,buck1m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK1M && property:sys.boot.reason=reboot,ocp,buck1m
     setprop vendor.brownout_reason "ocp,buck1m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck2m && property:sys.boot.reason=reboot,ocp,buck2m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK2M && property:sys.boot.reason=reboot,ocp,buck2m
     setprop vendor.brownout_reason "ocp,buck2m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck3m && property:sys.boot.reason=reboot,ocp,buck3m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK3M && property:sys.boot.reason=reboot,ocp,buck3m
     setprop vendor.brownout_reason "ocp,buck3m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck4m && property:sys.boot.reason=reboot,ocp,buck4m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK4M && property:sys.boot.reason=reboot,ocp,buck4m
     setprop vendor.brownout_reason "ocp,buck4m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck5m && property:sys.boot.reason=reboot,ocp,buck5m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK5M && property:sys.boot.reason=reboot,ocp,buck5m
     setprop vendor.brownout_reason "ocp,buck5m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck6m && property:sys.boot.reason=reboot,ocp,buck6m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK6M && property:sys.boot.reason=reboot,ocp,buck6m
     setprop vendor.brownout_reason "ocp,buck6m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck7m && property:sys.boot.reason=reboot,ocp,buck7m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK7M && property:sys.boot.reason=reboot,ocp,buck7m
     setprop vendor.brownout_reason "ocp,buck7m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck8m && property:sys.boot.reason=reboot,ocp,buck8m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK8M && property:sys.boot.reason=reboot,ocp,buck8m
     setprop vendor.brownout_reason "ocp,buck8m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck9m && property:sys.boot.reason=reboot,ocp,buck9m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK9M && property:sys.boot.reason=reboot,ocp,buck9m
     setprop vendor.brownout_reason "ocp,buck9m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck10m && property:sys.boot.reason=reboot,ocp,buck10m
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK10M && property:sys.boot.reason=reboot,ocp,buck10m
     setprop vendor.brownout_reason "ocp,buck10m"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck1s && property:sys.boot.reason=reboot,ocp,buck1s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK1S && property:sys.boot.reason=reboot,ocp,buck1s
     setprop vendor.brownout_reason "ocp,buck1s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck2s && property:sys.boot.reason=reboot,ocp,buck2s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK2S && property:sys.boot.reason=reboot,ocp,buck2s
     setprop vendor.brownout_reason "ocp,buck2s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck3s && property:sys.boot.reason=reboot,ocp,buck3s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK3S && property:sys.boot.reason=reboot,ocp,buck3s
     setprop vendor.brownout_reason "ocp,buck3s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck4s && property:sys.boot.reason=reboot,ocp,buck4s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK4S && property:sys.boot.reason=reboot,ocp,buck4s
     setprop vendor.brownout_reason "ocp,buck4s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck5s && property:sys.boot.reason=reboot,ocp,buck5s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK5S && property:sys.boot.reason=reboot,ocp,buck5s
     setprop vendor.brownout_reason "ocp,buck5s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck6s && property:sys.boot.reason=reboot,ocp,buck6s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK6S && property:sys.boot.reason=reboot,ocp,buck6s
     setprop vendor.brownout_reason "ocp,buck6s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck7s && property:sys.boot.reason=reboot,ocp,buck7s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK7S && property:sys.boot.reason=reboot,ocp,buck7s
     setprop vendor.brownout_reason "ocp,buck7s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck8s && property:sys.boot.reason=reboot,ocp,buck8s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK8S && property:sys.boot.reason=reboot,ocp,buck8s
     setprop vendor.brownout_reason "ocp,buck8s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck9s && property:sys.boot.reason=reboot,ocp,buck9s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK9S && property:sys.boot.reason=reboot,ocp,buck9s
     setprop vendor.brownout_reason "ocp,buck9s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buck10s && property:sys.boot.reason=reboot,ocp,buck10s
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK10S && property:sys.boot.reason=reboot,ocp,buck10s
     setprop vendor.brownout_reason "ocp,buck10s"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buckds && property:sys.boot.reason=reboot,ocp,buckds
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKDS && property:sys.boot.reason=reboot,ocp,buckds
     setprop vendor.brownout_reason "ocp,buckds"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buckas && property:sys.boot.reason=reboot,ocp,buckas
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKAS && property:sys.boot.reason=reboot,ocp,buckas
     setprop vendor.brownout_reason "ocp,buckas"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buckcs && property:sys.boot.reason=reboot,ocp,buckcs
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKCS && property:sys.boot.reason=reboot,ocp,buckcs
     setprop vendor.brownout_reason "ocp,buckcs"
 
-on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,buckbs && property:sys.boot.reason=reboot,ocp,buckbs
+on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKBS && property:sys.boot.reason=reboot,ocp,buckbs
     setprop vendor.brownout_reason "ocp,buckbs"
 
 on property:vendor.brownout.br.feasible=1
diff --git a/performance/Android.bp b/performance/Android.bp
new file mode 100644
index 0000000..6eee7c4
--- /dev/null
+++ b/performance/Android.bp
@@ -0,0 +1,18 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_binary {
+    name: "dump_perf",
+    srcs: ["dump_perf.cpp"],
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+    shared_libs: [
+	"libdump",
+    ],
+    vendor: true,
+    relative_install_path: "dump",
+}
diff --git a/performance/dump_perf.cpp b/performance/dump_perf.cpp
new file mode 100644
index 0000000..aa742f1
--- /dev/null
+++ b/performance/dump_perf.cpp
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dump/pixel_dump.h>
+
+int main() {
+    dumpFileContent("VENDOR PROC DUMP", "/proc/vendor_sched/dump_task");
+    return 0;
+}
diff --git a/performance/perf.mk b/performance/perf.mk
new file mode 100644
index 0000000..dfbdb5b
--- /dev/null
+++ b/performance/perf.mk
@@ -0,0 +1,3 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/performance/sepolicy
+
+PRODUCT_PACKAGES += dump_perf
diff --git a/performance/sepolicy/dump_perf.te b/performance/sepolicy/dump_perf.te
new file mode 100644
index 0000000..15c4f6e
--- /dev/null
+++ b/performance/sepolicy/dump_perf.te
@@ -0,0 +1,3 @@
+pixel_bugreport(dump_perf)
+
+allow dump_perf proc_vendor_sched:file r_file_perms;
diff --git a/performance/sepolicy/file_contexts b/performance/sepolicy/file_contexts
new file mode 100644
index 0000000..171529e
--- /dev/null
+++ b/performance/sepolicy/file_contexts
@@ -0,0 +1,2 @@
+/vendor/bin/dump/dump_perf      u:object_r:dump_perf_exec:s0
+
diff --git a/pixel_ril/compatibility_matrix.xml b/pixel_ril/compatibility_matrix.xml
index b3539f6..edd9ecd 100644
--- a/pixel_ril/compatibility_matrix.xml
+++ b/pixel_ril/compatibility_matrix.xml
@@ -1,6 +1,6 @@
 <compatibility-matrix version="1.0" type="framework" level="7">
     <hal format="aidl" optional="true">
-        <name>vendor.google.ril_ext</name>
+        <name>hardware.google.ril_ext</name>
         <version>1</version>
         <interface>
             <name>IRilExt</name>
diff --git a/pixel_ril/manifest_ril.xml b/pixel_ril/manifest_ril.xml
index ca11929..a292d3f 100644
--- a/pixel_ril/manifest_ril.xml
+++ b/pixel_ril/manifest_ril.xml
@@ -1,6 +1,6 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
-        <name>vendor.google.ril_ext</name>
+        <name>hardware.google.ril_ext</name>
         <fqname>IRilExt/slot1</fqname>
     </hal>
 </manifest>
diff --git a/pixel_ril/manifest_ril_ds.xml b/pixel_ril/manifest_ril_ds.xml
index 15af796..ade8b26 100644
--- a/pixel_ril/manifest_ril_ds.xml
+++ b/pixel_ril/manifest_ril_ds.xml
@@ -1,6 +1,6 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
-        <name>vendor.google.ril_ext</name>
+        <name>hardware.google.ril_ext</name>
         <fqname>IRilExt/slot1</fqname>
         <fqname>IRilExt/slot2</fqname>
     </hal>
diff --git a/pixel_ril/sepolicy/service_contexts b/pixel_ril/sepolicy/service_contexts
index 5f29162..be5a8d2 100644
--- a/pixel_ril/sepolicy/service_contexts
+++ b/pixel_ril/sepolicy/service_contexts
@@ -1,3 +1,3 @@
-vendor.google.ril_ext.IRilExt/slot1               u:object_r:hal_ril_ext_service:s0
-vendor.google.ril_ext.IRilExt/slot2               u:object_r:hal_ril_ext_service:s0
-vendor.google.ril_ext.IRilExt/slot3               u:object_r:hal_ril_ext_service:s0
+hardware.google.ril_ext.IRilExt/slot1               u:object_r:hal_ril_ext_service:s0
+hardware.google.ril_ext.IRilExt/slot2               u:object_r:hal_ril_ext_service:s0
+hardware.google.ril_ext.IRilExt/slot3               u:object_r:hal_ril_ext_service:s0