Skip to content

Commit 95ac8c2

Browse files
authored
add a note to devdocs about Compiler.@zone (#58263)
1 parent 3e293bc commit 95ac8c2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/src/devdocs/external_profilers.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@ The currently supported profilers are:
88

99
### Adding New Zones
1010

11+
#### From C/C++ code
12+
1113
To add new zones, use the `JL_TIMING` macro. You can find numerous examples throughout the codebase by searching for `JL_TIMING`. To add a new type of zone
1214
you add it to `JL_TIMING_OWNERS` (and possibly `JL_TIMING_EVENTS`).
1315

16+
#### From Julia code
17+
18+
The `Compiler.@zone` macro can be used to add a zone from Julia code, it is used as:
19+
20+
```julia
21+
Compiler.@zone "ZONE NAME" begin
22+
...
23+
end
24+
```
25+
1426
### Dynamically Enabling and Disabling Zones
1527

1628
The [`JULIA_TIMING_SUBSYSTEMS`](@ref JULIA_TIMING_SUBSYSTEMS) environment variable allows you to enable or disable zones for a specific Julia run. For instance, setting the variable to `+GC,-INFERENCE` will enable the `GC` zones and disable the `INFERENCE`

0 commit comments

Comments
 (0)