File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # Diagnostics used by the package ecosystem
2+
3+ This page documents "hooks" embedded in Julia that are primarily used by
4+ external tools. Many of these tools are designed to perform analyses that are
5+ too complicated to be made part of Julia proper.
6+
7+ ## SnoopCompile
8+
9+ SnoopCompile "snoops" on Julia's compiler to extract information for analysis
10+ about invalidations and type-inference. There are a few internals it uses for
11+ different purposes:
12+
13+ - recording invalidations: ` Base.StaticData.debug_method_invalidation ` and
14+ ` ccall(:jl_debug_method_invalidation, ...) ` : these record different modes of
15+ invalidation. Users of SnoopCompile will transiently turn these on when, e.g.,
16+ loading packages. Each produces a standard log format; messing with the log
17+ format might require a complementary pull request to SnoopCompile.
18+ SnoopCompile will process these logs and generate trees of invalidated
19+ CodeInstances that are attributable to specific changes in the method tables
20+ or bindings.
21+ - observing inference: ` ccall(:jl_set_newly_inferred, ...) ` and
22+ ` ccall(:jl_set_inference_entrance_backtraces, ...) ` : these are used to
23+ understand how inference gets triggered. The main purpose is to allow
24+ performance diagnostics to understand sources of TTFX. The second of these
25+ ` ccall ` s records a backtrace on every entrance to type-inference, so that
26+ SnoopCompile can determine the caller of a dynamically-dispatched call. This
27+ is needed to attribute "cause" for new type inference.
You can’t perform that action at this time.
0 commit comments