align user experience on Android bug tool
Bug: 255250616 Test: adb shell dumpsys android.hardware.dumpstate.IDumpstateDevice/default wlan Change-Id: Ibefd8f9fff91cf6ece1f09dd6b207b6f9c97df4d
This commit is contained in:
parent
c4a7543d1f
commit
082bb51497
1 changed files with 19 additions and 10 deletions
|
@ -246,6 +246,7 @@ Dumpstate::Dumpstate()
|
||||||
// if the specified section is not supported.
|
// if the specified section is not supported.
|
||||||
void Dumpstate::dumpTextSection(int fd, const std::string §ionName) {
|
void Dumpstate::dumpTextSection(int fd, const std::string §ionName) {
|
||||||
bool dumpAll = (sectionName == kAllSections);
|
bool dumpAll = (sectionName == kAllSections);
|
||||||
|
std::string dumpFiles;
|
||||||
|
|
||||||
for (const auto §ion : mTextSections) {
|
for (const auto §ion : mTextSections) {
|
||||||
if (dumpAll || sectionName == section.first) {
|
if (dumpAll || sectionName == section.first) {
|
||||||
|
@ -259,22 +260,29 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute all programs under vendor/bin/dump/
|
// Execute all or designated programs under vendor/bin/dump/
|
||||||
std::unique_ptr<DIR, decltype(&closedir)> dir(opendir("/vendor/bin/dump"), closedir);
|
std::unique_ptr<DIR, decltype(&closedir)> dir(opendir("/vendor/bin/dump"), closedir);
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
ALOGE("Fail To Open Dir vendor/bin/dump/");
|
ALOGE("Fail To Open Dir vendor/bin/dump/");
|
||||||
} else {
|
::android::base::WriteStringToFd("Fail To Open Dir vendor/bin/dump/\n", fd);
|
||||||
dirent *entry;
|
return;
|
||||||
while ((entry = readdir(dir.get())) != nullptr) {
|
}
|
||||||
|
dirent *entry;
|
||||||
|
while ((entry = readdir(dir.get())) != nullptr) {
|
||||||
// Skip '.', '..'
|
// Skip '.', '..'
|
||||||
if (entry->d_name[0] == '.') {
|
if (entry->d_name[0] == '.') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string bin(entry->d_name);
|
std::string bin(entry->d_name);
|
||||||
auto startTime = startSection(fd, "/vendor/bin/dump/"+bin);
|
dumpFiles = dumpFiles + " " + bin;
|
||||||
RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin});
|
if (dumpAll || sectionName == bin) {
|
||||||
endSection(fd, "/vendor/bin/dump/"+bin, startTime);
|
auto startTime = startSection(fd, bin);
|
||||||
}
|
RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin});
|
||||||
|
endSection(fd, bin, startTime);
|
||||||
|
if (!dumpAll) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dumpAll) {
|
if (dumpAll) {
|
||||||
|
@ -287,6 +295,7 @@ void Dumpstate::dumpTextSection(int fd, const std::string §ionName) {
|
||||||
for (const auto §ion : mTextSections) {
|
for (const auto §ion : mTextSections) {
|
||||||
::android::base::WriteStringToFd(" " + section.first, fd);
|
::android::base::WriteStringToFd(" " + section.first, fd);
|
||||||
}
|
}
|
||||||
|
::android::base::WriteStringToFd(dumpFiles, fd);
|
||||||
::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. modem) are"
|
::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. modem) are"
|
||||||
"not avalable from the command line.\n", fd);
|
"not avalable from the command line.\n", fd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue