rust/compiler
Matthias Krüger 221d6c734c
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`
2025-05-20 20:57:26 +02:00
..
rustc
rustc_abi
rustc_arena Introduce Arena::try_alloc_from_iter. 2025-04-19 01:13:18 +00:00
rustc_ast introduce common macro for MutVisitor and Visitor to dedup code 2025-05-19 21:21:03 +08:00
rustc_ast_ir
rustc_ast_lowering Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errors 2025-05-13 09:54:28 +00:00
rustc_ast_passes update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_ast_pretty Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_attr_data_structures update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_attr_parsing Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #140947 - compiler-errors:pending-norm, r=lcnr 2025-05-15 22:28:51 +02:00
rustc_builtin_macros Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_codegen_cranelift Use intrinsics for {f16,f32,f64,f128}::{minimum,maximum} operations 2025-05-09 17:11:23 +02:00
rustc_codegen_gcc Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_codegen_llvm Rollup merge of #140847 - Zalathar:unused-local-file, r=SparrowLii 2025-05-19 21:10:42 +10:00
rustc_codegen_ssa Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_const_eval Rollup merge of #140972 - Stypox:machine-tracing-flag, r=RalfJung 2025-05-20 20:57:26 +02:00
rustc_data_structures compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_driver
rustc_driver_impl compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_error_codes resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
rustc_error_messages
rustc_errors compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_expand Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_feature Stabilize avx512_target_feature 2025-05-18 11:12:15 +05:30
rustc_fluent_macro update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_fs_util Retry if creating temp fails with access denied 2025-04-25 11:28:36 +00:00
rustc_graphviz
rustc_hashes
rustc_hir HIR: explain in comment why ExprKind::If "then" is an Expr 2025-05-15 23:44:23 +02:00
rustc_hir_analysis Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_hir_pretty update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_hir_typeck Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_incremental Auto merge of #139758 - Zoxc:thread-local-graph, r=oli-obk 2025-05-07 12:39:54 +00:00
rustc_index
rustc_index_macros
rustc_infer Fast path for register_region_obligation 2025-05-17 19:35:05 +00:00
rustc_interface Auto merge of #141255 - matthiaskrgr:rollup-ravsgen, r=matthiaskrgr 2025-05-19 16:15:35 +00:00
rustc_lexer Implement RFC 3503: frontmatters 2025-05-05 23:10:08 +08:00
rustc_lint Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_lint_defs Rollup merge of #134273 - RalfJung:de-stabilize-bench, r=ibraheemdev,traviscross 2025-05-07 00:29:20 +00:00
rustc_llvm Experimental cygwin support in rustc 2025-05-15 23:34:11 +08:00
rustc_log Allow linking rustc and rustdoc against the same single tracing crate 2025-05-03 10:18:50 -07:00
rustc_macros Enable rust-analyzer to go from query definition to the corresponding provider field 2025-05-17 12:45:32 +02:00
rustc_metadata Warning added when dependency crate has async drop types, and the feature is disabled 2025-05-19 21:38:07 +07:00
rustc_middle Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_mir_build Auto merge of #140959 - oli-obk:no-unsafe-children, r=davidtwco 2025-05-16 12:54:18 +00:00
rustc_mir_dataflow update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_mir_transform Rollup merge of #140847 - Zalathar:unused-local-file, r=SparrowLii 2025-05-19 21:10:42 +10:00
rustc_monomorphize Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_next_trait_solver Rollup merge of #140712 - lcnr:normalization-gat-args, r=compiler-errors 2025-05-15 22:28:50 +02:00
rustc_parse Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors 2025-05-16 07:19:41 +02:00
rustc_parse_format Remove duplicate impl of string unescape 2025-05-06 10:00:22 +00:00
rustc_passes Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_pattern_analysis Remove #![feature(let_chains)] from library and src/librustdoc 2025-05-16 16:14:24 +02:00
rustc_privacy Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_query_impl Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLii 2025-05-01 04:11:52 +00:00
rustc_query_system Handle rustc_query_system cases of rustc::potential_query_instability lint 2025-05-14 08:59:55 +03:00
rustc_resolve Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_sanitizers update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_serialize Zero the buffer passed from write_with 2025-04-25 07:14:27 +02:00
rustc_session current_dll_path: fix mistake in assertion message 2025-05-19 20:20:54 +02:00
rustc_smir Rename Instance::new to Instance::new_raw and add a note that it is raw 2025-05-05 13:17:35 +00:00
rustc_span Add Ipv4Addr and Ipv6Addr diagnostic items 2025-05-14 09:34:25 +02:00
rustc_symbol_mangling update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_target Rollup merge of #138940 - sayantn:stabilize-avx512, r=Amanieu,traviscross 2025-05-18 18:44:10 +02:00
rustc_trait_selection Rollup merge of #141121 - compiler-errors:ambig-is-not-err, r=lcnr 2025-05-17 15:45:22 +02:00
rustc_traits Set groundwork for proper const normalization 2025-05-01 20:05:02 +01:00
rustc_transmute Rollup merge of #140509 - tmiasko:merge-contiguous-ranges, r=jswrenn 2025-05-02 19:37:56 +02:00
rustc_ty_utils Rollup merge of #140926 - azhogin:azhogin/async-drop-coroutine-layout-returns-layout-error, r=oli-obk 2025-05-18 18:44:12 +02:00
rustc_type_ir Auto merge of #140978 - davidtwco:deep-reject-in-match-norm-trait-ref, r=lcnr 2025-05-16 23:39:39 +00:00
rustc_type_ir_macros
stable_mir Change rustc_driver dependency on stable_mir crate 2025-04-30 15:39:52 -07:00