Collect Runtime Information for Each MySQL Test - Tue, 12:34 AM Aug 5 2008
In a previous post, I talked about the method Skoll used to collect MySQL runtime information for non-default configurations. At the time, the runtime information was collected after all of the MySQL tests were executed, which means the runtime information was accumulated from all tests run. There was no way to decipher how each test contributed to this accumulated runtime information. A greater degree of granularity can provide better understanding of the MySQL runtime behavior.
To collect runtime information for each MySQL test, the Skoll client still compiles MySQL as described in the previous post. Instead of running the "mysql-test-run" script with no arguments (which runs all available tests in the source tree), Skoll client calls "mysql-test-run [TESTCASE]" to run one specific test. After this test finishes, Skoll client collects the runtime information and then repeats the process for other tests. However, to make this work, two tasks must be handled:
- Skoll client needs to know which tests are available in the MySQL source tree. The tests are located in the "mysql-test/t" directory. Each test is in a file "[TESTCASE].test", and the filename is the test name (additional test suites are in "mysql-test/suite/[TESTSUITE]/t" directories). It's pretty straight forward for Skoll client to browse through the directory to make a list of tests.
- Runtime information from the previous test must be cleared before the next test starts, because gcov accumulates runtime information from numerous executions in data files with extension *.gcda. Therefore, after each test Skoll client must recursively go through the source directories and delete those files in order to collect per test runtime information.
|