summaryrefslogtreecommitdiff
path: root/libperfmgr/FileNode.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libperfmgr/FileNode.cc')
-rw-r--r--libperfmgr/FileNode.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libperfmgr/FileNode.cc b/libperfmgr/FileNode.cc
index bc2b8a67..060b3090 100644
--- a/libperfmgr/FileNode.cc
+++ b/libperfmgr/FileNode.cc
@@ -19,6 +19,7 @@
#include <android-base/chrono_utils.h>
#include <android-base/file.h>
#include <android-base/logging.h>
+#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
@@ -33,7 +34,7 @@ FileNode::FileNode(std::string name, std::string node_path,
bool hold_fd)
: Node(std::move(name), std::move(node_path), std::move(req_sorted),
default_val_index, reset_on_init),
- hold_fd_(hold_fd) {
+ hold_fd_(hold_fd), warn_timeout_(android::base::GetBoolProperty("ro.debuggable", false) ? 5ms : 50ms) {
if (reset_on_init) {
Update(false);
}
@@ -79,7 +80,7 @@ std::chrono::milliseconds FileNode::Update(bool log_error) {
fd_.reset();
}
auto duration = t.duration();
- if (duration > 50ms) {
+ if (duration > warn_timeout_) {
LOG(WARNING) << "Slow writing to file: '" << node_path_
<< "' with value: '" << req_value
<< "' took: " << duration.count() << " ms";