diff --git a/private/atrace.te b/private/atrace.te
index a60370d783a6ea25c27a64816cd925e36322f7c0..9cbe71a25f08067c588a56ab47a7665f0597bb59 100644
--- a/private/atrace.te
+++ b/private/atrace.te
@@ -13,6 +13,11 @@ allow atrace debugfs_tracing:dir r_dir_perms;
 allow atrace debugfs_tracing:file rw_file_perms;
 allow atrace debugfs_trace_marker:file getattr;
 
+# Allow atrace to write data when a pipe is used for stdout/stderr
+# This is used by Perfetto to capture the output on error in atrace.
+allow atrace traced_probes:fd use;
+allow atrace traced_probes:fifo_file write;
+
 # atrace sets debug.atrace.* properties
 set_prop(atrace, debug_prop)
 
diff --git a/private/traced_probes.te b/private/traced_probes.te
index e17329363ee5eb0c2b674a21939f2166d13542fd..f84d69894e2bdb9e9ea0650569e17c32e7faeb47 100644
--- a/private/traced_probes.te
+++ b/private/traced_probes.te
@@ -53,9 +53,8 @@ allow traced_probes user_profile_data_file:dir { getattr open read search };
 # their userspace TRACE macros.
 domain_auto_trans(traced_probes, atrace_exec, atrace);
 
-# This is needed for: path="/system/bin/linker64"
-# scontext=u:r:atrace:s0 tcontext=u:r:traced_probes:s0 tclass=fd
-allow atrace traced_probes:fd use;
+# Allow traced_probes to kill atrace on timeout.
+allow traced_probes atrace:process sigkill;
 
 # Allow traced_probes to access /proc files for system stats.
 # Note: trace data is NOT exposed to anything other than shell and privileged