summaryrefslogtreecommitdiff
path: root/dumpstate
diff options
context:
space:
mode:
authorKevin Jeon <kevinjeon@google.com>2022-11-08 18:24:12 +0000
committerKevin Jeon <kevinjeon@google.com>2022-11-10 15:32:59 +0000
commit2381ca7f30607ea99e666a9322e665116498fbce (patch)
tree8e2ae0b9d9c7ff6a538b2f8021af4ae25cc2ea8e /dumpstate
parentb4ee8b12eb363cb971647f23f182b51f392fd47f (diff)
downloadgs201-2381ca7f30607ea99e666a9322e665116498fbce.tar.gz
Add tracepoints to gs201 dumpstateBoard
This change adds tracepoints for the gs201 implementation of dumpstateBoard. This is intended to help identify long-running sections. Test: Build+flash, check that traces of 'adb bugreportz' show the expected trace sections. Bug: 258228821 Change-Id: Ia8f64f63609533eaaec1e78a93c1f67947d82466
Diffstat (limited to 'dumpstate')
-rw-r--r--dumpstate/Dumpstate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp
index e10524b..e42e187 100644
--- a/dumpstate/Dumpstate.cpp
+++ b/dumpstate/Dumpstate.cpp
@@ -15,6 +15,7 @@
*/
#define LOG_TAG "dumpstate_device"
+#define ATRACE_TAG ATRACE_TAG_ALWAYS
#include <inttypes.h>
@@ -22,6 +23,7 @@
#include <android-base/stringprintf.h>
#include <android-base/properties.h>
#include <android-base/unique_fd.h>
+#include <cutils/trace.h>
#include <log/log.h>
#include <sys/stat.h>
@@ -187,6 +189,7 @@ void dumpModemEFS(std::string destDir) {
}
timepoint_t startSection(int fd, const std::string &sectionName) {
+ ATRACE_BEGIN(sectionName.c_str());
::android::base::WriteStringToFd(
"\n"
"------ Section start: " + sectionName + " ------\n"
@@ -195,6 +198,7 @@ timepoint_t startSection(int fd, const std::string &sectionName) {
}
void endSection(int fd, const std::string &sectionName, timepoint_t startTime) {
+ ATRACE_END();
auto endTime = std::chrono::steady_clock::now();
auto elapsedMsec = std::chrono::duration_cast<std::chrono::milliseconds>
(endTime - startTime).count();
@@ -1149,6 +1153,7 @@ void Dumpstate::dumpLogSection(int fd, int fd_bin)
ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds,
IDumpstateDevice::DumpstateMode in_mode,
int64_t in_timeoutMillis) {
+ ATRACE_BEGIN("dumpstateBoard");
// Unused arguments.
(void) in_timeoutMillis;
@@ -1185,6 +1190,7 @@ ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFile
dumpTextSection(fd, kAllSections);
+ ATRACE_END();
return ndk::ScopedAStatus::ok();
}