aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/trace_profile
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-11-09 11:41:49 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-11-09 11:41:49 +0100
commit3d599bcbf6771def1076c3e9561bc748956dfc94 (patch)
tree2fee901361f650a3ff65f0a8401909da60153b5f /src/trace_profile
parentcec6cc310a499c8f5659052b70eb0211bccb109f (diff)
downloadnotes-3d599bcbf6771def1076c3e9561bc748956dfc94.tar.gz
notes-3d599bcbf6771def1076c3e9561bc748956dfc94.zip
ltrace: example to trace dlopen-ed librariesHEADmaster
Diffstat (limited to 'src/trace_profile')
-rw-r--r--src/trace_profile/ltrace.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/trace_profile/ltrace.md b/src/trace_profile/ltrace.md
index cfa3fae..12bd4b3 100644
--- a/src/trace_profile/ltrace.md
+++ b/src/trace_profile/ltrace.md
@@ -7,6 +7,8 @@ ltrace [opts] [prg]
-o <file> ... log output into <file>
-l <filter> . show who calls into lib matched by <filter>
-C .......... demangle
+ -x <filter> . which symbol table entry points to trace
+ (can be of form sym_pattern@lib_pattern)
```
# Example
@@ -15,3 +17,17 @@ List which program/libs call into `libstdc++`:
```bash
ltrace -l '*libstdc++*' -C -o ltrace.log ./main
```
+
+Trace symbols from `dlopen(3)`ed libraries.
+```bash
+# Assume libfoo.so would be dynamically loaded via dlopen.
+ltrace -x '@libfoo.so'
+
+# Trace all dlopened symbols.
+ltrace -x '*'
+# Trace all symbols from dlopened libraries which name match the
+# pattern "liby*".
+ltrace -x '@liby*'
+# Trace symbol "foo" from all dlopened libraries matching the pattern.
+ltrace -x 'foo@liby*'
+``` \ No newline at end of file