Ikke's Blog

Post details: Who's abusing my SATA controller?

Mar 22
Who's abusing my SATA controller?

Just read this interesting post. Had to change the read command somewhat to match my dmesg format (timestamps, you know).

Anyway, here's the result:
$ su -
# /etc/init.d/syslog-ng stop
# echo 1 > /proc/sys/vm/block_dump
# echo "Wait some time here, just use your desktop as usual"
# dmesg | gawk '/(READ|WRITE|dirtied)/ {activity[$3]++} END {for (x in activity) print activity[x],x}'| sort -nr | head -n 10 | gawk '{print $2 " " $1}'
pdflush(215): 160
evolution(7736): 149
pdflush(7670): 126
firefox-bin(7748): 26
gaim(7146): 12
jfsCommit(221): 5
gconfd-2(7114): 5
mono(7200): 4
mono(7199): 4
jfsIO(220): 4
# echo 0 > /proc/sys/vm/block_dump
# /etc/init.d/syslog-ng start
# exit

Comments:

Comment from: Jeff Schroeder [Visitor] Email · http://www.digitalprognosis.com
Very sweet little hack. Thanks for the awk-foo.
PermalinkPermalink 03/22/07 @ 21:57
Comment from: Paul M [Visitor] Email
The number of times I've wanted something like this.

Now I just need to remember it!
PermalinkPermalink 03/22/07 @ 22:39
Comment from: Jeff Schroeder [Visitor] Email · http://www.digitalprognosis.com
On Ubuntu Linux with standard syslogd, this is the proper awk command:

dmesg | awk '/(READ|WRITE|dirtied)/ {activity[$2]++} END {for (x in activity) print x, activity[x]}'| sort -nr | head -n 10

Also notice that I managed to cut out a pipe | gawk by switching the x order around.

Thanks for this awesome tip!
PermalinkPermalink 03/22/07 @ 22:57
Comment from: Jeff Schroeder [Visitor] Email · http://www.digitalprognosis.com
And as a final comment, it dawned on me that this could be somewhat less ugly in perl so here is a hacked up version in perl:

http://www.digitalprognosis.com/opensource/scripts/topio.pl
PermalinkPermalink 03/23/07 @ 03:22

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Categories

Who's Online?

  • Guest Users: 120

Misc

XML Feeds

What is RSS?