diff --git a/aoc/aoc.mk b/aoc/aoc.mk index 4f07e1d..6a9a8ec 100644 --- a/aoc/aoc.mk +++ b/aoc/aoc.mk @@ -12,11 +12,3 @@ ifneq ($(wildcard vendor/google/whitechapel/aoc/aocx/aidl/aocx/framework_compati DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \ vendor/google/whitechapel/aoc/aocx/aidl/aocx/framework_compatibility_matrix.xml endif - -# AoC debug support -PRODUCT_PACKAGES_ENG += \ - aocdump \ - aocutil \ - aoc_audio_cfg \ - vp_util \ - aocx_tool diff --git a/aoc/conf/init.aoc.nodaemon.rc b/aoc/conf/init.aoc.nodaemon.rc deleted file mode 100644 index 329d7d3..0000000 --- a/aoc/conf/init.aoc.nodaemon.rc +++ /dev/null @@ -1,3 +0,0 @@ -# Load AoC firmware and boot -on property:vendor.all.modules.ready=1 - write /sys/devices/platform/19000000.aoc/firmware aoc.bin \ No newline at end of file diff --git a/astd/astd.mk b/astd/astd.mk deleted file mode 100644 index 0dfa4f9..0000000 --- a/astd/astd.mk +++ /dev/null @@ -1,9 +0,0 @@ -# This module is only for factory targets, please include this makefile -# with check: -# -# ifneq ($(filter factory_%,$(TARGET_PRODUCT)),) -# include device/google/gs-common/astd/astd.mk -# endif -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/astd/sepolicy - -PRODUCT_PACKAGES_DEBUG += astd diff --git a/astd/sepolicy/astd.te b/astd/sepolicy/astd.te deleted file mode 100644 index 815e832..0000000 --- a/astd/sepolicy/astd.te +++ /dev/null @@ -1,10 +0,0 @@ -# astd service -type astd, domain; -type astd_exec, exec_type, file_type, system_file_type; - -typeattribute astd coredomain; - -userdebug_or_eng(` - init_daemon_domain(astd) -') - diff --git a/astd/sepolicy/file_contexts b/astd/sepolicy/file_contexts deleted file mode 100644 index 17ac54c..0000000 --- a/astd/sepolicy/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ -/system_ext/bin/astc u:object_r:astd_exec:s0 -/system_ext/bin/astd u:object_r:astd_exec:s0 - diff --git a/audio/aidl.mk b/audio/aidl.mk index 68458dd..016f33b 100644 --- a/audio/aidl.mk +++ b/audio/aidl.mk @@ -31,11 +31,4 @@ PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_SYSTEM_EXT_PROPERTIES += \ ro.audio.ihaladaptervendorextension_enabled=true -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) -$(call soong_config_set,aoc_audio_func,dump_usecase_data,true) -$(call soong_config_set,aoc_audio_func,hal_socket_control,true) -$(call soong_config_set,aoc_audio_func,record_tuning_keys,true) -$(call soong_config_set,aoc_audio_func,aidl_command_interface,true) -endif - $(call soong_config_set,pixel_audio_hal_type,aidl_build,true) diff --git a/battery_mitigation/bcl.mk b/battery_mitigation/bcl.mk index 28276a6..62838c2 100644 --- a/battery_mitigation/bcl.mk +++ b/battery_mitigation/bcl.mk @@ -1,11 +1,6 @@ ifeq (,$(filter factory_%,$(TARGET_PRODUCT))) PRODUCT_PACKAGES += battery_mitigation endif -ifneq (,$(filter eng, $(TARGET_BUILD_VARIANT))) -ifeq (,$(filter factory_%,$(TARGET_PRODUCT))) -PRODUCT_PACKAGES += BrownoutDetection -endif -endif ifeq ($(RELEASE_PIXEL_AIDL_BATTERY_MITIGATION_HAL), true) PRODUCT_PROPERTY_OVERRIDES += \ diff --git a/bcmbt/dump/Android.bp b/bcmbt/dump/Android.bp deleted file mode 100644 index c22d559..0000000 --- a/bcmbt/dump/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_bcmbt", - srcs: ["dump_bcmbt.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/bcmbt/dump/dump_bcmbt.cpp b/bcmbt/dump/dump_bcmbt.cpp deleted file mode 100644 index 22e2fcf..0000000 --- a/bcmbt/dump/dump_bcmbt.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2023 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 -//#include -#include - -#define BCMBT_ACTIVITY_LOG_DIRECTORY "/data/vendor/bluetooth" -#define BCMBT_SNOOP_LOG_DIRECTORY "/data/vendor/bluetooth" -#define BCMBT_FW_LOG_DIRECTORY "/data/vendor/ssrdump/coredump" -#define BCMBT_SNOOP_LOG_PREFIX "btsnoop_hci_vnd" -#define BCMBT_BACKUP_SNOOP_LOG_PREFIX "backup_btsnoop_hci_vnd" -#define BCMBT_FW_DUMP_LOG_PREFIX "coredump_bt_socdump_" -#define BCMBT_CHRE_DUMP_LOG_PREFIX "coredump_bt_chredump_" -#define BCMBT_HAL_DUMP_LOG_PREFIX "coredump_bt_" -#define BCMBT_ACTIVITY_LOG_PREFIX "bt_activity_" - -int main() { - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "bcmbt"); - if (mkdir(outputDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - - dumpLogs(BCMBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 4, - BCMBT_SNOOP_LOG_PREFIX); - dumpLogs(BCMBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, BCMBT_BACKUP_SNOOP_LOG_PREFIX); - dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_FW_DUMP_LOG_PREFIX); - dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_CHRE_DUMP_LOG_PREFIX); - dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_HAL_DUMP_LOG_PREFIX); - dumpLogs(BCMBT_ACTIVITY_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_ACTIVITY_LOG_PREFIX); - return 0; -} diff --git a/bcmbt/dump/dumplog.mk b/bcmbt/dump/dumplog.mk index 7789695..9c4a8e7 100644 --- a/bcmbt/dump/dumplog.mk +++ b/bcmbt/dump/dumplog.mk @@ -1,3 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bcmbt/dump/sepolicy/ - -PRODUCT_PACKAGES_ENG += dump_bcmbt diff --git a/betterbug/betterbug.mk b/betterbug/betterbug.mk index bc88898..adfde01 100644 --- a/betterbug/betterbug.mk +++ b/betterbug/betterbug.mk @@ -1,7 +1,6 @@ # When neither AOSP nor factory targets ifeq (,$(filter aosp_% factory_% lineage_%, $(TARGET_PRODUCT))) PRODUCT_PACKAGES += BetterBugStub - PRODUCT_PACKAGES_DEBUG += $(RELEASE_PACKAGE_BETTER_BUG) endif PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/betterbug/sepolicy/product/public diff --git a/bluetooth/dump/Android.bp b/bluetooth/dump/Android.bp deleted file mode 100644 index 72e83b4..0000000 --- a/bluetooth/dump/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_bt", - srcs: ["dump.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/bluetooth/dump/dump.cpp b/bluetooth/dump/dump.cpp deleted file mode 100644 index db92c3c..0000000 --- a/bluetooth/dump/dump.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2023 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 -#include - -#define PIXELBT_ACTIVITY_LOG_DIRECTORY "/data/vendor/bluetooth" -#define PIXELBT_SNOOP_LOG_DIRECTORY "/data/vendor/bluetooth" -#define PIXELBT_FW_LOG_DIRECTORY "/data/vendor/ssrdump/coredump" -#define PIXELBT_SNOOP_LOG_PREFIX "btsnoop_hci_vnd" -#define PIXELBT_BACKUP_SNOOP_LOG_PREFIX "backup_btsnoop_hci_vnd" -#define PIXELBT_FW_DUMP_LOG_PREFIX "coredump_bt_socdump_" -#define PIXELBT_CHRE_DUMP_LOG_PREFIX "coredump_bt_chredump_" -#define PIXELBT_HAL_DUMP_LOG_PREFIX "coredump_bt_" -#define PIXELBT_ACTIVITY_LOG_PREFIX "bt_activity_" - -int main() { - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "bt"); - if (mkdir(outputDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - - dumpLogs(PIXELBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 4, - PIXELBT_SNOOP_LOG_PREFIX); - dumpLogs(PIXELBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, PIXELBT_BACKUP_SNOOP_LOG_PREFIX); - dumpLogs(PIXELBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_FW_DUMP_LOG_PREFIX); - dumpLogs(PIXELBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_CHRE_DUMP_LOG_PREFIX); - dumpLogs(PIXELBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_HAL_DUMP_LOG_PREFIX); - dumpLogs(PIXELBT_ACTIVITY_LOG_DIRECTORY, outputDir.c_str(), 10, PIXELBT_ACTIVITY_LOG_PREFIX); - return 0; -} diff --git a/bluetooth/dump/dumplog.mk b/bluetooth/dump/dumplog.mk index 51c3b3c..2f1944e 100644 --- a/bluetooth/dump/dumplog.mk +++ b/bluetooth/dump/dumplog.mk @@ -1,3 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bluetooth/dump/sepolicy/ - -PRODUCT_PACKAGES_DEBUG += dump_bt diff --git a/camera/Android.bp b/camera/Android.bp index 17f152f..063173f 100644 --- a/camera/Android.bp +++ b/camera/Android.bp @@ -2,23 +2,6 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -cc_binary { - name: "dump_camera", - srcs: ["dump_camera.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} - prebuilt_etc { name: "lyric_preview_dis_xml", vendor: true, diff --git a/camera/dump.mk b/camera/dump.mk index af8c5ca..922e76a 100644 --- a/camera/dump.mk +++ b/camera/dump.mk @@ -1,6 +1,3 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/vendor PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/product/public PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/product/private - -PRODUCT_PACKAGES_ENG += dump_camera - diff --git a/camera/dump_camera.cpp b/camera/dump_camera.cpp deleted file mode 100644 index 6aa3414..0000000 --- a/camera/dump_camera.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 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 -#include -#include - -namespace { - -constexpr std::string_view kCameraLogDir = "/data/vendor/camera/profiler"; -constexpr std::string_view kGraphStateDumpDir = "/data/vendor/camera"; - -} // namespace - -int main() { - if (!::android::base::GetBoolProperty( - "vendor.camera.debug.camera_performance_analyzer.attach_to_bugreport", - true)) { - return 0; - } - - const std::string cameraDestDir = - concatenatePath(BUGREPORT_PACKING_DIR, "camera"); - - if (mkdir(cameraDestDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", cameraDestDir.c_str()); - return 0; - } - - // Attach multiple latest sessions (in case the user is running concurrent - // sessions or starts a new session after the one with performance issues). - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 10, "session-ended-"); - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 10, "multicam-"); - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "high-drop-rate-"); - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "watchdog-"); - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "camera-ended-"); - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "fatal-error-"); - dumpLogs(kGraphStateDumpDir.data(), cameraDestDir.c_str(), 5, - "hal_graph_state_"); - dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 10, - "fd_state_tracker-"); - - return 0; -} diff --git a/camera/lyric.mk b/camera/lyric.mk index 5d78b69..cc046ed 100644 --- a/camera/lyric.mk +++ b/camera/lyric.mk @@ -70,7 +70,3 @@ DEVICE_MATRIX_FILE += \ # sepolicy dir is added in dump.mk. # Make doesn't deduplicate sepolicy dirs, so including it here causes build errors. - -# Calibration tools for debug builds -PRODUCT_PACKAGES_DEBUG += tarasque_test -PRODUCT_PACKAGES_DEBUG += ProtoCalibGenerator diff --git a/dauntless/gsc.mk b/dauntless/gsc.mk index 7e89cb4..9e1898a 100644 --- a/dauntless/gsc.mk +++ b/dauntless/gsc.mk @@ -14,13 +14,6 @@ PRODUCT_PACKAGES += \ android.hardware.security.keymint-service.citadel \ dump_gsc.sh -# USERDEBUG ONLY: Install test packages -PRODUCT_PACKAGES_ENG += citadel_integration_tests \ - pwntest \ - nugget_targeted_tests \ - CitadelProvision \ - nugget_aidl_test_weaver - # Assign default value for RELEASE_GOOGLE_DAUNTLESS_DIR if no trunk flags support RELEASE_GOOGLE_DAUNTLESS_DIR ?= vendor/google_nos/prebuilts/dauntless diff --git a/display/Android.bp b/display/Android.bp index 1a90b51..cd6739b 100644 --- a/display/Android.bp +++ b/display/Android.bp @@ -2,13 +2,6 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -sh_binary { - name: "dump_display_userdebug.sh", - src: "common/dump_display_userdebug.sh", - vendor: true, - sub_dir: "dump", -} - cc_binary { name: "dump_exynos_display", srcs: ["exynos/dump_display.cpp"], diff --git a/display/common/dump_display_userdebug.sh b/display/common/dump_display_userdebug.sh deleted file mode 100644 index 84b7311..0000000 --- a/display/common/dump_display_userdebug.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/vendor/bin/sh -display_trace_path="/sys/kernel/tracing/instances/pixel-display/trace" -echo "------ Display Trace ($display_trace_path)------" -cat $display_trace_path - -echo "------ HWC Fence States ------" -for f in $(ls /data/vendor/log/hwc/*_hwc_fence_state*.txt) -do - echo $f - cat $f -done - -echo "------ HWC Error Logs ------" -for f in $(ls /data/vendor/log/hwc/*_hwc_error_log*.txt) -do - echo $f - cat $f -done - -echo "------ HWC Debug Dumps ------" -for f in $(ls /data/vendor/log/hwc/*_hwc_debug*.dump) -do - echo $f - cat $f -done - diff --git a/display/dump_exynos_display.mk b/display/dump_exynos_display.mk index d20ba9d..2770d14 100644 --- a/display/dump_exynos_display.mk +++ b/display/dump_exynos_display.mk @@ -1,4 +1,3 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy/exynos -PRODUCT_PACKAGES_DEBUG += dump_display_userdebug.sh PRODUCT_PACKAGES += dump_exynos_display diff --git a/display/dump_pixel_display.mk b/display/dump_pixel_display.mk index f8ba633..e43865b 100644 --- a/display/dump_pixel_display.mk +++ b/display/dump_pixel_display.mk @@ -1,4 +1,3 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy/pixel -PRODUCT_PACKAGES_ENG += dump_display_userdebug.sh PRODUCT_PACKAGES += dump_pixel_display diff --git a/gps/brcm/device.mk b/gps/brcm/device.mk index d1c432e..9f094ab 100644 --- a/gps/brcm/device.mk +++ b/gps/brcm/device.mk @@ -12,6 +12,3 @@ PRODUCT_PACKAGES += \ bcm47765_gps_package \ sitril-gps \ android.hardware.location.gps.prebuilt.xml - -PRODUCT_PACKAGES_ENG += \ - init.gps_log.rc diff --git a/gps/dump/Android.bp b/gps/dump/Android.bp deleted file mode 100644 index 1f66882..0000000 --- a/gps/dump/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_gps", - srcs: ["dump_gps.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/gps/dump/dump_gps.cpp b/gps/dump/dump_gps.cpp deleted file mode 100644 index c2d65c8..0000000 --- a/gps/dump/dump_gps.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2022 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 -#include -#include -#include -#include -#include -#include - -#define GPS_LOG_NUMBER_PROPERTY "persist.vendor.gps.aol.log_num" -#define GPS_LOG_DIRECTORY "/data/vendor/gps/logs" -#define GPS_RESOURCE_DIRECTORY "/data/vendor/gps/resource" -#define GPS_TMP_LOG_DIRECTORY "/data/vendor/gps/logs/.tmp" -#define GPS_LOG_PREFIX "gl-" -#define GPS_MCU_LOG_PREFIX "esw-" -#define GPS_MALLOC_LOG_DIRECTORY "/data/vendor/gps" -#define GPS_MALLOC_LOG_PREFIX "malloc_" -#define GPS_VENDOR_CHIP_INFO "/data/vendor/gps/chip.info" -#define GPS_RAWLOG_PREFIX "rawbin" -#define GPS_MEMDUMP_LOG_PREFIX "memdump_" - -static void copyDirectory(const std::string &source, - const std::string &outputDir) { - DIR *dir = opendir(source.c_str()); - if (dir == nullptr) { - return; - } - struct stat st; - if (!(stat(outputDir.c_str(), &st) == 0 && S_ISDIR(st.st_mode)) && - mkdir(outputDir.c_str(), 0777) == -1) { - closedir(dir); - return; - } - - struct dirent *entry; - while ((entry = readdir(dir)) != nullptr) { - std::string entryName = entry->d_name; - if (entryName == "." || entryName == "..") { - continue; - } - - std::string sourcePath = source + "/" + entryName; - std::string destPath = outputDir + "/" + entryName; - if (stat(sourcePath.c_str(), &st) == 0) { - if (S_ISDIR(st.st_mode)) - copyDirectory(sourcePath, destPath); - else - copyFile(sourcePath.c_str(), destPath.c_str()); - } - } - closedir(dir); - return; -} - -int compareFileExtensions(const struct dirent **a, const struct dirent **b) { - int num_a, num_b; - sscanf((*a)->d_name, "rawbinlog.out.%d", &num_a); - sscanf((*b)->d_name, "rawbinlog.out.%d", &num_b); - - return num_a - num_b; -} - -void dumpLogsAscending(const char* SrcDir, const char* DestDir, int limit, const char* prefix) { - - struct dirent **dirent_list = NULL; - int num_entries = scandir(SrcDir, &dirent_list, 0, (int (*)(const struct dirent **, const struct dirent **)) alphasort); - if (!dirent_list) { - printf("Unable to scan dir: %s.\n", SrcDir); - return; - } else if (num_entries <= 0) { - printf("No file is found.\n"); - return; - } - - if (access(DestDir, R_OK)) { - printf("Unable to find folder: %s\n", DestDir); - return; - } - - qsort(dirent_list, num_entries, sizeof(struct dirent *), (int (*)(const void *, const void *)) compareFileExtensions); - - int copiedFiles = 0; - - for (int i = 0 ; i < num_entries; i++) { - - if (0 != strncmp(dirent_list[i]->d_name, prefix, strlen(prefix))) { - continue; - } - - if ((copiedFiles >= limit) && (limit != -1)) { - printf("Skipped %s\n", dirent_list[i]->d_name); - continue; - } - - copiedFiles++; - copyFile(concatenatePath(SrcDir, dirent_list[i]->d_name).c_str(), concatenatePath(DestDir, dirent_list[i]->d_name).c_str()); - } - - while (num_entries--) { - free(dirent_list[num_entries]); - } - - free(dirent_list); - return; -} - -void deleteRecursively(const char* dest_dir) { - struct dirent **dirent_list; - int num_entries = scandir(dest_dir, &dirent_list, 0, alphasort); - if (num_entries < 0) { - printf("Unable to scan dir: %s.\n", dest_dir); - return; - } - - for (int i = 0; i < num_entries; i++) { - char path[1024]; - snprintf(path, sizeof(path), "%s/%s", dest_dir, dirent_list[i]->d_name); - - if (strcmp(dirent_list[i]->d_name, ".") == 0 || strcmp(dirent_list[i]->d_name, "..") == 0) { - free(dirent_list[i]); - continue; - } - - struct stat statbuf; - if (stat(path, &statbuf) == 0) { - if (S_ISDIR(statbuf.st_mode)) { - deleteRecursively(path); - } else { - printf("Delete %s\n", path); - if (unlink(path) != 0) { - printf("Unable to delete file: %s\n", path); - } - } - } else { - printf("Unable to get file status: %s\n", path); - } - free(dirent_list[i]); - } - - free(dirent_list); - - if (rmdir(dest_dir) != 0) { - printf("Unable to delete directory: %s\n", dest_dir); - } -} - -int main() { - if(!::android::base::GetBoolProperty("vendor.gps.aol.enabled", false)) { - printf("vendor.gps.aol.enabled is false. gps logging is not running.\n"); - return 0; - } - int maxFileNum = ::android::base::GetIntProperty(GPS_LOG_NUMBER_PROPERTY, 20); - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "gps"); - - struct stat statbuf; - if (stat(outputDir.c_str(), &statbuf) == 0) { - printf("Directory %s already exists, delete\n", outputDir.c_str()); - deleteRecursively(outputDir.c_str()); - } - if (mkdir(outputDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - if (!::android::base::GetBoolProperty("vendor.gps.aol.collect.thinmd", - false)) { - printf("vendor.gps.aol.collect.thinmd is false. Collecting fils as " - "legacy Pixel.\n"); - dumpLogs(GPS_TMP_LOG_DIRECTORY, outputDir.c_str(), 1, GPS_LOG_PREFIX); - dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 3, GPS_MCU_LOG_PREFIX); - dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), maxFileNum, - GPS_LOG_PREFIX); - dumpLogs(GPS_MALLOC_LOG_DIRECTORY, outputDir.c_str(), 1, - GPS_MALLOC_LOG_PREFIX); - dumpLogsAscending(GPS_LOG_DIRECTORY, outputDir.c_str(), 5, - GPS_RAWLOG_PREFIX); - dumpLogs(GPS_LOG_DIRECTORY, outputDir.c_str(), 18, - GPS_MEMDUMP_LOG_PREFIX); - } else { - printf("vendor.gps.aol.collect.thinmd is true. Collecting fils as thin " - "modem.\n"); - copyDirectory(GPS_LOG_DIRECTORY, outputDir.c_str()); - } - if (access(GPS_VENDOR_CHIP_INFO, F_OK) == 0) { - copyFile(GPS_VENDOR_CHIP_INFO, - concatenatePath(outputDir.c_str(), "chip.info").c_str()); - } - copyDirectory(GPS_RESOURCE_DIRECTORY, concatenatePath(outputDir.c_str(), "resource")); - return 0; -} diff --git a/gps/dump/log.mk b/gps/dump/log.mk index 71c218f..c8f47c8 100644 --- a/gps/dump/log.mk +++ b/gps/dump/log.mk @@ -1,4 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/dump/sepolicy/ - -PRODUCT_PACKAGES_ENG += dump_gps - diff --git a/gxp/Android.bp b/gxp/Android.bp deleted file mode 100644 index f3683fc..0000000 --- a/gxp/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_gxp", - srcs: ["dump_gxp.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/gxp/dump_gxp.cpp b/gxp/dump_gxp.cpp deleted file mode 100644 index 5d9f28a..0000000 --- a/gxp/dump_gxp.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2022 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 -#include -#include - -#define maxGxpDebugDumps 4 - -int main() { - /* TODO(b/277094681): Set default value to false around device beta milestone. */ - /* TODO(b/288368306): Create an android property for enabling/disabling - * bugreport collection for gxp */ - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "gxp_ssrdump"); - printf("Creating %s", outputDir.c_str()); - if (mkdir(outputDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - - dumpLogs("/data/vendor/ssrdump/coredump", outputDir.c_str(), maxGxpDebugDumps, "coredump_gxp_"); - dumpLogs("/data/vendor/ssrdump", outputDir.c_str(), maxGxpDebugDumps, "crashinfo_gxp_"); - return 0; -} - diff --git a/gxp/gxp.mk b/gxp/gxp.mk index 2249537..dec616e 100644 --- a/gxp/gxp.mk +++ b/gxp/gxp.mk @@ -6,8 +6,5 @@ PRODUCT_PACKAGES += \ gxp_metrics_logger # GXP C-API library PRODUCT_PACKAGES += libgxp -# GXP Debug dump. -PRODUCT_PACKAGES_ENG += dump_gxp BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gxp/sepolicy - diff --git a/gyotaku_app/dump/Android.bp b/gyotaku_app/dump/Android.bp deleted file mode 100644 index 0f62d0a..0000000 --- a/gyotaku_app/dump/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_gyotaku", - srcs: ["dump_gyotaku.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/gyotaku_app/dump/dump_gyotaku.cpp b/gyotaku_app/dump/dump_gyotaku.cpp deleted file mode 100644 index 0f22e68..0000000 --- a/gyotaku_app/dump/dump_gyotaku.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 -#include -#include - -#define GYOTAKU_DIRECTORY "/data/vendor/gyotaku/andlog" -#define GYOTAKU_ANDROID_LOG_PREFIX "android_" -#define GYOTAKU_ODPM_LOG_PREFIX "odpm_" -#define maxFileLogsNumber 30 - -int main() { - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "gyotaku"); - if (mkdir(outputDir.c_str(), 0700) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - - dumpLogs(GYOTAKU_DIRECTORY, outputDir.c_str(), maxFileLogsNumber, GYOTAKU_ANDROID_LOG_PREFIX); - dumpLogs(GYOTAKU_DIRECTORY, outputDir.c_str(), maxFileLogsNumber, GYOTAKU_ODPM_LOG_PREFIX); - return 0; -} - diff --git a/gyotaku_app/dump/dump_gyotaku.te b/gyotaku_app/dump/dump_gyotaku.te deleted file mode 100644 index 8c1727f..0000000 --- a/gyotaku_app/dump/dump_gyotaku.te +++ /dev/null @@ -1,11 +0,0 @@ -pixel_bugreport(dump_gyotaku) - -userdebug_or_eng(` - # For access and collecting logs into vendor radio type folder. - allow dump_gyotaku radio_vendor_data_file:dir create_dir_perms; - allow dump_gyotaku radio_vendor_data_file:file create_file_perms; - - # For access /data/vendor/ folder. - allow dump_gyotaku gyotaku_vendor_data_file:dir create_dir_perms; - allow dump_gyotaku gyotaku_vendor_data_file:file create_file_perms; -') diff --git a/gyotaku_app/dump/file.te b/gyotaku_app/dump/file.te deleted file mode 100644 index 8035955..0000000 --- a/gyotaku_app/dump/file.te +++ /dev/null @@ -1,5 +0,0 @@ -# For /data/vendor use -type gyotaku_vendor_data_file, file_type, data_file_type; -userdebug_or_eng(` - typeattribute gyotaku_vendor_data_file mlstrustedobject; -') diff --git a/gyotaku_app/dump/file_contexts b/gyotaku_app/dump/file_contexts deleted file mode 100644 index 3a16a00..0000000 --- a/gyotaku_app/dump/file_contexts +++ /dev/null @@ -1,4 +0,0 @@ -/data/vendor/gyotaku(/.*)? u:object_r:gyotaku_vendor_data_file:s0 - -# Pixel dump for Gyotaku -/vendor/bin/dump/dump_gyotaku u:object_r:dump_gyotaku_exec:s0 diff --git a/gyotaku_app/dump/gyotaku_app.te b/gyotaku_app/dump/gyotaku_app.te deleted file mode 100644 index 6816080..0000000 --- a/gyotaku_app/dump/gyotaku_app.te +++ /dev/null @@ -1,5 +0,0 @@ -userdebug_or_eng(` - # For access /data/vendor/gyotaku folder - allow gyotaku_app gyotaku_vendor_data_file:dir create_dir_perms; - allow gyotaku_app gyotaku_vendor_data_file:file create_file_perms; -') diff --git a/gyotaku_app/fingerprint/gyotaku_app.te b/gyotaku_app/fingerprint/gyotaku_app.te deleted file mode 100644 index f6475f5..0000000 --- a/gyotaku_app/fingerprint/gyotaku_app.te +++ /dev/null @@ -1,19 +0,0 @@ -# Specific build for fingerprint -type gyotaku_app, domain; - -app_domain(gyotaku_app) -net_domain(gyotaku_app) - -# For Gyotaku app common use -allow gyotaku_app app_api_service:service_manager find; -allow gyotaku_app privapp_data_file:lnk_file read; -allow gyotaku_app system_app_data_file:dir create_dir_perms; -allow gyotaku_app system_app_data_file:file create_file_perms; - -# For getproperty isDebuggable use -get_prop(gyotaku_app, userdebug_or_eng_prop) - -# For access /data/vendor/misc fingerprint use. -allow gyotaku_app vendor_misc_data_file:dir search; -allow gyotaku_app vendor_fingerprint_data_file:dir r_dir_perms; -allow gyotaku_app vendor_fingerprint_data_file:file r_file_perms; diff --git a/gyotaku_app/fingerprint/seapp_contexts b/gyotaku_app/fingerprint/seapp_contexts deleted file mode 100644 index b1c6248..0000000 --- a/gyotaku_app/fingerprint/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Gyotaku app -user=system seinfo=platform name=com.google.android.apps.internal.gyotaku domain=gyotaku_app type=system_app_data_file levelFrom=all diff --git a/gyotaku_app/gyotaku.mk b/gyotaku_app/gyotaku.mk deleted file mode 100644 index daad1f6..0000000 --- a/gyotaku_app/gyotaku.mk +++ /dev/null @@ -1,14 +0,0 @@ -ifneq ($(TARGET_BUILD_VARIANT), user) - ifeq (,$(filter aosp_% lineage_%, $(TARGET_PRODUCT))) # Skip aosp target product - PRODUCT_PACKAGES_DEBUG += \ - Gyotaku - - BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/sepolicy/ - - # Pixel 5a (barbet) does not support Pixel dump - ifeq (,$(filter barbet%,$(TARGET_PRODUCT))) - PRODUCT_PACKAGES_DEBUG += dump_gyotaku - BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/dump - endif - endif -endif diff --git a/gyotaku_app/gyotaku_fingerprint.mk b/gyotaku_app/gyotaku_fingerprint.mk deleted file mode 100644 index 91a386d..0000000 --- a/gyotaku_app/gyotaku_fingerprint.mk +++ /dev/null @@ -1,5 +0,0 @@ -# Specific build for fingerprint -PRODUCT_PACKAGES_ENG += \ - Gyotaku - -BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/fingerprint diff --git a/gyotaku_app/sepolicy/gyotaku_app.te b/gyotaku_app/sepolicy/gyotaku_app.te deleted file mode 100644 index 867ec4c..0000000 --- a/gyotaku_app/sepolicy/gyotaku_app.te +++ /dev/null @@ -1,28 +0,0 @@ -type gyotaku_app, domain; - -userdebug_or_eng(` - app_domain(gyotaku_app) - net_domain(gyotaku_app) - - # For Gyotaku app common use - allow gyotaku_app app_api_service:service_manager find; - allow gyotaku_app privapp_data_file:lnk_file read; - allow gyotaku_app system_app_data_file:dir create_dir_perms; - allow gyotaku_app system_app_data_file:file create_file_perms; - - # For access /proc/fs/f2fs/* storage use - allow gyotaku_app proc_f2fs:dir search; - allow gyotaku_app proc_f2fs:file r_file_perms; - - # For access /proc/stat use - allow gyotaku_app proc_stat:file r_file_perms; - - # For getproperty isDebuggable use - get_prop(gyotaku_app, userdebug_or_eng_prop) - - # For persistent property use - get_prop(gyotaku_app, logpersistd_logging_prop); - - # For access hal_power_stats - hal_client_domain(gyotaku_app, hal_power_stats); -') diff --git a/gyotaku_app/sepolicy/seapp_contexts b/gyotaku_app/sepolicy/seapp_contexts deleted file mode 100644 index b1c6248..0000000 --- a/gyotaku_app/sepolicy/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Gyotaku app -user=system seinfo=platform name=com.google.android.apps.internal.gyotaku domain=gyotaku_app type=system_app_data_file levelFrom=all diff --git a/led/Android.bp b/led/Android.bp deleted file mode 100644 index 6e15ac5..0000000 --- a/led/Android.bp +++ /dev/null @@ -1,18 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_led", - srcs: ["dump_led.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/led/dump_led.cpp b/led/dump_led.cpp deleted file mode 100644 index 7ce4846..0000000 --- a/led/dump_led.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2022 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 - -int main() { - dumpFileContent("Green LED Brightness", "/sys/class/leds/green/brightness"); - dumpFileContent("Green LED Max Brightness", "/sys/class/leds/green/max_brightness"); - dumpFileContent("LED Calibration Data", "/mnt/vendor/persist/led/led_calibration_LUT.txt"); - return 0; -} diff --git a/led/led.mk b/led/led.mk index d367042..2b7cb6c 100644 --- a/led/led.mk +++ b/led/led.mk @@ -1,3 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/led/sepolicy - -PRODUCT_PACKAGES_ENG += dump_led diff --git a/pixel_ril/ril.mk b/pixel_ril/ril.mk index 3cc468a..a57d678 100644 --- a/pixel_ril/ril.mk +++ b/pixel_ril/ril.mk @@ -9,8 +9,6 @@ DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/pixel_ril/co PRODUCT_PACKAGES += ril-extension -PRODUCT_PACKAGES_ENG += libgooglerilmemmonitor - PRODUCT_SOONG_NAMESPACES += \ vendor/google/tools/ril-extension-service \ vendor/google/tools/ril-mem-monitor diff --git a/radio/Android.bp b/radio/Android.bp deleted file mode 100644 index 29b0f16..0000000 --- a/radio/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_radio", - srcs: ["dump_radio.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} - diff --git a/radio/dump.mk b/radio/dump.mk index c25c1e2..fef7974 100644 --- a/radio/dump.mk +++ b/radio/dump.mk @@ -1,4 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/radio/sepolicy/ - -PRODUCT_PACKAGES_ENG += dump_radio - diff --git a/radio/dump_radio.cpp b/radio/dump_radio.cpp deleted file mode 100644 index 3ee90f0..0000000 --- a/radio/dump_radio.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2022 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 -#include -#include - -#define RIL_LOG_DIRECTORY "/data/vendor/radio" -#define RIL_LOG_DIRECTORY_PROPERTY "persist.vendor.ril.log.base_dir" -#define RIL_LOG_NUMBER_PROPERTY "persist.vendor.ril.log.num_file" -#define RIL_LOG_PREFIX "rild.log." - -#define TCPDUMP_LOG_DIRECTORY "/data/vendor/tcpdump_logger/logs" -#define TCPDUMP_NUMBER_BUGREPORT "persist.vendor.tcpdump.log.br_num" -#define TCPDUMP_PERSIST_PROPERTY "persist.vendor.tcpdump.log.alwayson" -#define TCPDUMP_LOG_PREFIX "tcpdump" - -int main() { - // netmgr - bool tcpdumpEnabled = ::android::base::GetBoolProperty(TCPDUMP_PERSIST_PROPERTY, false); - - if (tcpdumpEnabled) { - dumpLogs(TCPDUMP_LOG_DIRECTORY, BUGREPORT_PACKING_DIR, ::android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX); - } - copyFile("/data/vendor/radio/adum_log", "/data/vendor/radio/logs/always-on/all_logs/adum_log"); - copyFile("/data/vendor/radio/adum_log_old", "/data/vendor/radio/logs/always-on/all_logs/adum_log_old"); - copyFile("/data/vendor/radio/metrics_data", "/data/vendor/radio/logs/always-on/all_logs/metrics_data"); - copyFile("/data/vendor/radio/omadm_logs.txt", "/data/vendor/radio/logs/always-on/all_logs/omadm_logs.txt"); - copyFile("/data/vendor/radio/power_anomaly_data.txt", "/data/vendor/radio/logs/always-on/all_logs/power_anomaly_data.txt"); - - // RIL dump - std::string rilLogDir = ::android::base::GetProperty(RIL_LOG_DIRECTORY_PROPERTY, RIL_LOG_DIRECTORY); - - int maxFileNum = ::android::base::GetIntProperty(RIL_LOG_NUMBER_PROPERTY, 50); - - const std::string currentLogDir = concatenatePath(rilLogDir.c_str(), "/cur"); - const std::string previousLogDir = concatenatePath(rilLogDir.c_str(), "/prev"); - const std::string currentDestDir = concatenatePath(BUGREPORT_PACKING_DIR, "cur"); - const std::string previousDestDir = concatenatePath(BUGREPORT_PACKING_DIR, "prev"); - if (mkdir(currentDestDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", currentDestDir.c_str()); - return 0; - } - if (mkdir(previousDestDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", previousDestDir.c_str()); - return 0; - } - - dumpLogs(currentLogDir.c_str(), currentDestDir.c_str(), maxFileNum, RIL_LOG_PREFIX); - dumpLogs(previousLogDir.c_str(), previousDestDir.c_str(), maxFileNum, RIL_LOG_PREFIX); - return 0; -} diff --git a/ramdump_and_coredump/Android.bp b/ramdump_and_coredump/Android.bp deleted file mode 100644 index 928a677..0000000 --- a/ramdump_and_coredump/Android.bp +++ /dev/null @@ -1,16 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_ramdump", - srcs: ["dump_ramdump.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: ["libbase"], - vendor: true, - relative_install_path: "dump", -} diff --git a/ramdump_and_coredump/dump_ramdump.cpp b/ramdump_and_coredump/dump_ramdump.cpp deleted file mode 100644 index 4be0c0c..0000000 --- a/ramdump_and_coredump/dump_ramdump.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 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 -#include -#include -#include -#include - -struct abl_log_header { - uint64_t i; - uint64_t size; - char buf[]; -} __attribute__((packed)); - -// Gzip binary data and dump in base64 format. Cmd to decode is also attached. -void dumpGzippedFileInBase64(const char* title, const char* file_path) { - auto cmd = android::base::StringPrintf("gzip < %s | base64", file_path); - printf("------ %s, %s\n", title, cmd.c_str()); - printf("base64 -d <i, header->size, std::string(header->buf, header->i).c_str()); - } else { - printf("*** Ramdump misc file: abl.log: File not found\n"); - } - - dumpGzippedFileInBase64("Ramdump misc file: acpm.lst (gzipped in base64)", "/mnt/vendor/ramdump/acpm.lst"); - dumpGzippedFileInBase64("Ramdump misc file: s2d.lst (gzipped in base64)", "/mnt/vendor/ramdump/s2d.lst"); - return 0; -} diff --git a/ramdump_and_coredump/ramdump_and_coredump.mk b/ramdump_and_coredump/ramdump_and_coredump.mk index 3ccc019..3df9fd3 100644 --- a/ramdump_and_coredump/ramdump_and_coredump.mk +++ b/ramdump_and_coredump/ramdump_and_coredump.mk @@ -1,14 +1,9 @@ PRODUCT_PACKAGES += \ sscoredump \ -PRODUCT_PACKAGES_ENG += \ - dump_ramdump \ - ramdump \ - # When neither AOSP nor factory targets ifeq (,$(filter aosp_% factory_% lineage_%, $(TARGET_PRODUCT))) PRODUCT_PACKAGES += SSRestartDetector - PRODUCT_PACKAGES_DEBUG += RamdumpUploader endif BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/ramdump_and_coredump/sepolicy diff --git a/soc/Android.bp b/soc/Android.bp index 43e9202..e81f567 100644 --- a/soc/Android.bp +++ b/soc/Android.bp @@ -2,23 +2,6 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -cc_binary { - name: "dump_memory", - srcs: ["dump_memory.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} - cc_binary { name: "dump_devfreq", srcs: ["dump_devfreq.cpp"], diff --git a/soc/dump_memory.cpp b/soc/dump_memory.cpp deleted file mode 100644 index 1528f73..0000000 --- a/soc/dump_memory.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2022 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 - -#include -#include -#include - -char* concat(char* result, const char* one, const char* two){ - strcpy(result, one); - strcat(result, two); - return result; -} - -void iterate(const char* path){ - dirent *entry, *entry2; - char result[100], base[100]; - - std::unique_ptr ion(opendir(path), closedir); - if (!ion) { - ALOGE("Fail To Open Dir %s", path); - return; - } - while ((entry = readdir(ion.get())) != nullptr) { - if(entry->d_name[0] == '.') { - continue; - } - strcpy(base, path); - strcat(base, entry->d_name); - strcat(base, "/"); - std::unique_ptr ion2(opendir(base), closedir); - if (!ion2) { - ALOGE("Fail To Open Dir %s\n", base); - return; - } - while ((entry2 = readdir(ion2.get())) != nullptr) { - if(entry2->d_name[0] == '.') { - continue; - } - dumpFileContent(entry2->d_name, concat(result, base, entry2->d_name)); - } - } - return; -} - -// Dump memory. -int main() { - dirent *entry; - char result[100]; - - printf("------ ION HEAPS ------\n"); - iterate("/d/ion/"); - - dumpFileContent("dmabuf info", "/d/dma_buf/bufinfo"); - dumpFileContent("Page Pinner - longterm pin", "/sys/kernel/debug/page_pinner/buffer"); - - printf("------ CMA info ------\n"); - std::unique_ptr cmadebug(opendir("/sys/kernel/debug/cma/"), closedir); - if (!cmadebug) { - ALOGE("Fail To Open Dir /sys/kernel/debug/cma/"); - } else { - while ((entry = readdir(cmadebug.get())) != nullptr) { - if(entry->d_name[0] == '.') { - continue; - } - dumpFileContent("count", concat(result, concat(result, "/sys/kernel/debug/cma/", entry->d_name), "/count")); - dumpFileContent("used", concat(result, concat(result, "/sys/kernel/debug/cma/", entry->d_name), "/used")); - dumpFileContent("bitmap", concat(result, concat(result, "/sys/kernel/debug/cma/", entry->d_name), "/bitmap")); - } - } - - printf("------ Pixel CMA stat ------\n"); - iterate("/sys/kernel/pixel_stat/mm/cma/"); - - dumpFileContent("Pixel Trace", "/sys/kernel/tracing/instances/pixel/trace"); - return 0; -} - diff --git a/soc/soc.mk b/soc/soc.mk index 10541cd..05618f1 100644 --- a/soc/soc.mk +++ b/soc/soc.mk @@ -1,5 +1,3 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/soc/sepolicy/soc PRODUCT_PACKAGES += dump_soc -PRODUCT_PACKAGES_ENG += dump_memory - diff --git a/storage/storage.mk b/storage/storage.mk index 511e515..72330a0 100644 --- a/storage/storage.mk +++ b/storage/storage.mk @@ -3,8 +3,3 @@ BOARD_VENDOR_SEPOLICY_DIRS += \ device/google/gs-common/storage/sepolicy/tracking_denials PRODUCT_PACKAGES += dump_storage - -# Pixel storage tool -PRODUCT_PACKAGES_ENG += \ - sg_write_buffer \ - sg_read_buffer diff --git a/thermal/thermal_hal/device.mk b/thermal/thermal_hal/device.mk index 50959a7..0d696e9 100644 --- a/thermal/thermal_hal/device.mk +++ b/thermal/thermal_hal/device.mk @@ -3,7 +3,4 @@ PRODUCT_PACKAGES += android.hardware.thermal-service.pixel # Thermal utils PRODUCT_PACKAGES += thermal_symlinks -# Thermal logd -PRODUCT_PACKAGES_ENG += thermal_logd - BOARD_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy/thermal_hal diff --git a/touch/touchinspector/touchinspector.mk b/touch/touchinspector/touchinspector.mk index e3bb67e..040802c 100644 --- a/touch/touchinspector/touchinspector.mk +++ b/touch/touchinspector/touchinspector.mk @@ -1,3 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/touchinspector/sepolicy - -PRODUCT_PACKAGES_ENG += TouchInspector diff --git a/wlan/Android.bp b/wlan/Android.bp deleted file mode 100644 index d8103e5..0000000 --- a/wlan/Android.bp +++ /dev/null @@ -1,18 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_wlan", - srcs: ["dump_wlan.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/wlan/dump.mk b/wlan/dump.mk index 23c75cb..d0c8b53 100644 --- a/wlan/dump.mk +++ b/wlan/dump.mk @@ -1,4 +1 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/wlan/sepolicy/ - -PRODUCT_PACKAGES_ENG += dump_wlan - diff --git a/wlan/dump_wlan.cpp b/wlan/dump_wlan.cpp deleted file mode 100644 index 86d3fc7..0000000 --- a/wlan/dump_wlan.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 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 -#include - -int main() { - //This line is required to avoid output out of order - //setbuf(stdout, NULL); - dumpFileContent("WLAN FW Log Symbol Table", "/vendor/firmware/Data.msc"); - //runCommand("WLAN TWT Dump", "cat /sys/wlan_ptracker/twt/*"); - return 0; -} -