Synopsis
nvtrace is a new variation (yes, yet another) of valgrind-mmt. It is meant to be the ultimate program for tracing what the blob does, intercepting any communication to the driver. It has the following advantages
- Automatic tracking of NVidia ioctls to find which regions to watch
- Provide some info on the meaning of ioctl calls, and print all values passed in and out
- Track 8 and 16 byte writes and reads (as generated by MMX/SSE instructions)
- Each mmap'ed region gets an unique serial number, for easy "postprocessing" with grep and other tools
Supported hardware
I have mainly used this for NV50 tracing, it is possible that different ioctls are used for different cards, so that it might miss some mappings on some hardware. It generally works like this:
- ioctl returns an 64-bit offset value
- GL driver mmaps maps this offset of /dev/nvidiaX to memory
If you find any other ioctls that "initiate" such a mmap sequence, let me know.
Also, the API might change slightly with different blob driver versions. The driver versions I tested with are 100.14.19 and 100.14.11.
Usage
Usage should be straightforward, as it's the same as valgrind-mmt, but without any parameters, I.E.
valgrind --tool=mmt <program>
Download
There is currently no distribution, but you can get the sources directly from SVN:
svn co --username anonymous https://svn.strangled.net/repos/nvtrace/trunk
The password for anonymous is empty (as in "" empty, not the word empty).
Building is easy too, just do
$ ./autogen.sh $ ./configure --prefix=/opt/some/prefix $ make $ make install

