TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Strace - The Sysadmin's Microscope (2010)

23 点作者 jswanson超过 12 年前

5 条评论

jbert超过 12 年前
strace is fantastic. Since it captures the detail of (nearly) all interactions between the process and the outside world, you can use it to answer many questions.<p>Why isn't this process invocation picking up my changed lib file? (strace, see if the changed file is being opened)<p>What are the exact http req/responses being made during the problem? (strace server or proxy with large -s value to see all read/write/sendmsg/recvmsg etc)<p>This tool fails when run as user X, probably a perms problem but which file? (strace, look for EPERM failures, probably to open())<p>Which /proc files are necessary to the operation of tool X (useful when checking what will and won't run in a sandbox like dotcloud)?<p>Main restrictions that I know of(in practice only the first is sometimes a problem to me):<p>- http/ssl hides the buffer info from 'strace -s'. Another good reason for ssl offloading :-) - IO can occur via memory reads/writes after mmap(), which strace can't see<p>ltrace is a pretty nice complement too (trace inside dynamically loaded libs).
3amOpsGuy超过 12 年前
Strace is excellent for anything crossing the syscall boundary. Often though, we want to see interactions across library boundaries.<p>A handy addition to the warrior's toolkit: <a href="http://linux.die.net/man/1/ltrace" rel="nofollow">http://linux.die.net/man/1/ltrace</a> !
reirob超过 12 年前
Actually this tool is not only for Sysadmin's - it is very helpful for developers. I know there are other tools like gdb, etc. But if you have to use (calling from your program) other programs, or if the library that you use does something strange, then strace is a shortcut.<p>From this article I learned that strace can be called to analyse an already running process (-p).
评论 #4457637 未加载
tocomment超过 12 年前
I've always been trying to find a program that will parse the strace output and create a call graph showing which programs call which programs and how long they run for.<p>Has anyone seen anything like that? I think I've searched pretty extensively.
krenoten超过 12 年前
If you're on a BSD descendant check out dtrace instead - it's got a small learning curve but it's an unbelievably powerful tracer.
评论 #4454760 未加载