From c7395ef269b9d570aefe2559b3d4ad1e4d74ce76 Mon Sep 17 00:00:00 2001 From: Yunju Lee Date: Thu, 27 Jul 2023 20:50:59 +0000 Subject: libperfmgr: Add write-only option Add `WriteOnly` option in configuration file to avoid reading a write-only node in `DumpToFd`. Bug: 291237127 Change-Id: I0ac2eecefb2e0c2f71de47fce7835d14930e34ee --- power-libperfmgr/libperfmgr/include/perfmgr/FileNode.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'power-libperfmgr/libperfmgr/include/perfmgr/FileNode.h') diff --git a/power-libperfmgr/libperfmgr/include/perfmgr/FileNode.h b/power-libperfmgr/libperfmgr/include/perfmgr/FileNode.h index 5e97d276..bb8a2a79 100644 --- a/power-libperfmgr/libperfmgr/include/perfmgr/FileNode.h +++ b/power-libperfmgr/libperfmgr/include/perfmgr/FileNode.h @@ -33,7 +33,7 @@ class FileNode : public Node { public: FileNode(std::string name, std::string node_path, std::vector req_sorted, std::size_t default_val_index, bool reset_on_init, bool truncate, - bool hold_fd = false); + bool hold_fd = false, bool write_only = false); std::chrono::milliseconds Update(bool log_error) override; @@ -48,6 +48,8 @@ class FileNode : public Node { const bool hold_fd_; const bool truncate_; + // node will be read in DumpToFd + const bool write_only_; const std::chrono::milliseconds warn_timeout_; android::base::unique_fd fd_; }; -- cgit v1.2.3