Skip to content

Commit

Permalink
Profile: Improve module docstring (#52678)
Browse files Browse the repository at this point in the history
![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)
  • Loading branch information
IanButterworth authored and KristofferC committed Jul 24, 2024
1 parent 4499295 commit 6c58b41
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion stdlib/Profile/src/Profile.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

"""
Profiling support, main entry point is the [`@profile`](@ref) macro.
Profile
Profiling support.
## CPU profiling
- `@profile foo()` to profile a specific call.
- `Profile.print()` to print the report.
- `Profile.clear()` to clear the buffer.
- Send a $(Sys.isbsd() ? "SIGINFO (ctrl-t)" : "SIGUSR1") signal to the process to automatically trigger a profile and print.
## Memory profiling
- `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.
- `Profile.Allocs.print()` to print the report.
- `Profile.Allocs.clear()` to clear the buffer.
## Heap profiling
- `Profile.take_heap_snapshot()` to record a `.heapsnapshot` record of the heap.
- Set `JULIA_PROFILE_PEEK_HEAP_SNAPSHOT=true` to capture a heap snapshot when signal $(Sys.isbsd() ? "SIGINFO (ctrl-t)" : "SIGUSR1") is sent.
"""
module Profile

Expand Down

0 comments on commit 6c58b41

Please sign in to comment.