Skip to content

Commit 16cad94

Browse files
authored
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`
2 parents e38407f + 9561999 commit 16cad94

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)