Sotrace
Traces the shared-object dependencies of a binary, and graphs them.
Install / Use
/learn @stolk/SotraceREADME
sotrace
Traces the shared-object dependencies of a binary, and graphs them.
Usage
./sotrace.py /path/to/foo out.dot
dot -Tsvg -o out.svg out.dot
eog out.svg
Alternate Usage
It is also possible to map the actually loaded .so files of a process by giving the tool a PID instead of a file.
./sotrace.py PID out.dot
Rationale
Dynamically linked binaries pull in a large amount of dependencies. It is often hard to get a good idea of what gets pulled in, recursively.
This tool will create a graphic that clearly shows the dependencies.
It is also a useful tool to identify software bloat.
Limitations
Currently, it will only find dependencies that are dynamically linked.
This means it will miss:
- statically linked dependencies.
To see the dynamically loaded libraries, that were opened with dlopen() you need to run the tool on a PID, not a binary.
Dependencies
To run this tool, you need python3.
To create the graph, you need dot from the graphviz package.
Personally I use eog to view the svg, but any browser would work, or also Imagemagick's display command.
Author
Bram Stolk b.stolk@gmail.com
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
