Skip to content

Commit

Permalink
Rename hprof to tprof
Browse files Browse the repository at this point in the history
Instead of having 4 profilers with 4 different APIs,
this pull request unifies call, time, and memory
profiling under a single module.
  • Loading branch information
josevalim committed Jan 5, 2024
1 parent 2bcabe9 commit 94449ee
Show file tree
Hide file tree
Showing 10 changed files with 574 additions and 409 deletions.
2 changes: 1 addition & 1 deletion lib/tools/doc/src/Makefile
Expand Up @@ -35,7 +35,7 @@ XML_APPLICATION_FILES = ref_man.xml
XML_REF3_FILES = \
cover.xml \
eprof.xml \
hprof.xml \
tprof.xml \
fprof.xml \
cprof.xml \
lcnt.xml \
Expand Down
6 changes: 3 additions & 3 deletions lib/tools/doc/src/ref_man.xml
Expand Up @@ -52,8 +52,8 @@
Erlang programs. Uses trace to file to minimize runtime
performance impact, and displays time for calling and called
functions.</item>
<tag><em>hprof</em></tag>
<item>A heap profiling tool; measures how much heap space is
<tag><em>tprof</em></tag>
<item>A tracing profiling tool; measures how much time or heap space is
allocated by Erlang processes.</item>

<tag><em>lcnt</em></tag>
Expand All @@ -74,7 +74,7 @@
<xi:include href="eprof.xml"/>
<xi:include href="erlang_mode.xml"/>
<xi:include href="fprof.xml"/>
<xi:include href="hprof.xml"/>
<xi:include href="tprof.xml"/>
<xi:include href="lcnt.xml"/>
<xi:include href="make.xml"/>
<xi:include href="tags.xml"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/doc/src/specs.xml
Expand Up @@ -5,7 +5,7 @@
<xi:include href="../specs/specs_make.xml"/>
<xi:include href="../specs/specs_lcnt.xml"/>
<xi:include href="../specs/specs_eprof.xml"/>
<xi:include href="../specs/specs_hprof.xml"/>
<xi:include href="../specs/specs_tprof.xml"/>
<xi:include href="../specs/specs_tags.xml"/>
<xi:include href="../specs/specs_cover.xml"/>
<xi:include href="../specs/specs_xref.xml"/>
Expand Down
373 changes: 198 additions & 175 deletions lib/tools/doc/src/hprof.xml → lib/tools/doc/src/tprof.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tools/src/Makefile
Expand Up @@ -38,7 +38,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/tools-$(VSN)
MODULES= \
cover \
eprof \
hprof \
tprof \
fprof \
cprof \
lcnt \
Expand Down
327 changes: 196 additions & 131 deletions lib/tools/src/hprof.erl → lib/tools/src/tprof.erl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tools/test/Makefile
Expand Up @@ -23,7 +23,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
MODULES = \
cover_SUITE \
eprof_SUITE \
hprof_SUITE \
tprof_SUITE \
emacs_SUITE \
fprof_SUITE \
cprof_SUITE \
Expand Down
242 changes: 159 additions & 83 deletions lib/tools/test/hprof_SUITE.erl → lib/tools/test/tprof_SUITE.erl

Large diffs are not rendered by default.

17 changes: 4 additions & 13 deletions system/doc/efficiency_guide/profiling.xml
Expand Up @@ -41,22 +41,14 @@
<p>Erlang/OTP contains several tools to help finding bottlenecks:</p>

<list type="bulleted">
<item><p><seeerl marker="tools:tprof"><c>tprof</c></seeerl> is
a tracing profiler that can measure call count, call time, or
heap allocations per function call.</p></item>

<item><p><seeerl marker="tools:fprof"><c>fprof</c></seeerl> provides
the most detailed information about where the program time is spent,
but it significantly slows down the program it profiles.</p></item>

<item><p><seeerl marker="tools:eprof"><c>eprof</c></seeerl> provides
time information of each function used in the program. No call graph is
produced, but <c>eprof</c> has considerably less impact on the program it
profiles.</p>
<p>If the program is too large to be profiled by <c>fprof</c> or
<c>eprof</c>, <c>cprof</c> can be used to locate code parts that
are to be more thoroughly profiled using <c>fprof</c> or <c>eprof</c>.</p></item>

<item><p><seeerl marker="tools:cprof"><c>cprof</c></seeerl> is the
most lightweight tool, but it only provides execution counts on a
function basis (for all processes, not per process).</p></item>

<item><p><seeerl marker="runtime_tools:dbg"><c>dbg</c></seeerl> is the
generic erlang tracing frontend. By using the <c>timestamp</c> or
<c>cpu_timestamp</c> options it can be used to time how long function
Expand All @@ -67,7 +59,6 @@
locking mechanisms. It is useful when looking for bottlenecks in
interaction between process, port, ets tables and other entities
that can be run in parallel.</p></item>

</list>

<p>The tools are further described in
Expand Down
10 changes: 10 additions & 0 deletions system/doc/general_info/upcoming_incompatibilities.xml
Expand Up @@ -331,6 +331,16 @@ String Content
warnings about all occurrences of <c>maybe</c> without quotes.
</p>
</section>

<section>
<title>cprof and eprof will be replaced by tprof</title>
<p>
As of OTP 29, the <c>cprof</c> and <c>eprof</c> will be
removed in favor of
<seeerl marker="tools:tprof"><c>tprof</c></seeerl> added
in OTP 27.
</p>
</section>
</section>

</chapter>

0 comments on commit 94449ee

Please sign in to comment.