summaryrefslogtreecommitdiff
path: root/Base
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-11-28 20:49:58 +0000
committerAndreas Kling <kling@serenityos.org>2022-11-29 18:54:27 +0100
commit33041f3a7166dccec2bd494e853867a9a441334c (patch)
tree85c8fa6d97782aedc05c0a45c8cfdd5eea5af512 /Base
parent35126e81c44ab50c3b8be52f9f4dc1f5b525fa2e (diff)
downloadserenity-33041f3a7166dccec2bd494e853867a9a441334c.zip
Base: Update and expand profile(1) manpage
Diffstat (limited to 'Base')
-rwxr-xr-xBase/root/generate_manpages.sh1
-rw-r--r--Base/usr/share/man/man1/profile.md32
2 files changed, 26 insertions, 7 deletions
diff --git a/Base/root/generate_manpages.sh b/Base/root/generate_manpages.sh
index 027eddc6f7..a3e33bdf81 100755
--- a/Base/root/generate_manpages.sh
+++ b/Base/root/generate_manpages.sh
@@ -34,7 +34,6 @@ for i in ( \
(nl 1) \
(ntpquery 1) \
(passwd 1) \
- (profile 1) \
(readelf 1) \
(shot 1) \
(sql 1) \
diff --git a/Base/usr/share/man/man1/profile.md b/Base/usr/share/man/man1/profile.md
index 02dc2de038..1cf730eb69 100644
--- a/Base/usr/share/man/man1/profile.md
+++ b/Base/usr/share/man/man1/profile.md
@@ -1,14 +1,18 @@
## Name
-profile
+profile - Process or system profiler
## Synopsis
-```sh
-$ profile [-p PID] [-a] [-e] [-d] [-f] [-w] [-c command] [-t event_type]
+```**sh
+$ profile [-p PID] [-a] [-e] [-d] [-f] [-w] [-t event_type] [COMMAND_TO_PROFILE]
```
-## Options:
+## Description
+
+`profile` records profiling information that can then be read with `ProfileViewer`.
+
+## Options
* `-p PID`: Target PID
* `-a`: Profile all processes (super-user only), result at /sys/kernel/profile
@@ -16,9 +20,25 @@ $ profile [-p PID] [-a] [-e] [-d] [-f] [-w] [-c command] [-t event_type]
* `-d`: Disable
* `-f`: Free the profiling buffer for the associated process(es).
* `-w`: Enable profiling and wait for user input to disable.
-* `-c command`: Command
* `-t event_type`: Enable tracking specific event type
Event type can be one of: sample, context_switch, page_fault, syscall, read, kmalloc and kfree.
-<!-- Auto-generated through ArgsParser -->
+## Examples
+
+```sh
+# Enable whole-system profiling
+$ profile -ae
+# ...then, to stop
+$ profile -ad
+
+# Profile a running process, with PID 42
+$ profile -p 42
+
+# Profile syscalls made by echo
+$ profile -t syscall -- echo "Hello friends!"
+```
+
+## See also
+
+* [`Profiler`(1)](help://man/1/Profiler) GUI for viewing profiling data produced by `profile`.