summaryrefslogtreecommitdiff
path: root/libartbase/base/utils.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2025-02-13 10:59:59 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-13 10:59:59 -0800
commit35a8b07c110dcf75a0f74554d0d0ee343655abf8 (patch)
treecd0d59d26c1103bb210444d5207a947c31422dcd /libartbase/base/utils.cc
parent155f88b8911f293d0611fc9f9c76b1b67dd046f2 (diff)
parentb63a35a0495ea4beaa36aad7d81728daacee3be4 (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.cc12
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");