Add profcollectd.etr.probe property and associated permissions

It is used by profcollectd to notify vendor_init to trigger
a manual probe of coresight etr.

Bug: 321061072
Test: build and run on device
Change-Id: I5aa65f8d5a25f1284f09111c940f0a2c1a62ac18
Merged-In: I5aa65f8d5a25f1284f09111c940f0a2c1a62ac18
Ignore-AOSP-First: cherry picked from aosp/3005745
diff --git a/private/compat/34.0/34.0.ignore.cil b/private/compat/34.0/34.0.ignore.cil
index 5f835a4..4ce1503 100644
--- a/private/compat/34.0/34.0.ignore.cil
+++ b/private/compat/34.0/34.0.ignore.cil
@@ -28,6 +28,7 @@
     ot_daemon_service
     ot_daemon_socket
     pm_archiving_enabled_prop
+    profcollectd_etr_prop
     remote_auth_service
     security_state_service
     sensitive_content_protection_service
diff --git a/private/profcollectd.te b/private/profcollectd.te
index f83d4a8..8dc2d89 100644
--- a/private/profcollectd.te
+++ b/private/profcollectd.te
@@ -46,6 +46,9 @@
   get_prop(profcollectd, device_config_profcollect_native_boot_prop)
   set_prop(profcollectd, profcollectd_node_id_prop)
 
+  # Allow profcollectd to trigger manual probe of coresight etr.
+  set_prop(profcollectd, profcollectd_etr_prop)
+
   # Allow profcollectd to publish a binder service and make binder calls.
   binder_use(profcollectd)
   # Allow profcollectd to call callbacks registered by system_server when ETM is ready.
diff --git a/private/property_contexts b/private/property_contexts
index 1ddde23..f7c66a9 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -109,6 +109,7 @@
 sys.trace.              u:object_r:system_trace_prop:s0
 wrap.                   u:object_r:zygote_wrap_prop:s0 prefix string
 persist.wm.debug.       u:object_r:persist_wm_debug_prop:s0
+profcollectd.etr.probe  u:object_r:profcollectd_etr_prop:s0
 
 # Suspend service properties
 suspend.max_sleep_time_millis u:object_r:suspend_prop:s0 exact uint
diff --git a/public/property.te b/public/property.te
index 453a467..95e19b7 100644
--- a/public/property.te
+++ b/public/property.te
@@ -103,6 +103,7 @@
 system_restricted_prop(userspace_reboot_exported_prop)
 system_restricted_prop(vold_status_prop)
 system_restricted_prop(vts_status_prop)
+system_restricted_prop(profcollectd_etr_prop)
 
 compatible_property_only(`
     # DO NOT ADD ANY PROPERTIES HERE
diff --git a/public/vendor_init.te b/public/vendor_init.te
index 7a74e7c..2816091 100644
--- a/public/vendor_init.te
+++ b/public/vendor_init.te
@@ -297,6 +297,10 @@
 get_prop(vendor_init, device_config_vendor_system_native_prop)
 get_prop(vendor_init, device_config_vendor_system_native_boot_prop)
 
+userdebug_or_eng(`
+get_prop(vendor_init, profcollectd_etr_prop)
+')
+
 ###
 ### neverallow rules
 ###