about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-20 20:57:26 +0200
committerGitHub <noreply@github.com>2025-05-20 20:57:26 +0200
commit221d6c734c152b10746e690926bf9210f67be81c (patch)
tree0509d2956f18820fbf589b8e4fcb2e18ad4eeb3b /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent6cab15c1aef39456d86ce51be6096088cb2ef1da (diff)
parent28db348fdd8a22352826e31d793ae916a8a60385 (diff)
downloadrust-221d6c734c152b10746e690926bf9210f67be81c.tar.gz
rust-221d6c734c152b10746e690926bf9210f67be81c.zip
Rollup merge of #140972 - Stypox:machine-tracing-flag, r=RalfJung
Add TRACING_ENABLED to Machine and add enter_trace_span!()

This PR adds the necessary infrastructure to make it possible to do tracing calls from within `rustc_const_eval` when running Miri, while making sure they don't impact the performance of normal compiler execution. This is done by adding a `const` boolean to `Machine`, false by default, but that will be set to true in Miri only. The tracing macro `enter_trace_span!()` checks if it is true before doing anything, and since the value of a `const` is known at compile time, if it it false it the whole tracing call should be optimized out.

I will soon open further PRs to add tracing macro calls similar to this one, so that afterwards it will be possible to learn more about Miri's time spent in the various interpretation steps:
```rs
let _guard = enter_trace_span!(M, "eval_statement", "{:?}", stmt);
```

r? `@RalfJung`
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions