diff options
| author | 2025-02-13 10:59:59 -0800 | |
|---|---|---|
| committer | 2025-02-13 10:59:59 -0800 | |
| commit | 35a8b07c110dcf75a0f74554d0d0ee343655abf8 (patch) | |
| tree | cd0d59d26c1103bb210444d5207a947c31422dcd /libartbase/base/utils.cc | |
| parent | 155f88b8911f293d0611fc9f9c76b1b67dd046f2 (diff) | |
| parent | b63a35a0495ea4beaa36aad7d81728daacee3be4 (diff) | |
Extend suspend timeout for debug activities am: 4bcbbe50ab am: b63a35a049
Original change: https://android-review.googlesource.com/c/platform/art/+/3463910
Change-Id: I0ce959085b814157e74b0fb00d74468639d89aa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libartbase/base/utils.cc')
| -rw-r--r-- | libartbase/base/utils.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc index e77d37d29b..efb727f950 100644 --- a/libartbase/base/utils.cc +++ b/libartbase/base/utils.cc @@ -424,6 +424,18 @@ std::string GetOsThreadStatQuick(pid_t tid) { #endif } +char GetStateFromStatString(const std::string& stat_output) { + size_t rparen_pos = stat_output.find(")"); + if (rparen_pos == std::string::npos || rparen_pos >= stat_output.length() - 3) { + return '?'; + } + size_t state_pos = stat_output.find_first_not_of(" ", rparen_pos + 1); + if (rparen_pos == std::string::npos) { + return '?'; + } + return stat_output[state_pos]; +} + std::string GetOtherThreadOsStats() { #if defined(__linux__) DIR* dir = opendir("/proc/self/task"); |