Tim Zhang
bf5af7b195
action: fix the the body line checker
...
the original regex can not handle pasted error message
rightly. this commit will fix this.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-11-10 19:34:30 +08:00
Tim Zhang
2e3719dbd5
action: Lock rust version to 1.52
...
Got the following error in the clippy:
error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
--> tests/cpuset.rs:54:37
|
54 | let r = cpuset.set_cpus(&cpus);
| ^^^^^ help: change this to: `cpus`
|
= note: `-D clippy::needless-borrow` implied by `-D warnings`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
But we did not touch the code, just becuase the clippy rules was updated
follow the rust update.
To avoid this problem we lock the rust version in CI and make it
steady.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-11-10 19:29:14 +08:00
Fupan Li
63750887c2
Merge pull request #56 from flxo/pr-serde
...
Add Serialize/Deserialize to resource and stat types
2021-08-04 10:10:28 +08:00
Felix Obenhuber
09499e7614
Add Serialize/Deserialize to resource and stat types
...
Add feature "serde" that derives all resource and statistics types from
Serialize and Deserialize. The feature is turned off by default.
Fixes #54
Fixes #55
Fixes #56
Signed-off-by: Felix Obenhuber <felix@obenhuber.de >
2021-08-03 09:55:10 +02:00
Fupan Li
bcb7c6cd54
Merge pull request #51 from Tim-Zhang/release-0.2.6
...
release: v0.2.6
v0.2.6
2021-06-30 20:53:39 +08:00
Tim Zhang
2554aa65d0
release: v0.2.6
...
Bump version from 0.2.5 to 0.2.6
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-06-30 20:36:34 +08:00
Tim Zhang
34f935be89
Merge pull request #49 from lifupan/master
...
freezer: fix the issue of missing trim the str
2021-06-30 20:35:22 +08:00
Fupan Li
5485d8dd46
Merge pull request #50 from Tim-Zhang/fix-clippy-for-rust-1.53
...
Fix clippy for rust 1.53
2021-06-30 19:58:48 +08:00
Tim Zhang
ec4cda1dd9
Fix clippy for rust 1.53
...
There are new lints are added in clippy for rust 1.53
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-06-30 19:07:56 +08:00
fupan.lfp
4b5a190ecc
freezer: fix the issue of missing trim the str
...
When reading from the freezer file, it should trim it
first, and the string may container an '\n'.
Fixes : #48
Signed-off-by: fupan.lfp <fupan.lfp@antgroup.com >
2021-06-30 18:39:33 +08:00
Fupan Li
45b626e0c0
Merge pull request #46 from Tim-Zhang/fix-clippy-for-rust-1.52
...
Fix clippy for rust 1.52
2021-05-21 16:24:16 +08:00
Tim Zhang
0e2430fde1
clippy: turn on lint upper_case_acronyms
...
cargo-clippy has moved the upper_case_acronyms lint to
pedantic(removed from the default list), but we need
the lint to keep names consistent and follow the rust
naming conventions.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-05-21 00:48:50 +08:00
Tim Zhang
5aa7e6c90e
Fix clippy for rust 1.52
...
There are new lints are added in clippy for rust 1.52
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-05-21 00:45:27 +08:00
Fupan Li
5bb27a2692
Merge pull request #45 from Tim-Zhang/release-0.2.5
...
release: v0.2.5
v0.2.5
2021-03-24 14:52:27 +08:00
Tim Zhang
0b2a0405e2
release: v0.2.5
...
Bump version to 0.2.5
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-03-24 14:37:19 +08:00
Bin Liu
c4850ef2ef
Merge pull request #44 from Tim-Zhang/impl-clone
...
Impl Clone for hierarchies:V1, hierarchies:V2
2021-03-23 22:31:27 +08:00
Tim Zhang
aa207edca8
Impl Clone for hierarchies:V1, hierarchies:V2
...
Clone is useful.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-03-23 21:50:18 +08:00
Bin Liu
af7a75ce9e
Merge pull request #40 from Jakob-Naucke/v0.2.4
...
release: v0.2.4
v0.2.4
2021-03-03 15:39:15 +08:00
Bin Liu
fb56c817ca
Merge pull request #32 from Tim-Zhang/fix-clippy
...
Fix clippy warnings
2021-03-03 15:38:37 +08:00
Tim Zhang
fdabe52401
github action: Add clippy check
...
Because the existing warnings are all fixed.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-03-03 13:46:19 +08:00
Tim Zhang
9ec1010a15
Fix clippy warnings
...
Fix clippy warnings.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-03-03 13:44:29 +08:00
Fupan Li
610071730d
Merge pull request #41 from bergwolf/fix-panic
...
memory: fix parse_oom_control panic on older kernels
2021-03-03 00:17:54 +08:00
Peng Tao
0a3e4a828f
memory: fix parse_oom_control panic on older kernels
...
Where the oom control fields might not be present.
Fixes : #36
Signed-off-by: Peng Tao <bergwolf@hyper.sh >
2021-02-26 01:40:19 +08:00
Jakob Naucke
60820bfffb
release: v0.2.4
...
Bump version from 0.2.3 to 0.2.4
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com >
2021-02-25 11:22:47 +01:00
Fupan Li
2209189244
Merge pull request #39 from bergwolf/fix-panic
...
memory: fix panic when no hierarchical numa stat is available
2021-02-25 14:57:39 +08:00
Peng Tao
8720aed656
memory: fix panic when no hierarchical numa stat is available
...
For older kernels, it is possible that there is no hierarchical numa
stats.
Fixes : #36
Signed-off-by: Peng Tao <bergwolf@hyper.sh >
2021-02-25 11:00:48 +08:00
Fupan Li
16d73e1d59
Merge pull request #38 from Jakob-Naucke/update-nix
...
Update nix to 0.20.0
2021-02-25 09:47:01 +08:00
Jakob Naucke
b9ca0a51f1
Update nix to 0.20.0
...
to pull in https://github.com/nix-rust/nix/pull/1372 and get statfs
MAGIC constants on s390x. Additionally, fork() calls in tests now have
to be marked unsafe.
Fixes : #37
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com >
2021-02-22 14:28:16 +01:00
Fupan Li
87f05873f0
Merge pull request #35 from Tim-Zhang/v0.2.3
...
release: v0.2.3
v0.2.3
2021-02-02 11:46:03 +08:00
Tim Zhang
79868d6bfc
release: v0.2.3
...
Bump version from 0.2.2 to 0.2.3
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-02-02 10:24:58 +08:00
Fupan Li
d1d78fe943
Merge pull request #34 from quanweiZhou/get_mountinfo_without_procinfo
...
cgroup: get the mount info without procinfo
2021-02-01 15:13:59 +08:00
quanweiZhou
81d286f31d
cgroup: get the mount info without procinfo
...
The procinfo library gets all the mount info,
but we don't need all the mount info.
Signed-off-by: quanweiZhou <quanweiZhou@linux.alibaba.com >
2021-02-01 11:26:54 +08:00
Fupan Li
5e538ae286
Merge pull request #33 from lifupan/master
...
cgroup: fix the issue of remove cgroup
2021-01-25 17:39:38 +08:00
fupan.lfp
cd5645bb14
cgroup: fix the issue of remove cgroup
...
It should remove the child cgroups recursively
and then remove the parent cgroup, otherwise,
it would remove failed.
Signed-off-by: fupan.lfp <fupan.lfp@antfin.com >
2021-01-25 17:36:49 +08:00
Tim Zhang
4a2042068e
Merge pull request #28 from Tim-Zhang/update-cargo-toml
...
Add field homepage and readme for Cargo.toml
2021-01-25 17:34:43 +08:00
Tim Zhang
9ac2f5d5ab
Add field homepage and readme for Cargo.toml
...
Display readme on the crate's page.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-25 17:32:24 +08:00
Tim Zhang
a58cd1d553
Merge pull request #31 from Tim-Zhang/switch-travis-to-github-action
...
Migrate the CI from travis-ci to Github Actions
2021-01-25 17:30:37 +08:00
Tim Zhang
88a45d4922
Migrate the CI from travis-ci to Github Actions
...
Because travis-ci.org will be shutting down.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-25 17:24:45 +08:00
Tim Zhang
0c58b5dd84
Add Makefile
...
So we can use make to build, check and test
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-25 17:20:56 +08:00
Tim Zhang
8448548cb3
Merge pull request #30 from bergwolf/issue-templates
...
github: add issue templates
2021-01-25 15:33:01 +08:00
Peng Tao
d50245e116
github: add issue templates
...
cgroups-rs should not use the repository default issue templates.
Let's add a private version to override the default ones.
Fixes : #29
Signed-off-by: Peng Tao <bergwolf@hyper.sh >
2021-01-25 15:01:48 +08:00
Tim Zhang
bbdfa88596
Merge pull request #26 from Tim-Zhang/memory-apply-customized-attrs
...
Apply customized attributes in MemController.apply
v0.2.2
2021-01-25 14:37:34 +08:00
Tim Zhang
853ed46993
release: v0.2.2
...
Bump version to 0.2.2
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-25 12:20:30 +08:00
Tim Zhang
15b65c5e5e
Apply customized attributes in MemController.apply
...
Fixes : #25
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-25 12:11:43 +08:00
Tim Zhang
87f8ac7f0d
Merge pull request #23 from Tim-Zhang/add-trait-bound-for-hierarchy
...
Add trait bound for hierarchy
v0.2.1
2021-01-07 16:27:15 +08:00
Tim Zhang
225388ff7c
release: v0.2.1
...
Bump version to 0.2.1
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-06 22:31:04 +08:00
Tim Zhang
f0a695cc00
Add trait bound Sync for Hierarchy
...
So that the struct Cgroup could across await
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-01-06 22:31:04 +08:00
Tim Zhang
50d3c398a0
Merge pull request #22 from Apokleos/master
...
optimize and refactor: read_to_string and read_i[u]64_from
2021-01-06 22:30:17 +08:00
LiYa'nan
033fa4b857
optimize and refactor: read_to_string and read_i[u]64_from
...
There's so many Duplicated read_string_from method in different
subsystem's implementation, so as read_u64_from/read_i64_from methods.
(1) Move the read_string_from method into `lib.rs`,
called by each subsystem implementation as needed.
(2) Refactor read_u[i]64_from method with the help Rust Generic f
unction `read_from` and wrapped by read_u64_from or read_i64_from.
fix : #20
Signed-off-by: LiYa'nan <oliverliyn@gmail.com >
2020-12-24 09:25:00 +08:00
Peng Tao
ac4e6eda66
Merge pull request #21 from Tim-Zhang/change-name
...
Change package name to cgroups-rs
2020-12-21 16:22:06 +08:00