gs-common: Remove userdebug/eng configuration
Change-Id: Ie1e8b6bbebdfac97f8bc382e41c70cc8a32caf07
This commit is contained in:
parent
dc28234ecd
commit
22322941ea
61 changed files with 0 additions and 1115 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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)
|
||||
')
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/system_ext/bin/astc u:object_r:astd_exec:s0
|
||||
/system_ext/bin/astd u:object_r:astd_exec:s0
|
||||
|
|
@ -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)
|
||||
|
|
|
@ -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 += \
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -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 <dump/pixel_dump.h>
|
||||
//#include <android-base/properties.h>
|
||||
#include <android-base/file.h>
|
||||
|
||||
#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;
|
||||
}
|
|
@ -1,3 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bcmbt/dump/sepolicy/
|
||||
|
||||
PRODUCT_PACKAGES_ENG += dump_bcmbt
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -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 <dump/pixel_dump.h>
|
||||
#include <android-base/file.h>
|
||||
|
||||
#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;
|
||||
}
|
|
@ -1,3 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bluetooth/dump/sepolicy/
|
||||
|
||||
PRODUCT_PACKAGES_DEBUG += dump_bt
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 <android-base/file.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <dump/pixel_dump.h>
|
||||
|
||||
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;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"],
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -12,6 +12,3 @@ PRODUCT_PACKAGES += \
|
|||
bcm47765_gps_package \
|
||||
sitril-gps \
|
||||
android.hardware.location.gps.prebuilt.xml
|
||||
|
||||
PRODUCT_PACKAGES_ENG += \
|
||||
init.gps_log.rc
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -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 <android-base/file.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <dirent.h>
|
||||
#include <dump/pixel_dump.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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;
|
||||
}
|
|
@ -1,4 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/dump/sepolicy/
|
||||
|
||||
PRODUCT_PACKAGES_ENG += dump_gps
|
||||
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -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 <dump/pixel_dump.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/file.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -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 <unistd.h>
|
||||
#include <dump/pixel_dump.h>
|
||||
#include <android-base/file.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
')
|
|
@ -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;
|
||||
')
|
|
@ -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
|
|
@ -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;
|
||||
')
|
|
@ -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;
|
|
@ -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
|
|
@ -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
|
|
@ -1,5 +0,0 @@
|
|||
# Specific build for fingerprint
|
||||
PRODUCT_PACKAGES_ENG += \
|
||||
Gyotaku
|
||||
|
||||
BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/fingerprint
|
|
@ -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);
|
||||
')
|
|
@ -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
|
|
@ -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",
|
||||
}
|
|
@ -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 <dump/pixel_dump.h>
|
||||
|
||||
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;
|
||||
}
|
|
@ -1,3 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/led/sepolicy
|
||||
|
||||
PRODUCT_PACKAGES_ENG += dump_led
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
|
|
@ -1,4 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/radio/sepolicy/
|
||||
|
||||
PRODUCT_PACKAGES_ENG += dump_radio
|
||||
|
||||
|
|
|
@ -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 <dump/pixel_dump.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/file.h>
|
||||
|
||||
#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;
|
||||
}
|
|
@ -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",
|
||||
}
|
|
@ -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 <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/stringprintf.h>
|
||||
|
||||
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 <<EOF | gunzip\n");
|
||||
system(cmd.c_str());
|
||||
printf("EOF\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Dump items related to ramdump.
|
||||
int main() {
|
||||
setbuf(stdout, NULL);
|
||||
std::string abl_log;
|
||||
if (android::base::ReadFileToString("/mnt/vendor/ramdump/abl.log", &abl_log)) {
|
||||
const struct abl_log_header *header = (const struct abl_log_header*) abl_log.c_str();
|
||||
printf("------ Ramdump misc file: abl.log (i:0x%" PRIx64 " size:0x%" PRIx64 ") ------\n%s\n",
|
||||
header->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;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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"],
|
||||
|
|
|
@ -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 <dump/pixel_dump.h>
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <stdio.h>
|
||||
#include <log/log.h>
|
||||
|
||||
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<DIR, decltype(&closedir)> 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<DIR, decltype(&closedir)> 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<DIR, decltype(&closedir)> 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;
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/soc/sepolicy/soc
|
||||
|
||||
PRODUCT_PACKAGES += dump_soc
|
||||
PRODUCT_PACKAGES_ENG += dump_memory
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/touchinspector/sepolicy
|
||||
|
||||
PRODUCT_PACKAGES_ENG += TouchInspector
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -1,4 +1 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/wlan/sepolicy/
|
||||
|
||||
PRODUCT_PACKAGES_ENG += dump_wlan
|
||||
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
#include <dump/pixel_dump.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue