Attach the latest .cpa file to bugreports. am: 78d3928543 am: cb6bdc1e33

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101/+/15241340

Change-Id: Ic02935d4e5baa0bd0c97e38e1a22628b9d81a539
This commit is contained in:
Michael Eastwood 2021-07-09 15:45:19 +00:00 committed by Automerger Merge Worker
commit a2daae2323
2 changed files with 14 additions and 3 deletions

View file

@ -205,6 +205,14 @@ void dumpGpsLogs(int fd, std::string destDir) {
dumpLogs(fd, gpsLogDir, gpsDestDir, maxFileNum, GPS_LOG_PREFIX); dumpLogs(fd, gpsLogDir, gpsDestDir, maxFileNum, GPS_LOG_PREFIX);
} }
void dumpCameraLogs(int fd, const std::string &destDir) {
static const std::string kCameraLogDir = "/data/vendor/camera/profiler";
const std::string cameraDestDir = destDir + "/camera";
RunCommandToFd(fd, "MKDIR CAMERA LOG", {"/vendor/bin/mkdir", "-p", cameraDestDir.c_str()},
CommandOptions::WithTimeout(2).Build());
dumpLogs(fd, kCameraLogDir, cameraDestDir, 1, "session-ended-");
}
timepoint_t startSection(int fd, const std::string &sectionName) { timepoint_t startSection(int fd, const std::string &sectionName) {
android::base::WriteStringToFd( android::base::WriteStringToFd(
"\n" "\n"
@ -994,6 +1002,8 @@ static void *dumpModemThread(void *data) {
if (!PropertiesHelper::IsUserBuild()) { if (!PropertiesHelper::IsUserBuild()) {
bool gpsLogEnabled = android::base::GetBoolProperty(GPS_LOGGING_STATUS_PROPERTY, false); bool gpsLogEnabled = android::base::GetBoolProperty(GPS_LOGGING_STATUS_PROPERTY, false);
bool tcpdumpEnabled = android::base::GetBoolProperty(TCPDUMP_PERSIST_PROPERTY, false); bool tcpdumpEnabled = android::base::GetBoolProperty(TCPDUMP_PERSIST_PROPERTY, false);
bool cameraLogsEnabled = android::base::GetBoolProperty(
"vendor.camera.debug.camera_performance_analyzer.attach_to_bugreport", true);
if (tcpdumpEnabled) { if (tcpdumpEnabled) {
dumpLogs(STDOUT_FILENO, tcpdumpLogDir, modemLogAllDir, android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX); dumpLogs(STDOUT_FILENO, tcpdumpLogDir, modemLogAllDir, android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX);
@ -1005,6 +1015,10 @@ static void *dumpModemThread(void *data) {
ALOGD("gps logging is not running\n"); ALOGD("gps logging is not running\n");
} }
if (cameraLogsEnabled) {
dumpCameraLogs(STDOUT_FILENO, modemLogAllDir);
}
dumpLogs(STDOUT_FILENO, extendedLogDir, modemLogAllDir, 50, EXTENDED_LOG_PREFIX); dumpLogs(STDOUT_FILENO, extendedLogDir, modemLogAllDir, 50, EXTENDED_LOG_PREFIX);
dumpRilLogs(STDOUT_FILENO, modemLogAllDir); dumpRilLogs(STDOUT_FILENO, modemLogAllDir);
dumpNetmgrLogs(modemLogAllDir); dumpNetmgrLogs(modemLogAllDir);

View file

@ -30,13 +30,10 @@ namespace implementation {
using ::android::hardware::dumpstate::V1_1::DumpstateMode; using ::android::hardware::dumpstate::V1_1::DumpstateMode;
using ::android::hardware::dumpstate::V1_1::DumpstateStatus; using ::android::hardware::dumpstate::V1_1::DumpstateStatus;
using ::android::hardware::dumpstate::V1_1::IDumpstateDevice; using ::android::hardware::dumpstate::V1_1::IDumpstateDevice;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_handle; using ::android::hardware::hidl_handle;
using ::android::hardware::hidl_string; using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec; using ::android::hardware::hidl_vec;
using ::android::hardware::Return; using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
struct DumpstateDevice : public IDumpstateDevice { struct DumpstateDevice : public IDumpstateDevice {
public: public: