Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion doc/mdbook-metrics/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ fn run_kani_metrics_script() -> Result<(), Error> {
Command::new("python")
.args(&[
"kani_std_analysis.py",
"--crate",
Comment thread
tautschnig marked this conversation as resolved.
"core",
"--metrics-file",
"metrics-data-core.json",
"--plot-only",
"--plot-dir",
&tools_path.to_string_lossy(),
])
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()?;

Command::new("python")
.args(&[
"kani_std_analysis.py",
"--crate",
"std",
"--metrics-file",
"metrics-data-std.json",
"--plot-only",
"--plot-dir",
&tools_path.to_string_lossy(),
Expand Down Expand Up @@ -83,12 +102,19 @@ fn add_graphs(chapter: &mut Chapter) {

Note that these metrics are for x86-64 architectures.

## `core`
### `core`
![Unsafe Metrics](core_unsafe_metrics.png)

![Safe Abstractions Metrics](core_safe_abstractions_metrics.png)

![Safe Metrics](core_safe_metrics.png)

### `std`
![Unsafe Metrics](std_unsafe_metrics.png)

![Safe Abstractions Metrics](std_safe_abstractions_metrics.png)

![Safe Metrics](std_safe_metrics.png)
"#;

chapter.content.push_str(new_content);
Expand Down
2 changes: 1 addition & 1 deletion library/stdarch
Submodule stdarch updated 190 files
172 changes: 137 additions & 35 deletions scripts/kani-std-analysis/kani_std_analysis.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions scripts/kani-std-analysis/metrics-data-std.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"results": [
]
}
1 change: 0 additions & 1 deletion scripts/kani-std-analysis/std-analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ then
fi
cargo new std_lib_analysis --lib
cd std_lib_analysis
sed -i '1i cargo-features = ["edition2024"]' Cargo.toml

echo '
pub fn dummy() {
Expand Down
7 changes: 6 additions & 1 deletion scripts/run-kani.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ main() {
./std-analysis.sh $build_dir
pip install -r requirements.txt
echo "Computing Kani-specific metrics..."
./kani_std_analysis.py --kani-list-file $current_dir/kani-list.json
./kani_std_analysis.py --crate core \
--kani-list-file $current_dir/kani-list.json \
--metrics-file metrics-data-core.json
./kani_std_analysis.py --crate std \
--kani-list-file $current_dir/kani-list.json \
--metrics-file metrics-data-std.json
popd
rm kani-list.json
fi
Expand Down
Loading