Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What am I missing? all mysql calls have to go over a system call, so strace will see them (as write() or send() I guess).

Why use ltrace for this job?



Using strace to trace mysql traffic is painful. You have to know which file descriptors to trace (check via lsof first), then trace all network traffic on those fds in verbose mode to see the queries themselves (doesn't work if the mysql protocol has compression enabled), and then try to figure out how long each of the queries took to execute by matching queries and responses.

ltraceing mysql_send_query() gives you all this information in one line.


Plus, you can trace a lot more than mysql queries.. commonly used libraries like libMagick, libxml, libcurl, libmemcached, and even internal VM functions like garbage_collect(), PyEval_SafeThread(), etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: