blob: 79df147ba7d8935321f1694cbcdfe15767a46e89 [file] [log] [blame]
Mike Frysinger57538c02016-10-06 23:01:33 -04001// Copyright 2016 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_SWAP_TOOL_H_
6#define DEBUGD_SRC_SWAP_TOOL_H_
7
8#include <string>
9
Brian Geffon8a87b402019-10-10 14:55:51 -070010#include <brillo/errors/error.h>
Mike Frysinger57538c02016-10-06 23:01:33 -040011#include <base/macros.h>
Mike Frysinger57538c02016-10-06 23:01:33 -040012
13namespace debugd {
14
15class SwapTool {
16 public:
17 SwapTool() = default;
Qijiang Fan6bc59e12020-11-11 02:51:06 +090018 SwapTool(const SwapTool&) = delete;
19 SwapTool& operator=(const SwapTool&) = delete;
20
Mike Frysinger57538c02016-10-06 23:01:33 -040021 ~SwapTool() = default;
22
Luigi Semenzato3421c412017-10-24 14:56:26 -070023 std::string SwapEnable(int32_t size, bool change_now) const;
Eric Carusoc93a15c2017-04-24 16:15:12 -070024 std::string SwapDisable(bool change_now) const;
25 std::string SwapStartStop(bool on) const;
26 std::string SwapStatus() const;
Luigi Semenzato1caa11f2017-04-25 12:49:46 -070027 std::string SwapSetParameter(const std::string& parameter_name,
Luigi Semenzato3421c412017-10-24 14:56:26 -070028 int32_t parameter_value) const;
Brian Geffon8a87b402019-10-10 14:55:51 -070029 // Kstaled swap configuration.
30 bool KstaledSetRatio(brillo::ErrorPtr* error, uint8_t kstaled_ratio) const;
Mike Frysinger57538c02016-10-06 23:01:33 -040031};
32
33} // namespace debugd
34
35#endif // DEBUGD_SRC_SWAP_TOOL_H_