-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f4cacda
Showing
4 changed files
with
401 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/target | ||
**/*.rs.bk | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "cargo-mlocktest" | ||
version = "0.1.0" | ||
authors = ["DrPeterVanNostrand <jnz@riseup.net>"] | ||
|
||
[dependencies] | ||
|
||
[dev-dependencies] | ||
memsec = "0.5.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# cargo-mlocktest | ||
|
||
A cargo subcommand to monitor the ammount of memory locked into RAM during | ||
`cargo test` | ||
|
||
**Note: `cargo-mlocktest` only runs on Linux.** | ||
|
||
This subcommand is useful when debugging `SIGILL` segfaults that may arise | ||
when testing rust programs that lock large ammounts of memory into RAM. | ||
|
||
### Usage | ||
|
||
You can use this `cargo` subcommand by running the following: | ||
|
||
``` | ||
# Install the `mlocktest` subcommand: | ||
$ cd cargo-mlocktest | ||
$ cargo build | ||
$ cp target/debug/cargo-mlocktest ~/.cargo/bin/ | ||
# Use the subcommand: | ||
$ cd <different rust project> | ||
$ cargo mlocktest | ||
# When you no longer need the subcommand, run the following to uninstall: | ||
$ rm ~/.cargo/bin/cargo-mlocktest | ||
``` | ||
|
||
### Output | ||
|
||
Running `cargo mlocktest` will run `cargo test`, then output the following | ||
table: | ||
|
||
``` | ||
Mlock Monitor for `cargo test` | ||
=============================== | ||
Locked memory limit (soft, kb): <your systems soft locked memory limit> | ||
Lock memory limit (hard, kb): <your systems hard locked memory limit> | ||
Running `cargo test` ... done! | ||
Process Name Max Locked Memory (kb) | ||
============ ====================== | ||
<test 1 binary name> <the max number of kbs locked during test 1> | ||
<test 2 binary name> <the max number of kbs locked during test 2> | ||
... | ||
============================================================== | ||
``` |
Oops, something went wrong.