1# 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 19 group nobody readproc 20 # 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 23 onrestart exec_background - nobody shell -- /system/bin/heapprofd --cleanup-after-crash 24 # DAC_READ_SEARCH is denied by SELinux on user builds because the SELinux 25 # permission is userdebug_or_eng only. 26 capabilities KILL DAC_READ_SEARCH 27 28on property:persist.heapprofd.enable=1 29 start heapprofd 30 31on property:traced.lazy.heapprofd=1 32 start heapprofd 33 34on property:persist.heapprofd.enable="" && property:traced.lazy.heapprofd="" 35 stop heapprofd 36 37on property:persist.heapprofd.enable=0 38 setprop persist.heapprofd.enable "" 39