From f4e21cdb750bd83bbf31a644d72542a8575f8bb8 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sun, 27 Apr 2025 19:31:09 -0700 Subject: [PATCH 1/2] docs: document profiling options a bit better Previously, the docs were a bit mysterious about what "enables profiling support" means or how one could take advantage of it. --- doc/090_participating.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/090_participating.rst b/doc/090_participating.rst index 890bd9018..2793833fe 100644 --- a/doc/090_participating.rst +++ b/doc/090_participating.rst @@ -71,8 +71,10 @@ The program can be built with debug support like this: $ go run build.go -tags debug This will make the ``restic debug `` available which can be used to -inspect internal data structures. In addition, this enables profiling support -which can help with investigation performance and memory usage issues. +inspect internal data structures. In addition, this enables profiling flags such +as ``--cpu-profile`` and ``--mem-profile`` which can help with investigation +performance and memory usage issues. See ``restic help`` for more details and a +few additional ``--...-profile`` flags. ************ From e8dbb69a94aa3832f97c08156e05b1b3d8077192 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sun, 27 Apr 2025 20:20:05 -0700 Subject: [PATCH 2/2] docs: when describing profiling, briefly explain .pprof files --- doc/090_participating.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/090_participating.rst b/doc/090_participating.rst index 2793833fe..a035af7ca 100644 --- a/doc/090_participating.rst +++ b/doc/090_participating.rst @@ -71,10 +71,17 @@ The program can be built with debug support like this: $ go run build.go -tags debug This will make the ``restic debug `` available which can be used to -inspect internal data structures. In addition, this enables profiling flags such -as ``--cpu-profile`` and ``--mem-profile`` which can help with investigation -performance and memory usage issues. See ``restic help`` for more details and a -few additional ``--...-profile`` flags. +inspect internal data structures. + +In addition, this enables profiling flags such as ``--cpu-profile`` and +``--mem-profile`` which can help with investigation performance and memory usage +issues. See ``restic help`` for more details and a few additional +``--...-profile`` flags. + +Running Restic with profiling enabled generates a ``.pprof`` file such as +``cpu.pprof``. To view a profile in a web browser, first make sure that the +``dot`` command from `Graphviz `__ is in the PATH. Then, +run ``go tool pprof -http : cpu.pprof``. ************