File 0693-beamasm-Add-instructions-for-attaching-to-a-running-.patch of Package erlang

From 400f654901dcd26cd6c5cdd8e3990c77c1bb0790 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
Date: Wed, 22 Mar 2023 10:36:16 +0100
Subject: [PATCH] beamasm: Add instructions for attaching to a running system

---
 erts/emulator/internal_doc/BeamAsm.md | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/erts/emulator/internal_doc/BeamAsm.md b/erts/emulator/internal_doc/BeamAsm.md
index dded89fba7..b9a739d897 100644
--- a/erts/emulator/internal_doc/BeamAsm.md
+++ b/erts/emulator/internal_doc/BeamAsm.md
@@ -308,7 +308,12 @@ that perf provides functionality similar to that of [eprof](https://erlang.org/d
 
 You can run perf on BeamAsm like this:
 
-    perf record erl +JPperf true
+    # Start Erlang under perf
+    perf record -- erl +JPperf true
+    # Record a running instance started with `+JPperf true` for 10s
+    perf record --pid $BEAM_PID -- sleep 10
+    # Record a running instance started with `+JPperf true` until interrupted
+    perf record --pid $BEAM_PID
 
 and then look at the results using `perf report` as you normally would with perf.
 
@@ -438,7 +443,7 @@ we have found useful:
     on another host. In early version of perf this command does not work,
     instead you can use [this bash script](https://github.com/torvalds/linux/blob/master/tools/perf/perf-archive.sh).
 * `perf report` gives "failed to process sample" and/or "failed to process type: 68"
-    This probably means that you are running a bugge version of perf. We have
+    This probably means that you are running a bugged version of perf. We have
     seen this when running Ubuntu 18.04 with kernel version 4. If you update
     to Ubuntu 20.04 or use Ubuntu 18.04 with kernel version 5 the problem
     should go away.
-- 
2.35.3

openSUSE Build Service is sponsored by