summaryrefslogtreecommitdiff
path: root/dumpstate
diff options
context:
space:
mode:
authorMichael Eastwood <mweastwood@google.com>2021-07-08 21:04:41 -0700
committerMichael Eastwood <mweastwood@google.com>2021-07-09 15:18:01 +0000
commit65e028b4285715fc92a909f0a526889727850283 (patch)
treeb567350adced71ae7b4e37e60e587313d42ce7b9 /dumpstate
parentd5fa4a5534fa46c47953d90eb902984bb16a3322 (diff)
downloadgs101-65e028b4285715fc92a909f0a526889727850283.tar.gz
Attach the latest .cpa file to bugreports.
* Latest is determined by alphabetical order * To find the .cpa file, unzip the bug report and run `tar -xvf dumpstate_board.bin` * The .cpa file can then be found under the `camera/` directory * This can be disabled with the prop `vendor.camera.debug.camera_performance_analyzer.attach_to_bugreport` Bug: 191169822 Test: `adb bugreport`, unzip, `tar -xvf dumpstate_board.bin`, find expected .cpa file Change-Id: Ie05e8d446588cebea46492b267491065161915a1
Diffstat (limited to 'dumpstate')
-rw-r--r--dumpstate/DumpstateDevice.cpp14
-rw-r--r--dumpstate/DumpstateDevice.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 802d223c..4d88c023 100644
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -205,6 +205,14 @@ void dumpGpsLogs(int fd, std::string destDir) {
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) {
android::base::WriteStringToFd(
"\n"
@@ -994,6 +1002,8 @@ static void *dumpModemThread(void *data) {
if (!PropertiesHelper::IsUserBuild()) {
bool gpsLogEnabled = android::base::GetBoolProperty(GPS_LOGGING_STATUS_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) {
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");
}
+ if (cameraLogsEnabled) {
+ dumpCameraLogs(STDOUT_FILENO, modemLogAllDir);
+ }
+
dumpLogs(STDOUT_FILENO, extendedLogDir, modemLogAllDir, 50, EXTENDED_LOG_PREFIX);
dumpRilLogs(STDOUT_FILENO, modemLogAllDir);
dumpNetmgrLogs(modemLogAllDir);
diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h
index 6424d9b4..74d0ce1e 100644
--- a/dumpstate/DumpstateDevice.h
+++ b/dumpstate/DumpstateDevice.h
@@ -30,13 +30,10 @@ namespace implementation {
using ::android::hardware::dumpstate::V1_1::DumpstateMode;
using ::android::hardware::dumpstate::V1_1::DumpstateStatus;
using ::android::hardware::dumpstate::V1_1::IDumpstateDevice;
-using ::android::hardware::hidl_array;
using ::android::hardware::hidl_handle;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::sp;
struct DumpstateDevice : public IDumpstateDevice {
public: