Loading libs/binder/IPCThreadState.cpp +28 −0 Original line number Original line Diff line number Diff line Loading @@ -14,10 +14,13 @@ * limitations under the License. * limitations under the License. */ */ #define LOG_TAG "IPCThreadState" #include <binder/IPCThreadState.h> #include <binder/IPCThreadState.h> #include <binder/Binder.h> #include <binder/Binder.h> #include <binder/BpBinder.h> #include <binder/BpBinder.h> #include <cutils/sched_policy.h> #include <utils/Debug.h> #include <utils/Debug.h> #include <utils/Log.h> #include <utils/Log.h> #include <utils/TextOutput.h> #include <utils/TextOutput.h> Loading Loading @@ -418,7 +421,32 @@ void IPCThreadState::joinThreadPool(bool isMain) alog << "Processing top-level Command: " alog << "Processing top-level Command: " << getReturnString(cmd) << endl; << getReturnString(cmd) << endl; } } bool isTainted = false; { SchedPolicy policy; get_sched_policy(getpid(), &policy); if (policy == SP_BACKGROUND) { isTainted = true; } } result = executeCommand(cmd); result = executeCommand(cmd); // Make sure that after executing the commands that we put the thread back into the // default cgroup. { int pid = getpid(); SchedPolicy policy; get_sched_policy(pid, &policy); if (!isTainted && policy == SP_BACKGROUND) { LOGW("*** THREAD %p (PID %p) was left in SP_BACKGROUND with a priority of %d\n", (void*)pthread_self(), pid, getpriority(PRIO_PROCESS, pid)); } } } } // Let this thread exit the thread pool if it is no longer // Let this thread exit the thread pool if it is no longer Loading Loading
libs/binder/IPCThreadState.cpp +28 −0 Original line number Original line Diff line number Diff line Loading @@ -14,10 +14,13 @@ * limitations under the License. * limitations under the License. */ */ #define LOG_TAG "IPCThreadState" #include <binder/IPCThreadState.h> #include <binder/IPCThreadState.h> #include <binder/Binder.h> #include <binder/Binder.h> #include <binder/BpBinder.h> #include <binder/BpBinder.h> #include <cutils/sched_policy.h> #include <utils/Debug.h> #include <utils/Debug.h> #include <utils/Log.h> #include <utils/Log.h> #include <utils/TextOutput.h> #include <utils/TextOutput.h> Loading Loading @@ -418,7 +421,32 @@ void IPCThreadState::joinThreadPool(bool isMain) alog << "Processing top-level Command: " alog << "Processing top-level Command: " << getReturnString(cmd) << endl; << getReturnString(cmd) << endl; } } bool isTainted = false; { SchedPolicy policy; get_sched_policy(getpid(), &policy); if (policy == SP_BACKGROUND) { isTainted = true; } } result = executeCommand(cmd); result = executeCommand(cmd); // Make sure that after executing the commands that we put the thread back into the // default cgroup. { int pid = getpid(); SchedPolicy policy; get_sched_policy(pid, &policy); if (!isTainted && policy == SP_BACKGROUND) { LOGW("*** THREAD %p (PID %p) was left in SP_BACKGROUND with a priority of %d\n", (void*)pthread_self(), pid, getpriority(PRIO_PROCESS, pid)); } } } } // Let this thread exit the thread pool if it is no longer // Let this thread exit the thread pool if it is no longer Loading