Revert "Dumpsys also includes service PIDs."
This reverts commit f5ea44ccc038d29eb953ce504e490528f7d46a30.
Reason for revert: Breaking suite/test-mapping-presubmit-retry_cloud-tf
which is expecting a different format.
Fixes: 141728094
Bug: 141187318
Change-Id: Ie71999d3099ec5bf9017f2a2631fb58249d5ca30
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index 68b3907..4811927 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -236,13 +236,11 @@
return 0;
}
- const bool dumpPid = !asProto;
-
for (size_t i = 0; i < N; i++) {
const String16& serviceName = services[i];
if (IsSkipped(skippedServices, serviceName)) continue;
- if (startDumpThread(serviceName, dumpPid, args) == OK) {
+ if (startDumpThread(serviceName, args) == OK) {
bool addSeparator = (N > 1);
if (addSeparator) {
writeDumpHeader(STDOUT_FILENO, serviceName, priorityFlags);
@@ -309,7 +307,7 @@
}
}
-status_t Dumpsys::startDumpThread(const String16& serviceName, bool dumpPid, const Vector<String16>& args) {
+status_t Dumpsys::startDumpThread(const String16& serviceName, const Vector<String16>& args) {
sp<IBinder> service = sm_->checkService(serviceName);
if (service == nullptr) {
aerr << "Can't find service: " << serviceName << endl;
@@ -329,20 +327,7 @@
// dump blocks until completion, so spawn a thread..
activeThread_ = std::thread([=, remote_end{std::move(remote_end)}]() mutable {
- if (dumpPid) {
- pid_t pid;
- status_t status = service->getDebugPid(&pid);
- if (status == OK) {
- std::ostringstream pidinfo;
- pidinfo << "Pid: " << pid << std::endl;
- WriteStringToFd(pidinfo.str(), remote_end.get());
- } else {
- aerr << "Error getting pid status_t (" << status << "): "
- << serviceName << endl;
- }
- }
-
- status_t err = service->dump(remote_end.get(), args);
+ int err = service->dump(remote_end.get(), args);
// It'd be nice to be able to close the remote end of the socketpair before the dump
// call returns, to terminate our reads if the other end closes their copy of the
@@ -350,8 +335,8 @@
// way to do this, though.
remote_end.reset();
- if (err != OK) {
- aerr << "Error dumping service info status_t (" << err << "): "
+ if (err != 0) {
+ aerr << "Error dumping service info: (" << strerror(err) << ") "
<< serviceName << endl;
}
});