summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMartin Liu <liumartin@google.com>2020-03-27 16:36:34 +0800
committerMartin Liu <liumartin@google.com>2020-03-30 23:10:02 +0800
commite8246bc35813c1f459b8db2a15cfde1321cb7e59 (patch)
tree4ed3bb28d9e547a69ef963737c6d04506afb4d0e /mm
parent5e3ec28452e07ecc83ae803c92cddef92882a01e (diff)
mm: add mm common rc for legacy device
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 Signed-off-by: Martin Liu <liumartin@google.com> Change-Id: I53067b6301c78642eaa59754b3c254aac573a683
Diffstat (limited to 'mm')
-rw-r--r--mm/device_legacy.mk4
-rw-r--r--mm/pixel-mm-legacy.rc40
2 files changed, 44 insertions, 0 deletions
diff --git a/mm/device_legacy.mk b/mm/device_legacy.mk
new file mode 100644
index 0000000..fc988c7
--- /dev/null
+++ b/mm/device_legacy.mk
@@ -0,0 +1,4 @@
+PRODUCT_COPY_FILES += \
+ hardware/google/pixel/mm/pixel-mm-legacy.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/pixel-mm-legacy.rc
+
+BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/mm
diff --git a/mm/pixel-mm-legacy.rc b/mm/pixel-mm-legacy.rc
new file mode 100644
index 0000000..ed37f19
--- /dev/null
+++ b/mm/pixel-mm-legacy.rc
@@ -0,0 +1,40 @@
+#
+# 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.
+ # For legacy devices, only mm_event is using this trace instance.
+ # Debugfs is only used in legacy devices and going to be deprecated.
+ # If others want to put more,it should get hard review from pixel-perf-team.
+ mkdir /sys/kernel/debug/tracing/instances/pixel-trace 0755 system system
+ chown system system /sys/kernel/debug/tracing/instances/pixel-trace/trace
+ chmod 0660 /sys/kernel/debug/tracing/instances/pixel-trace/trace
+ chown system system /sys/kernel/debug/tracing/instances/pixel-trace/tracing_on
+ chmod 0660 /sys/kernel/debug/tracing/instances/pixel-trace/tracing_on
+ write /sys/kernel/debug/tracing/instances/pixel-trace/buffer_size_kb 64
+ write /sys/kernel/debug/tracing/instances/pixel-trace/events/mm_event/enable 1
+
+# turns off tracing right before bugreporting to keep more traces
+on property:init.svc.dumpstatez=running
+ write /d/tracing/instances/pixel-trace/tracing_on 0
+
+on property:init.svc.dumpstatez=stopped
+ write /d/tracing/instances/pixel-trace/tracing_on 1
+
+on property:init.svc.bugreport=running
+ write /d/tracing/instances/pixel-trace/tracing_on 0
+
+on property:init.svc.bugreport=stopped
+ write /d/tracing/instances/pixel-trace/tracing_on 1