summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMartin Liu <liumartin@google.com>2020-04-17 18:47:57 +0800
committerMartin Liu <liumartin@google.com>2020-04-26 09:26:54 +0000
commitfd56a7d1b992d1fb811e9dcb7e46df62d7300a6b (patch)
tree34b5d643b96ca6f6f71d45cd35faeb904467e3dd /mm
parent46a78f224fdbbae867f9e1b46969481e897152b8 (diff)
downloadpixel-fd56a7d1b992d1fb811e9dcb7e46df62d7300a6b.tar.gz
mm: add mm common rc
This CL creats a common rc file and include mm trace relative sepolicy into mk file. Thus, device side could easily add this mk file to reduce the porting effort. Bug: 152414692 Test: build Merged-In: Ie034e3c5ee514be2e4a2ec243e884160ccccb836 (cherry picked from commit 9c2ecc330f1d659eb2561902808d9e4db9eb1170) Change-Id: Ie034e3c5ee514be2e4a2ec243e884160ccccb836
Diffstat (limited to 'mm')
-rw-r--r--mm/device.mk4
-rw-r--r--mm/pixel-mm.rc41
2 files changed, 45 insertions, 0 deletions
diff --git a/mm/device.mk b/mm/device.mk
new file mode 100644
index 00000000..15b4b0eb
--- /dev/null
+++ b/mm/device.mk
@@ -0,0 +1,4 @@
+PRODUCT_COPY_FILES += \
+ hardware/google/pixel/mm/pixel-mm.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/pixel-mm.rc
+
+BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/mm
diff --git a/mm/pixel-mm.rc b/mm/pixel-mm.rc
new file mode 100644
index 00000000..8523fc15
--- /dev/null
+++ b/mm/pixel-mm.rc
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2020 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+on property:sys.boot_completed=1
+ # Create mm_event trace point.
+ # Currently, only mm_event is using this trace instance.
+ # If others want to put more,it should get hard review from pixel-perf-team.
+ mkdir /sys/kernel/tracing/instances/pixel-trace 0755 system system
+ chown system system /sys/kernel/tracing/instances/pixel-trace/trace
+ chmod 0660 /sys/kernel/tracing/instances/pixel-trace/trace
+ chown system system /sys/kernel/tracing/instances/pixel-trace/tracing_on
+ chmod 0660 /sys/kernel/tracing/instances/pixel-trace/tracing_on
+ write /sys/kernel/tracing/instances/pixel-trace/buffer_size_kb 64
+ write /sys/kernel/tracing/instances/pixel-trace/events/mm_event/enable 1
+ write /sys/kernel/tracing/instances/pixel-trace/events/f2fs/f2fs_iostat/enable 1
+ write /sys/kernel/tracing/instances/pixel-trace/events/ufs/ufs_stats/enable 1
+
+# turns off tracing right before bugreporting to keep more traces
+on property:init.svc.dumpstatez=running
+ write /sys/kernel/tracing/instances/pixel-trace/tracing_on 0
+
+on property:init.svc.dumpstatez=stopped
+ write /sys/kernel/tracing/instances/pixel-trace/tracing_on 1
+
+on property:init.svc.bugreport=running
+ write /sys/kernel/tracing/instances/pixel-trace/tracing_on 0
+
+on property:init.svc.bugreport=stopped
+ write /sys/kernel/tracing/instances/pixel-trace/tracing_on 1