Greg Kerr | 888f1ce | 2019-01-31 10:49:11 -0800 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef DEBUGD_SRC_SCHEDULER_CONFIGURATION_TOOL_H_ |
| 6 | #define DEBUGD_SRC_SCHEDULER_CONFIGURATION_TOOL_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/macros.h> |
| 11 | #include <brillo/errors/error.h> |
| 12 | |
| 13 | namespace debugd { |
| 14 | |
| 15 | class SchedulerConfigurationTool { |
| 16 | public: |
| 17 | SchedulerConfigurationTool() = default; |
Qijiang Fan | 6bc59e1 | 2020-11-11 02:51:06 +0900 | [diff] [blame] | 18 | SchedulerConfigurationTool(const SchedulerConfigurationTool&) = delete; |
| 19 | SchedulerConfigurationTool& operator=(const SchedulerConfigurationTool&) = |
| 20 | delete; |
| 21 | |
Greg Kerr | 888f1ce | 2019-01-31 10:49:11 -0800 | [diff] [blame] | 22 | ~SchedulerConfigurationTool() = default; |
| 23 | |
| 24 | // This sets the core sharing policy. |
Abhishek Bhardwaj | 08d907e | 2019-08-27 14:22:41 -0700 | [diff] [blame] | 25 | bool SetPolicy(const std::string& policy, |
| 26 | bool lock_policy, |
Yusuke Sato | b64c356 | 2019-09-19 11:28:34 -0700 | [diff] [blame] | 27 | brillo::ErrorPtr* error, |
| 28 | uint32_t* num_cores_disabled); |
Greg Kerr | 888f1ce | 2019-01-31 10:49:11 -0800 | [diff] [blame] | 29 | |
| 30 | private: |
Abhishek Bhardwaj | 08d907e | 2019-08-27 14:22:41 -0700 | [diff] [blame] | 31 | // Set to true when |SetAndLockConservativePolicy| is called for the first |
| 32 | // time. If set to |true| can't be set to false and configuration policy can't |
| 33 | // be changed. |
| 34 | bool policy_locked_conservative_ = false; |
Greg Kerr | 888f1ce | 2019-01-31 10:49:11 -0800 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | } // namespace debugd |
| 38 | |
| 39 | #endif // DEBUGD_SRC_SCHEDULER_CONFIGURATION_TOOL_H_ |