blob: 8de1826577999cd1742fa411bef3e914e60cfc52 [file] [log] [blame]
Primiano Tuccifeaf22b2018-03-02 19:27:06 +00001# Domain for atrace process.
2# It is spawned either by traced_probes or by init for the boottrace service.
Alex Klyubin357c1612017-02-07 10:54:20 -08003
Primiano Tuccifeaf22b2018-03-02 19:27:06 +00004type atrace, domain, coredomain;
Nick Kralevich5e372712018-09-27 10:21:37 -07005type atrace_exec, exec_type, file_type, system_file_type;
Alex Klyubin357c1612017-02-07 10:54:20 -08006
Primiano Tuccifeaf22b2018-03-02 19:27:06 +00007# boottrace services uses /data/misc/boottrace/categories
8allow atrace boottrace_data_file:dir search;
9allow atrace boottrace_data_file:file r_file_perms;
Alex Klyubin357c1612017-02-07 10:54:20 -080010
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000011# Allow atrace to access tracefs.
12allow atrace debugfs_tracing:dir r_dir_perms;
13allow atrace debugfs_tracing:file rw_file_perms;
14allow atrace debugfs_trace_marker:file getattr;
15
Lalit Magantid6ae1a52018-11-16 12:17:24 +000016# Allow atrace to write data when a pipe is used for stdout/stderr
17# This is used by Perfetto to capture the output on error in atrace.
18allow atrace traced_probes:fd use;
19allow atrace traced_probes:fifo_file write;
20
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000021# atrace sets debug.atrace.* properties
22set_prop(atrace, debug_prop)
23
24# atrace pokes all the binder-enabled processes at startup with a
25# SYSPROPS_TRANSACTION, to tell them to reload the debug.atrace.* properties.
26
27binder_use(atrace)
28allow atrace healthd:binder call;
29allow atrace surfaceflinger:binder call;
Hector Dearman244bc7c2018-09-05 15:21:54 +010030allow atrace system_server:binder call;
Ryan Savitski232295e2019-05-15 00:54:00 +010031allow atrace cameraserver:binder call;
Hector Dearman244bc7c2018-09-05 15:21:54 +010032
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000033get_prop(atrace, hwservicemanager_prop)
34
Wei Wangbc71a612018-09-19 16:06:28 -070035# atrace can call atrace HAL
36hal_client_domain(atrace, hal_atrace)
37
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000038allow atrace {
39 service_manager_type
Martijn Coenenac097ac2018-08-17 09:35:42 +020040 -apex_service
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000041 -incident_service
Igor Murashkin72a88b12018-10-05 14:48:29 -070042 -iorapd_service
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000043 -netd_service
Luke Huang524f25e2019-02-25 20:12:15 +080044 -dnsresolver_service
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000045 -stats_service
46 -dumpstate_service
47 -installd_service
48 -vold_service
Yifan Hong18ade862019-03-14 15:45:03 -070049 -lpdump_service
Primiano Tuccifeaf22b2018-03-02 19:27:06 +000050}:service_manager { find };
51allow atrace servicemanager:service_manager list;
52
53userdebug_or_eng(`
54 # atrace is generally invoked as a standalone binary from shell or perf
55 # daemons like Perfetto traced_probes. However, in userdebug builds, there is
56 # a further option to run atrace as an init daemon for boot tracing.
Yasuhiro Matsuda3d328172015-06-24 15:24:17 +090057 init_daemon_domain(atrace)
Alex Klyubin357c1612017-02-07 10:54:20 -080058
Carmen Jackson2c8ca452018-01-30 18:14:45 -080059 allow atrace debugfs_tracing_debug:dir r_dir_perms;
Dan Cashman91d398d2017-09-26 12:58:29 -070060 allow atrace debugfs_tracing_debug:file rw_file_perms;
Nick Kralevichb56e6ef2016-12-09 20:14:31 -080061')