summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2018-08-28 13:48:08 -0700
committerJosh Gao <jmgao@google.com>2018-08-28 13:48:08 -0700
commit8808f6c1c9925cc1e075a325445947ceba4c3559 (patch)
tree6eb42162a46c702f79f3d3d53a0dd9c53c925211 /debuggerd
parentbf06a40a0d8e61f2926bca9a645126fe46990051 (diff)
downloadsystem_core-8808f6c1c9925cc1e075a325445947ceba4c3559.tar.gz
system_core-8808f6c1c9925cc1e075a325445947ceba4c3559.tar.bz2
system_core-8808f6c1c9925cc1e075a325445947ceba4c3559.zip
libdebuggerd: decode fdsan owner tags.
Test: debuggerd `pidof system_server` | grep " fd " Change-Id: Ic4bb30b8602acf5912e776a61825d9645ec93c65
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/libdebuggerd/open_files_list.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/debuggerd/libdebuggerd/open_files_list.cpp b/debuggerd/libdebuggerd/open_files_list.cpp
index 03e4e8e3c..743a2e775 100644
--- a/debuggerd/libdebuggerd/open_files_list.cpp
+++ b/debuggerd/libdebuggerd/open_files_list.cpp
@@ -18,6 +18,7 @@
#include "libdebuggerd/open_files_list.h"
+#include <android/fdsan.h>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
@@ -122,8 +123,10 @@ void dump_open_files_list(log_t* log, const OpenFilesList& files, const char* pr
const std::optional<std::string>& path = entry.path;
const std::optional<uint64_t>& fdsan_owner = entry.fdsan_owner;
if (path && fdsan_owner) {
- _LOG(log, logtype::OPEN_FILES, "%sfd %i: %s (owned by %#" PRIx64 ")\n", prefix, fd,
- path->c_str(), *fdsan_owner);
+ const char* type = android_fdsan_get_tag_type(*fdsan_owner);
+ uint64_t value = android_fdsan_get_tag_value(*fdsan_owner);
+ _LOG(log, logtype::OPEN_FILES, "%sfd %i: %s (owned by %s %#" PRIx64 ")\n", prefix, fd,
+ path->c_str(), type, value);
} else if (path && !fdsan_owner) {
_LOG(log, logtype::OPEN_FILES, "%sfd %i: %s (unowned)\n", prefix, fd, path->c_str());
} else if (!path && fdsan_owner) {