Skip to content

Commit 6c58b41

Browse files
IanButterworthKristofferC
authored andcommitted
Profile: Improve module docstring (#52678)
![Screenshot 2023-12-30 at 7 24 10 PM](https://github.com/JuliaLang/julia/assets/1694067/a7c78943-5e4a-475c-864c-3b0005305471) (cherry picked from commit 0f62824)
1 parent 4499295 commit 6c58b41

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

stdlib/Profile/src/Profile.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
"""
4-
Profiling support, main entry point is the [`@profile`](@ref) macro.
4+
Profile
5+
6+
Profiling support.
7+
8+
## CPU profiling
9+
- `@profile foo()` to profile a specific call.
10+
- `Profile.print()` to print the report.
11+
- `Profile.clear()` to clear the buffer.
12+
- Send a $(Sys.isbsd() ? "SIGINFO (ctrl-t)" : "SIGUSR1") signal to the process to automatically trigger a profile and print.
13+
14+
## Memory profiling
15+
- `Profile.Allocs.@profile [sample_rate=0.1] foo()` to sample allocations within a specific call. A sample rate of 1.0 will record everything; 0.0 will record nothing.
16+
- `Profile.Allocs.print()` to print the report.
17+
- `Profile.Allocs.clear()` to clear the buffer.
18+
19+
## Heap profiling
20+
- `Profile.take_heap_snapshot()` to record a `.heapsnapshot` record of the heap.
21+
- Set `JULIA_PROFILE_PEEK_HEAP_SNAPSHOT=true` to capture a heap snapshot when signal $(Sys.isbsd() ? "SIGINFO (ctrl-t)" : "SIGUSR1") is sent.
522
"""
623
module Profile
724

0 commit comments

Comments
 (0)