How to use procmon to trace mysqld.exe filesystem access
This article provides walkthrough on using Process Monitor on Windows, tracing file system access by mysqld.exe during "install plugin" call.
Download
Process Monitor is an advanced monitoring tool for Windows that shows real-time file system, Registry and process/thread activity. It is a part of sysinternals suite developed by Mark Russinovich and Bryce Cogswell. Process monitor can be directly downloaded from http://download.sysinternals.com/files/ProcessMonitor.zip . More description can be found at http:technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Installation
There is no installation necessary, the single executable can be used after unpacking. I suggest to put procmon into a some directory in PATH.
Example of taking a mysqld.exe trace
The purpose of the following exersize is to learn how to use procmon to trace mysqld.exe calls to filesystem.
We assume that mysqld.exe is already started. 1. Start procmon.exe . Dialog will pop up that offers to set filter. Use this dialog to set filter to "Process name" "is" "mysqld.exe", as show in the screenshot below.
Click on "Add" button to mysqld.exe to include it in the filter, "Apply" and "OK".
2. Capture events (Menu File=>Capture Events (Ctrl+E)
3. Start mysql command line client and connect to the server Execute
mysql> install plugin blackhole soname 'ha_blackhole.dll'; Query OK, 0 rows affected (0.03 sec)
4. Saving the trace
Back to Process Monitor Windows, you should see the filesystem events initiated by the "INSTALL PLUGIN" operation
To save it, Chose File/Save.
(Advanced) Seeing stack traces corresponding to events
It is also possible to see stacktraces corresponding to the events. For this to work , symbols support needsto be configured.
1. Install Debugging Tools for Windows (google on how to do that) 2. Switch to Process Monitor's menu Options => Configure symbols. 3. Add dbghelp.dll from your installation of Debugging Tools into "dbghelp.dll path" input field . On my system it is C:\Program Files\Debugging Tools for Windows (x64)\dbghelp.dll
4. In "symbol path" input field,add srv*C:\symbols*http://msdl.microsoft.com/download/symbols;<path\to\you\installation\bin> (substitute last last path element with real path to your installation)
This is how it looks on my machine: