Merge "tipc-test: Allow tipc tests to be run as benchmarks" into main
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index 26726cf..0d4b91f 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -91,6 +91,15 @@
}
}
+ // unfreeze if pid is frozen.
+ const std::string freeze_file = android::base::StringPrintf(
+ "/sys/fs/cgroup/uid_%d/pid_%d/cgroup.freeze", proc_info.uid, proc_info.pid);
+ if (std::string freeze_status;
+ android::base::ReadFileToString(freeze_file, &freeze_status) && freeze_status[0] == '1') {
+ android::base::WriteStringToFile("0", freeze_file);
+ // we don't restore the frozen state as this is considered a benign change.
+ }
+
unique_fd output_fd(fcntl(STDOUT_FILENO, F_DUPFD_CLOEXEC, 0));
if (output_fd.get() == -1) {
err(1, "failed to fcntl dup stdout");
diff --git a/fs_mgr/fs_mgr_overlayfs_mount.cpp b/fs_mgr/fs_mgr_overlayfs_mount.cpp
index e168436..a1ec63b 100644
--- a/fs_mgr/fs_mgr_overlayfs_mount.cpp
+++ b/fs_mgr/fs_mgr_overlayfs_mount.cpp
@@ -98,7 +98,12 @@
if (mount_point.empty() || !android::base::Realpath(mount_point, &normalized_path)) {
return "";
}
- return android::base::StringReplace(normalized_path, "/", "@", true);
+ std::string_view sv(normalized_path);
+ if (sv != "/") {
+ android::base::ConsumePrefix(&sv, "/");
+ android::base::ConsumeSuffix(&sv, "/");
+ }
+ return android::base::StringReplace(sv, "/", "@", true);
}
static bool fs_mgr_is_dir(const std::string& path) {