Tim Zhang
fbd7164c29
Fix warnings in tests
...
Remove following warnings
- unused import
- unused Result
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 17:56:46 +08:00
Tim Zhang
567cdb43b3
Use Option as resource fields, remove the update switch: update_values
...
Use idiomatic Option::None to represent optional fields.
This enables updates where not all fields need to be specified.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 17:56:41 +08:00
Tim Zhang
0c18b0855e
Support customized attributes for CpuController and MemController
...
Customized attributes are useful for customized kernels.
Usage:
let resource = &mut cgroups::Resources::default();
resource.cpu.attrs.insert("cpu.cfs_init_buffer_us", "10".to_string());
// apply here
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 16:45:41 +08:00
Tim Zhang
6f9e89572e
MemController: add method reset_max_usage
...
We need a method to reset the max memory usage recorded.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-10-29 19:35:39 +08:00
bin liu
152af17f8f
fix build warnings
...
And in Travis CI, treat warnings as error
to keep from merging codes with warning.
Fixes : #13
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-23 16:19:51 +08:00
bin liu
250ada183a
cargo fmt
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 16:42:55 +08:00
bin liu
ff6a0ea82a
add SPDX-License-Identifier for modified files
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 13:35:46 +08:00
bin liu
bcbf438823
Merge remote-tracking branch 'upstream/master'
2020-09-09 13:27:12 +08:00
bin liu
86b245076c
add SPDX-License-Identifier for all source
...
Add SPDX-License-Identifier for all existing codes.
Fixes : #2
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-07 20:29:40 +08:00
bin liu
cd2c748a74
add systemd controller; add more tests; update blkio stat for v2
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-07 14:18:41 +08:00
bin liu
c623dc3fba
add basic v2 cpu/memory functions
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-02 22:03:11 +08:00
bin liu
9fe6cb58e4
change *limit* in memory from u64 to i64
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-27 23:06:44 +08:00
bin liu
c702852fd7
add disable oom_control function
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-25 11:35:01 +08:00
Levente Kurusa
01a3c22829
Transition to Rust 2018
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-12-23 16:31:05 +01:00
Levente Kurusa
f9ffbe2ba4
memory: allow the fail counters to be reset
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-11 11:34:27 +02:00
Levente Kurusa
b3738c2c9b
memory: remove outdated TODOs
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-09 09:00:16 -04:00
Sam Wilson
c63dad411b
Hide most of the previously undocumented methods in a sealed trait
2018-10-12 09:49:52 +02:00
Sam Wilson
7826b798bd
Implement ::std::error::Error
2018-10-12 09:49:52 +02:00
Hidehito Yabuuchi
adc3323be4
Replace '/*' style comments with '//' style, which is recommended officially
2018-10-06 18:05:59 +02:00
Hidehito Yabuuchi
ffd4cd70e2
Capitalize static values in tests
2018-10-06 18:05:59 +02:00
Hidehito Yabuuchi
2149e1c0c4
Run rustfmt
2018-10-06 18:05:59 +02:00
Hidehito Yabuuchi
5660656e3a
Use self short-hand
2018-10-01 11:56:12 +02:00
Levente Kurusa
7fa4527c2a
memory: parse memory.stat
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-16 17:53:53 +02:00
Levente Kurusa
d9bc157388
memory: parse oom_control field
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-16 16:49:04 +02:00
Levente Kurusa
9da8998cd4
memory: parse numa_stat field
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-16 16:05:29 +02:00
Levente Kurusa
0e350463a1
controllers: verify that resource application went ok or not
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-14 15:59:29 +02:00
Levente Kurusa
c82a94b58e
tree: add some simple error reporting
...
There's still plenty to wish for.
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-03 00:11:33 +02:00
Levente Kurusa
367ea556ca
tests: move tests to tests/ directory and give the user cgroup perms
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-08-30 13:40:15 +02:00
Levente Kurusa
caa9241285
More documentation!
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-08-29 18:39:57 +02:00
Levente Kurusa
9162c5a6ad
Initial work
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-08-28 14:52:23 +02:00