Snap for 12651823 from 6e5b6a6998
to 25Q1-release
Change-Id: I83b12f35c4e0867ffba20a3bb4e7069a8dcf0d57
This commit is contained in:
commit
5e59303ad4
9 changed files with 76 additions and 1 deletions
|
@ -1,5 +1,4 @@
|
||||||
# GCANext and GCAEng.
|
# GCANext and GCAEng.
|
||||||
# b/363018500
|
|
||||||
typeattribute debug_camera_app coredomain;
|
typeattribute debug_camera_app coredomain;
|
||||||
|
|
||||||
userdebug_or_eng(`
|
userdebug_or_eng(`
|
||||||
|
|
21
mailbox/Android.bp
Normal file
21
mailbox/Android.bp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package {
|
||||||
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_binary {
|
||||||
|
name: "dump_mailbox",
|
||||||
|
srcs: ["dump/dump_mailbox.cpp"],
|
||||||
|
init_rc: ["init.mailbox.rc"],
|
||||||
|
cflags: [
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Werror",
|
||||||
|
],
|
||||||
|
shared_libs: [
|
||||||
|
"libbase",
|
||||||
|
"libdump",
|
||||||
|
"liblog",
|
||||||
|
],
|
||||||
|
vendor: true,
|
||||||
|
relative_install_path: "dump",
|
||||||
|
}
|
32
mailbox/dump/dump_mailbox.cpp
Normal file
32
mailbox/dump/dump_mailbox.cpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 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.
|
||||||
|
*/
|
||||||
|
#include <dump/pixel_dump.h>
|
||||||
|
#include <android-base/file.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "mailbox");
|
||||||
|
if (mkdir(outputDir.c_str(), 0777) == -1) {
|
||||||
|
printf("Unable to create folder: %s\n", outputDir.c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
copyFile("/sys/kernel/tracing/instances/goog_cpm_mailbox/trace",
|
||||||
|
concatenatePath(outputDir.c_str(), "goog_cpm_mailbox_trace").c_str());
|
||||||
|
copyFile("/sys/kernel/tracing/instances/goog_nq_mailbox/trace",
|
||||||
|
concatenatePath(outputDir.c_str(), "goog_nq_mailbox_trace").c_str());
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
7
mailbox/dump/sepolicy/dump_mailbox.te
Normal file
7
mailbox/dump/sepolicy/dump_mailbox.te
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#
|
||||||
|
pixel_bugreport(dump_mailbox)
|
||||||
|
allow dump_mailbox radio_vendor_data_file:dir create_dir_perms;
|
||||||
|
allow dump_mailbox radio_vendor_data_file:file create_file_perms;
|
||||||
|
allow dump_mailbox debugfs_tracing_instances:file r_file_perms;
|
||||||
|
allow dump_mailbox debugfs_tracing_instances:dir search;
|
||||||
|
allow dump_mailbox debugfs_tracing_instances_mailbox:file r_file_perms;
|
2
mailbox/dump/sepolicy/file.te
Normal file
2
mailbox/dump/sepolicy/file.te
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#
|
||||||
|
type debugfs_tracing_instances_mailbox, sysfs_type, fs_type;
|
1
mailbox/dump/sepolicy/file_contexts
Normal file
1
mailbox/dump/sepolicy/file_contexts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/vendor/bin/dump/dump_mailbox u:object_r:dump_mailbox_exec:s0
|
2
mailbox/dump/sepolicy/genfs_contexts
Normal file
2
mailbox/dump/sepolicy/genfs_contexts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
genfscon tracefs /instances/goog_cpm_mailbox/trace u:object_r:debugfs_tracing_instances_mailbox:s0
|
||||||
|
genfscon tracefs /instances/goog_nq_mailbox/trace u:object_r:debugfs_tracing_instances_mailbox:s0
|
8
mailbox/init.mailbox.rc
Normal file
8
mailbox/init.mailbox.rc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
on property:sys.boot_completed=1
|
||||||
|
chown system system /sys/kernel/tracing/instances/goog_cpm_mailbox
|
||||||
|
chown system system /sys/kernel/tracing/instances/goog_cpm_mailbox/trace
|
||||||
|
write /sys/kernel/tracing/instances/goog_cpm_mailbox/buffer_size_kb 512
|
||||||
|
|
||||||
|
chown system system /sys/kernel/tracing/instances/goog_nq_mailbox
|
||||||
|
chown system system /sys/kernel/tracing/instances/goog_nq_mailbox/trace
|
||||||
|
write /sys/kernel/tracing/instances/goog_nq_mailbox/buffer_size_kb 512
|
3
mailbox/mailbox.mk
Normal file
3
mailbox/mailbox.mk
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/mailbox/dump/sepolicy
|
||||||
|
|
||||||
|
PRODUCT_PACKAGES += dump_mailbox
|
Loading…
Add table
Add a link
Reference in a new issue