Strace
straceはLinuxのデバッグユーティリティであり、プログラムが使用するシステムコールおよび受け取るシグナルを監視す�…
| 作者 | Paul Kranenburg |
|---|---|
| 開発元 | Roland McGrath, Dmitry Levin |
| 最新版 |
5.10
/ 2020年12月14日 |
| リポジトリ | |
| プログラミング 言語 | C言語 |
| 対応OS | Linux |
| プラットフォーム | クロスプラットフォーム |
| サポート状況 | 開発中 |
| 種別 | デバッグツール |
| ライセンス | BSDライセンス |
| 公式サイト | https://sourceforge.net/projects/strace/ |
straceはLinuxのデバッグユーティリティであり、プログラムが使用するシステムコールおよび受け取るシグナルを監視するものである。他のUnixシステムにおける「truss」に類似している。これはカーネルのptraceという機能により実現されている。
Cygwinにおいても類似のユーティリティが提供されている。
使用法
一般的な使用法として、プログラムをstraceを用いて開始し、これによりそのプログラムが呼ぶシステムコールの一覧が出力される。これはプログラムが頻繁にクラッシュしたり、意図したものとは異なる挙動をするときに有用である。straceを用いることにより、一例として、プログラムが存在しないファイルあるいは読み込むことができないファイルにアクセスしようとしていることが判明するということがある。
また、別の使用法として、-pフラグを用いることにより、実行中のプロセスにattachするというものがある。これはプロセスが応答しなくなったときに有用である。この場合の一例として、プロセスがネットワーク接続を確立する途中でブロックされていることが判明するということがある。
straceはシステムコールのみを出力するため、gdbのようなデバッガと比較して検知できる問題は限られる。しかし、デバッガより使用が容易であり、システム管理者が使用するには非常に有用なツールである。
類似のツール
他のOSには以下の類似のデバッグツールがある。
- 2006年以降のLinuxにおけるSystemTap
- Solaris上のTrussとDTrace
- FreeBSDのTrussコマンド、ktraceおよびDTrace
- Mac OS X v10.4以前ではktraceが、Mac OS X v10.5以降はDTraceがある[1]
- WindowsのStraceNT[2]とAPI Monitor[3]
脚注
- ^ Solarisからの移植 dtrace(1) Mac OS X Manual Page
- ^ StraceNT
- ^ API Monitor
関連項目
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.