aboutsummaryrefslogtreecommitdiffhomepage
path: root/debug.txt
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2019-10-25 20:42:48 +0200
committerjohannst <johannes.stoelp@gmail.com>2019-10-25 20:42:48 +0200
commit2520f38555c9afcd6bec50116807f8bf97311d43 (patch)
tree57b534f136ae0d451965b9158bc6eebe5925dae8 /debug.txt
parent2b4330102c06fa666bb52f6c0a33bca4e72db82e (diff)
downloadnotes-2520f38555c9afcd6bec50116807f8bf97311d43.tar.gz
notes-2520f38555c9afcd6bec50116807f8bf97311d43.zip
added some notes about debugging
Diffstat (limited to 'debug.txt')
-rw-r--r--debug.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/debug.txt b/debug.txt
new file mode 100644
index 0000000..5a3c105
--- /dev/null
+++ b/debug.txt
@@ -0,0 +1,48 @@
+.:: debugging ::.
+--------------------------------------------------------------------------------
+
+# print syscalls of process with all threads (-f) of running process
+strace -f -p <pid>
+# only trace certain syscalls
+strace -f -p <pid> -e trace=open,socket
+# trace signals delivered to process
+strace -f -p <pid> -e signal
+
+# dump stack of process and all threads
+pstack <pid>
+
+# print file flags
+# +fg print file flag abbreviations
+lsof +fg -p <pid>
+
+# print process virt mem map
+# compared to /proc/<>/maps it shows the size of the mappings
+pmap <pid>
+
+
+# get supported events
+perf list
+
+perf stat -p <pid>
+perf stat -p <pid> -I <ms>
+perf stat -p <pid> -e cycles,faults,cache-misses,context-switches
+
+# -K hide kernel threads
+perf top -F 99 -p <pid> -K
+
+perf record -F 99 -p <pid>
+perf record -F 99 -p <pid> --call-graph dwarf
+perf record -F 99 -p <pid> -e instructions,cpu-cycles,faults,cache-misses,context-switches
+
+
+# print supported events
+ophelp
+
+operf -p <pid>
+
+opreport -c
+opreport -l
+
+--------------------------------------------------------------------------------
+vim:sts=2:et:tw=80:cc=80:fo+=t:ft=help
+