

Using DTrace to observe the SQL statements on a live running MySQL database - qhoxie
http://blogs.sun.com/angelo/entry/observing_mysql_sql_statements_in

======
timtrueman
I generally use <http://iank.org/querysniffer/mysqlsniff-0.10.html> to get
real queries. Works even on remote databases you don't have access to turn on
query logging. Not to say DTrace isn't freaking awesome. (Check out
Instruments in the Developer Tools on Leopard if you want to see DTrace but
through a GUI).

------
tptacek
One thing this is useful for: security testing. Get your web application up
and running under OpenSolaris, OS X or FreeBSD, then run a "web fuzzer" like
Burp Suite or WebScarab against it, while watching the queries in the backend.
It'll give you a quick and dirty way to see how user inputs are being passed
through to the database.

------
jbert
It's not the greatest example (since there are various ways to get SQL queries
from a live mysql db - tcpdump/ngrep, query logging or strace from a client -
you could strace the server but mysql appears to die when you strace it -
dunno why).

Everyone who I know who has used dtrace loves it - so it seems likely to me
that it is great+useful tech - but can someone come up with a real-world
example of info it can give you that you can't get with tcpdump/strace?

------
sant0sk1
This looks really cool. Anybody know about DTrace support for Linux
(specifically, Debian)?

~~~
timtrueman
There's a lot of debate about its license CDDL, versus the GPL.

Either way there's a port being developed currently:
<http://www.crisp.demon.co.uk/blog/index.html>

~~~
orib
It's not so much as a debate as the maintainers and legal people saying "hell
no, their code is incompatible. you'll have to do a clean-room implementation
for it to land", and some people saying "but we really want it." Plus, there
are the usual "GPL is bad" trolls.

------
balpreetspankaj
instruments in Xcode is based on top of dtrace and is awesome.

