File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -450,3 +450,17 @@ profilers whose results are not affected by system noise (e.g. `callgrind` or `e
450
450
451
451
` RUST_LOG=debug ` can be specified to enable verbose logging, which is useful
452
452
for debugging ` collector ` itself.
453
+
454
+
455
+ ## How ` rustc ` wrapping works
456
+ When a crate is benchmarked or profiled, the real ` rustc ` is replaced with the ` rustc-fake ` binary,
457
+ which parses commands passed from the ` collector ` and invokes the actual profiling or benchmarking
458
+ tool.
459
+
460
+ Profiling/benchmarking a crate is performed in two steps:
461
+ 1 ) Preparation - here all dependencies are compiled and build scripts are executed.
462
+ During this step, ` cargo ` is invoked with ` ... -- --skip-this-rustc ` , which causes ` rustc-fake ` to skip
463
+ compilation of the final/leaf crate. Cargo only passes arguments after ` -- ` to the final crate,
464
+ therefore this does not affect the compilation of dependencies.
465
+ 2 ) Profiling/benchmarking - ` cargo ` is invoked with ` --wrap-rustc-with <TOOL> ` , which executes the
466
+ specified profiling tool by ` rustc-fake ` .
You can’t perform that action at this time.
0 commit comments