system/core
Revisão | fde5be585e9d01257aa484d2d36e932ad928da73 (tree) |
---|---|
Hora | 2019-06-13 12:05:27 |
Autor | android-build-team Robot <android-build-team-robot@goog...> |
Commiter | android-build-team Robot |
Snap for 5656431 from 702981f54fd3a891f42f3282497b7e73b74b350a to qt-qpr1-release
Change-Id: I81a430910471eedd7b7f375d5d7c9dd88069d810
@@ -150,6 +150,7 @@ SetCgroupAction::SetCgroupAction(const CgroupController& c, const std::string& p | ||
150 | 150 | } |
151 | 151 | |
152 | 152 | void SetCgroupAction::EnableResourceCaching() { |
153 | + std::lock_guard<std::mutex> lock(fd_mutex_); | |
153 | 154 | if (fd_ != FDS_NOT_CACHED) { |
154 | 155 | return; |
155 | 156 | } |
@@ -191,6 +192,7 @@ bool SetCgroupAction::AddTidToCgroup(int tid, int fd) { | ||
191 | 192 | } |
192 | 193 | |
193 | 194 | bool SetCgroupAction::ExecuteForProcess(uid_t uid, pid_t pid) const { |
195 | + std::lock_guard<std::mutex> lock(fd_mutex_); | |
194 | 196 | if (IsFdValid()) { |
195 | 197 | // fd is cached, reuse it |
196 | 198 | if (!AddTidToCgroup(pid, fd_)) { |
@@ -221,6 +223,7 @@ bool SetCgroupAction::ExecuteForProcess(uid_t uid, pid_t pid) const { | ||
221 | 223 | } |
222 | 224 | |
223 | 225 | bool SetCgroupAction::ExecuteForTask(int tid) const { |
226 | + std::lock_guard<std::mutex> lock(fd_mutex_); | |
224 | 227 | if (IsFdValid()) { |
225 | 228 | // fd is cached, reuse it |
226 | 229 | if (!AddTidToCgroup(tid, fd_)) { |
@@ -19,6 +19,7 @@ | ||
19 | 19 | #include <sys/cdefs.h> |
20 | 20 | #include <sys/types.h> |
21 | 21 | #include <map> |
22 | +#include <mutex> | |
22 | 23 | #include <string> |
23 | 24 | #include <vector> |
24 | 25 |
@@ -127,6 +128,7 @@ class SetCgroupAction : public ProfileAction { | ||
127 | 128 | CgroupController controller_; |
128 | 129 | std::string path_; |
129 | 130 | android::base::unique_fd fd_; |
131 | + mutable std::mutex fd_mutex_; | |
130 | 132 | |
131 | 133 | static bool IsAppDependentPath(const std::string& path); |
132 | 134 | static bool AddTidToCgroup(int tid, int fd); |
@@ -183,6 +183,7 @@ namespace.media.asan.permitted.paths = /apex/com.android.media/${LIB}/extractors | ||
183 | 183 | namespace.media.links = default |
184 | 184 | namespace.media.link.default.shared_libs = %LLNDK_LIBRARIES% |
185 | 185 | namespace.media.link.default.shared_libs += libbinder_ndk.so |
186 | +namespace.media.link.default.shared_libs += libcgrouprc.so | |
186 | 187 | namespace.media.link.default.shared_libs += libmediametrics.so |
187 | 188 | namespace.media.link.default.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% |
188 | 189 |