zhanghj
cd7e737149
lib: fix compiling error for type i8 in aarch64 environment
...
c_char is equal to i8 on x86, but it is equal to u8 on arm arch,
so we need to use type c_char instead of i8 to avoid compiling error.
Fixes : #9
Signed-off-by: zhanghj <zhanghj.lc@inspur.com >
2020-09-21 05:40:57 -04:00
Peng Tao
3852d7c180
Merge pull request #8 from liubin/fix/7-add-sync-marker-to-error-cause
...
errors: add sync marker to error cause
2020-09-14 16:15:12 +08:00
bin liu
42685bbfe9
errors: add sync marker to error cause
...
Errors cause should be shared to let anyhow to wrap it.
Fixes : #7
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-14 15:22:55 +08:00
bin liu
f8d653e987
cpu: change cfs_quota from u64 to i64
...
cfs_quota can be set to -1 to indicate no limit
Fixes : #5
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-14 13:00:43 +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
c3912223d0
use let Some() instead of is_some() to make codes clear
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 13:26:18 +08:00
bin liu
5d51e50bec
get relative paths at new/load func default.
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-08 10:30:29 +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
704db324ae
fix: create all dirs
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-01 00:01:28 +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
bin liu
9d70467327
add hugetlb functions
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-25 10:58:56 +08:00
bin liu
6b1b26b1fe
copy cpuset after created
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-25 10:51:29 +08:00
bin liu
9ce206f6bc
probe cgroup v1 mount path
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-25 10:50:52 +08:00
Levente Kurusa
ed1e8162d5
rust2018: remove extern crate
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-12-23 16:57:41 +01:00
Levente Kurusa
01a3c22829
Transition to Rust 2018
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-12-23 16:31:05 +01:00
Sam Wilson
dd621eae4e
Replace &String with &str
2018-10-30 21:52:31 +01:00
Sam Wilson
751dbc7244
Replace some &String with &Path
2018-10-30 21:51:50 +01:00
Sam Wilson
3413b7d847
Expose the path of controllers for chown
2018-10-30 21:51:50 +01:00
Levente Kurusa
3b9d4a8c2a
builder: document blkio
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-30 21:47:21 +01:00
Levente Kurusa
e51d781baf
builder: add some documentation
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-30 21:47:21 +01:00
Levente Kurusa
b4cc91f977
Builder pattern for control groups
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-30 21:47:18 +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
Levente Kurusa
90ab756be8
blkio: parse {read,write}_{bps,iops}_device
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-08 17:11:01 -04:00
Levente Kurusa
e85754d943
blkio: parse sectors{,_recursive}
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-05 14:21:55 -04:00
Levente Kurusa
c08e4d3e5d
blkio: parse leaf_weight_device
2018-10-04 12:51:21 -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
Sam Wilson
84ae587360
Replace println! calls with logging
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
ae56cb02b9
Use mem::discriminant in impl PartialEq for CgroupError
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
af6ed48e39
blkio: use BlkIoData for weight_device, too
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-29 09:41:36 -04:00
Levente Kurusa
4b67af3eef
blkio: rename BlkIoTime to BlkIoData
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-28 11:11:19 +01:00
Levente Kurusa
afe1519ed2
blkio: parse time/time_recursive
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-27 10:19:19 +01: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
07421b2aff
blkio: parse a bunch of fields
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-16 14:43:09 +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
dbbcb86884
devices: correct some documentation
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-05 10:48:12 +02:00
Levente Kurusa
1c213caea5
cpuset: parse ranges like cpus & mems
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-05 10:47:53 +02:00
Levente Kurusa
be5db6ba50
cpuset: fail if trying to enable memory pressure on a non-root cg
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-04 10:45:32 +02:00