blob: 86b8c7455f8dc32147e782224fe183afdbde5b86 [file] [log] [blame]
Florian Mayer7a5d83b2018-10-18 18:57:02 +01001# Copyright (C) 2018 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.
14service heapprofd /system/bin/heapprofd
15 class late_start
16 disabled
17 socket heapprofd stream 0666 root root
18 user nobody
Florian Mayer7ea4c082018-11-13 14:44:39 +000019 group nobody readproc
Florian Mayerbf5a0702019-04-03 12:12:41 +010020 # By default, this daemon is idle. When profiling an app, we should unwind
21 # as fast as possible in the interest of the app being profiled.
22 writepid /dev/cpuset/foreground/tasks
Florian Mayera5bb65d2018-11-28 11:24:28 +000023 onrestart exec_background - nobody shell -- /system/bin/heapprofd --cleanup-after-crash
Florian Mayerb4b0f332019-03-21 18:15:00 +000024 # DAC_READ_SEARCH is denied by SELinux on user builds because the SELinux
25 # permission is userdebug_or_eng only.
26 # This is fine as this is not needed for central heapprofd in fork mode.
Florian Mayer67be9652019-05-31 16:17:11 +010027 # SYS_ADMIN and SYS_PTRACE will be denied unless SELinux enforcement is
28 # off. They are needed to implement the idle page tracking feature, which
29 # only works without SELinux enforcement on.
30 capabilities KILL DAC_READ_SEARCH DAC_OVERRIDE SYS_ADMIN SYS_PTRACE
Florian Mayere30f7222018-12-10 15:03:37 +000031
32on property:persist.heapprofd.enable=1
33 start heapprofd
34
Florian Mayer3077d182019-03-15 14:30:04 -070035on property:traced.lazy.heapprofd=1
36 start heapprofd
37
38on property:persist.heapprofd.enable=0 && property:traced.lazy.heapprofd=0
Florian Mayere30f7222018-12-10 15:03:37 +000039 stop heapprofd