TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A few spy tools for your operating system (other than strace)

200 pointsby Audiophilipabout 10 years ago

14 comments

taliesinbabout 10 years ago
That&#x27;s indeed a useful list. lsof alone covers a lot of ground!<p>Mac OS X has a pretty nice set of DTrace scripts built in: <a href="http:&#x2F;&#x2F;dtrace.org&#x2F;blogs&#x2F;brendan&#x2F;2011&#x2F;10&#x2F;10&#x2F;top-10-dtrace-scripts-for-mac-os-x&#x2F;" rel="nofollow">http:&#x2F;&#x2F;dtrace.org&#x2F;blogs&#x2F;brendan&#x2F;2011&#x2F;10&#x2F;10&#x2F;top-10-dtrace-scr...</a><p>The ones I use the most:<p>* iosnoop: see all disk I&#x2F;O. especially useful to find disk-chatty&#x2F;poll-y apps.<p>* execsnoop: see new processes being spawned.<p>* opensnoop: see file opens. especially useful for failed file opens that break an app.<p>* dtruss: see all system calls. get access to the entire OS interaction history of an process (or app).<p>* errinfo: trace failing system calls. where there is smoke...<p>* iotop -- who is using disk<p>There is just a crazy, crazy list of things available, built-in:<p><pre><code> man -k dtrace </code></pre> Edit: wow HN formatting sucks so bad. I wish I could make that list more readable, but apparently I can&#x27;t.
评论 #9338229 未加载
评论 #9339387 未加载
评论 #9339716 未加载
评论 #9338397 未加载
评论 #9338811 未加载
_ytjiabout 10 years ago
Article mentions lsof but doesn&#x27;t go too deeply into it. lsof has an absolute _plethora_ of options and has been pretty indispensable to me. i.e. lsof -i (much akin to netstat), -u &lt;user&gt; (all files open by a particular user), etc etc. Check the man page :)
评论 #9338248 未加载
评论 #9338285 未加载
mpercyabout 10 years ago
If you haven&#x27;t seen Brendan Gregg&#x27;s Linux performance tools page &amp; slides, you should check it out. He explores a wide variety of great stuff, especially perf and ftrace (as mentioned in the article) as well as a few dozen others that he describes in lesser detail: <a href="http:&#x2F;&#x2F;www.brendangregg.com&#x2F;linuxperf.html" rel="nofollow">http:&#x2F;&#x2F;www.brendangregg.com&#x2F;linuxperf.html</a>
realusernameabout 10 years ago
I will just mention Sysdig for the ones who don&#x27;t know about it already (<a href="http:&#x2F;&#x2F;www.sysdig.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.sysdig.org&#x2F;</a>). It&#x27;s really the swiss knife of monitoring tools, you can have any kind of information you can think of. If you have not already installed it, give it a try !
oimazabout 10 years ago
can&#x27;t believe no body talks about ss (socket statistics) - <a href="http:&#x2F;&#x2F;www.cyberciti.biz&#x2F;tips&#x2F;linux-investigate-sockets-network-connections.html" rel="nofollow">http:&#x2F;&#x2F;www.cyberciti.biz&#x2F;tips&#x2F;linux-investigate-sockets-netw...</a>. It crazy fast compared to netstat
评论 #9338845 未加载
kazinatorabout 10 years ago
pmap: dump the memory mappings for a process, such as shared libs.<p><pre><code> $ pmap -x $$ 13609: -bash Address Kbytes RSS Dirty Mode Mapping 00110000 0 20 0 r-x-- libnss_compat-2.15.so 00117000 0 0 0 r---- libnss_compat-2.15.so 00118000 0 0 0 rw--- libnss_compat-2.15.so 00119000 0 20 0 r-x-- libnsl-2.15.so [ ... snip ... ]</code></pre>
rikkusabout 10 years ago
vmstat [1] is also a very useful command. It shows various essential statistics in a very compact one line display and optionally repeats this every [interval]. I often start something running while vmstat is giving me stats in another window every few seconds.<p>[1] <a href="https:&#x2F;&#x2F;www.linode.com&#x2F;docs&#x2F;uptime&#x2F;monitoring&#x2F;use-vmstat-to-monitor-system-performance" rel="nofollow">https:&#x2F;&#x2F;www.linode.com&#x2F;docs&#x2F;uptime&#x2F;monitoring&#x2F;use-vmstat-to-...</a>
rpcope1about 10 years ago
Julia mentions atop (which is good), I think htop is also worth noting here as an improvement on top.
rodgerdabout 10 years ago
One minor correction: atop doesn&#x27;t need to run as root, it does disable a couple of functions if it doesn&#x27;t.
lobster_johnsonabout 10 years ago
pidstat! It&#x27;s like top, except it prints a continuous log of everything that used CPU (or I&#x2F;O with -d, etc.) since the last sample. It&#x27;s the only too, I know that can show per-process I&#x2F;O activity. Requires root access, unlike top.
franoleabout 10 years ago
Nethogs [1] groups bandwidth usage by process. Very handy. [1] <a href="http:&#x2F;&#x2F;nethogs.sourceforge.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;nethogs.sourceforge.net&#x2F;</a>
notfossabout 10 years ago
For viewing active network connections along with traffic stats, give iftop a try.
feldabout 10 years ago
procstat, systat, sockstat, gstat, dtrace, truss on FreeBSD<p>I know there&#x27;s more I&#x27;m not thinking of...
galapagoabout 10 years ago
Don&#x27;t forget powertop