blob: 8c795ad3bc6a0107dd554ed015965fdf83da8b44 [file] [log] [blame]
Primiano Tucci5a304532018-01-09 14:15:43 +00001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15service traced /system/bin/traced
16 class late_start
17 disabled
18 socket traced_consumer stream 0666 root root
19 socket traced_producer stream 0666 root root
20 user nobody
21 group nobody
22 writepid /dev/cpuset/system-background/tasks
23
24service traced_probes /system/bin/traced_probes
25 class late_start
26 disabled
27 user nobody
Hector Dearman44fb6402018-02-23 10:10:05 +000028 group nobody readproc
Primiano Tucci5a304532018-01-09 14:15:43 +000029 writepid /dev/cpuset/system-background/tasks
Florian Mayer7d1a9a22018-02-14 15:17:58 +000030 # Clean up procfs configuration even if traced_probes crashes
31 # unexpectedly.
32 onrestart exec_background - nobody shell -- /system/bin/traced_probes --cleanup-after-crash
Florian Mayera98c6f52018-02-19 13:56:07 +000033 file /dev/kmsg w
Primiano Tuccid6e84852018-03-29 20:26:57 +000034 capabilities DAC_READ_SEARCH
Primiano Tucci5a304532018-01-09 14:15:43 +000035
Hector Dearmane9bdfe52018-03-21 13:24:28 +000036on property:sys.traced.enable_override=1
37 setprop persist.traced.enable 1
38
39on property:sys.traced.enable_override=0
40 setprop persist.traced.enable 0
41
Lalit Magantidabc5292018-05-23 19:18:55 +010042on property:debug.atrace.user_initiated=1
43 stop traced_probes
44
45on property:persist.traced.enable=1 && property:debug.atrace.user_initiated=""
46 start traced_probes
47
Primiano Tucci71758822018-01-25 12:51:45 +000048on property:persist.traced.enable=1
Primiano Tucci7e2b67a2018-01-16 16:38:49 +000049 # Trace files need to be:
50 # - Written by either uid:shell or uid:statsd.
Primiano Tucci71758822018-01-25 12:51:45 +000051 # - Read by shell and dropbox (dropbox is part of system_server).
Primiano Tucci7e2b67a2018-01-16 16:38:49 +000052 # When written to dropbox, they are persistet in the perfetto-traces folder
53 # only for the time it takes to make a dropbox call, and unlinked
54 # immediately in any case.
55 mkdir /data/misc/perfetto-traces 0773 root shell
56
Primiano Tucci5a304532018-01-09 14:15:43 +000057 start traced
58 start traced_probes
Hector Dearman7549fff2018-02-09 17:25:30 +000059
60on property:persist.traced.enable=0
61 stop traced
62 stop traced_probes