lshal: Add option to print cmd lines instead of pids.
Add -m to arguments of lshal. When this flag is set,
/proc/{pid}/cmdline is printed instead of a plain PID.
If the file doesn't exist, it will be striped out from
the PID column as well (the process is considered died
and won't hold a reference to the binder object.)
Test: lshal -icm
Bug: 35160832
Change-Id: I4345bf06112a1f87ce91bec6f6f787703e46cd17
diff --git a/cmds/lshal/TableEntry.h b/cmds/lshal/TableEntry.h
index 864b41b..4ec3a0c 100644
--- a/cmds/lshal/TableEntry.h
+++ b/cmds/lshal/TableEntry.h
@@ -32,8 +32,10 @@
std::string interfaceName;
std::string transport;
int32_t serverPid;
+ std::string serverCmdline;
uint64_t serverObjectAddress;
Pids clientPids;
+ std::vector<std::string> clientCmdlines;
static bool sortByInterfaceName(const TableEntry &a, const TableEntry &b) {
return a.interfaceName < b.interfaceName;