servicemanager: include caller info in logs
In cases like b/329039146, it can be difficult to understand
where spam is coming from, because we only have the logs.
This adds caller information to servicemanager logs, so that
we can easily identify what is causing an issue, even if we
don't have logs.
Btw - passing around a calling context like this, instead of
referencing thread locals, is how I think we should do all
ACL with binder, but that's another story.
Example log output:
03-27 00:32:02.242 0 0 I servicemanager: Caller(pid=2145,uid=1001,sid=u:r:radio:s0) Found android.hardware.radio.data.IRadioData/slot1 in device VINTF manifest.
Bug: N/A
Test: N/A
Change-Id: Iea45e4d22f28f28592eb73a129117204c6c8e814
diff --git a/cmds/servicemanager/Access.h b/cmds/servicemanager/Access.h
index 77c2cd4..4ee9b90 100644
--- a/cmds/servicemanager/Access.h
+++ b/cmds/servicemanager/Access.h
@@ -36,6 +36,8 @@
pid_t debugPid;
uid_t uid;
std::string sid;
+
+ std::string toDebugString() const;
};
virtual CallingContext getCallingContext();