I enabled "display query log" in Devel. However, I've noticed not all queries are logged, for instance when enabling/disabling a module there is no "update system set status = 1.." query shown. Why is that? Thanks.
I found the answer: enable/disable module calls are ajax requests and the devel display query log doesn't show queries from the ajax request.
BTW, if you want to use hook_exit() you will notice it is not fired for ajax calls that use exit() and not drupal_exit(). However, if you need something to be run at runtime end, you can use PHP register_shutdown_function() in your module (in your hook_init() for instance).