Skip to content

Commit

Permalink
Profile: Improve module docstring (#52678)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Jan 2, 2024
1 parent 7baa577 commit 0f62824
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 0f62824

Please sign in to comment.