SWAG >> MySQL Fact Extraction


If you intend to perform all of the steps involved in extracting facts from MySql you will need to complete the following steps on a 32 bit linux machine since asx will only currently run on such machines.

If you merely wish to view the resulting facts extracted, do so by downloading mysql.ta to the machine of your choice, and running lsedit there.

If you wish to be able to view source code, either directly or from within lsedit, you will need to extract that source to the machine of your choice, and configure lsedit to use the editor of your choice to view such source.

MySQL fact extraction steps

The following are all of the steps needed to perform fact extraction, given that one starts with nothing.

  1. Download MySQL from http://dev.mysql.com/downloads, or get a local UofW copy of this file from mysql-5.0.67.tar.
  2. Create a suitable working directory and extract the files in the download into this directory using tar xvf mysql-5.0.67.tar.
  3. Create shell scripts that capture the information about how MySQL is built as described in the asx webpage.
  4. Perform superficial tests to validate that your wrapping shell scripts around gcc, g++ and asm work.
  5. Configure the build process by issuing the command ./configure.
  6. Make sure the log you are going to capture the build history into is empty!
  7. Build MySQL by issuing the command ./make, and check that the build completed successfully.
  8. Check mysql.history log captured from the build process, and remove any parts of the build process not deemed relevant to the fact extraction.
  9. When happy with the captured log, disable the logging of information into the build history.
  10. Download, optionally compiling and installing asx, or obtain a copy of asx from "swag:~ijdavis/bin/asx".
  11. Set the asx environment variables appropriately. I used ASX_IGNORE="o;a;so" to reduce some clutter in the facts otherwise extracted by asx.
  12. Run asx < mysql.history > mysql.ta.
  13. If you don't already have Sun's java installed on your machine download and install it from www.java.sun.
  14. Download and build lsedit.
  15. To view the facts extracted use:
    "java -classpath .;bunch.jar -Xms128M -Xmx1024M lsedit.LandscapeEditorFrame mysql.ta".
  16. The library bunch.jar need only be specified if you wish to use the bunch clustering facilities from within lsedit.

Just obtaining the source code

Much of the source code provided in the tarball is itself compressed. In an attempt to ease the pain here for those who merely want to view the source code of mysql, download the following source.zip and uncompress that.

It is likely that you will not place the source code in precisely the place that I placed it when creating the mysql.ta file. To correct the differences in software location here, change the named location of the root directory by clicking on this root directory in lsedit, pressing 'a' and then alter the file field appropriately. You can check that the value has been changed by closing the attribute dialog box and then reopening it.

To open source code once this has been done from either an edge or a node that has file/lineno information in its attributes, go to options in the menu bar, and then Specify command. There are a number of example ways of opening up software to visualise source code (you are welcome to submit others for inclusion in the list of examples). Basically the top white line names the command to be executed, and each of the lines in the grey box specify a single parameter to this command. At run time $(X) gets changed into the value of the X attribute in the object which is selected when one invokes the command. Note that one can have more than one command by changing the hot key name in the right hand bottom corner any of (h, f4-f10). If any of the examples work for you just press set to use it. Otherwise choose the best example and then change the values in the dialog after pressing set.

Grok and JGrok

If you wish to manipulate the facts extracted you may use either grok or jgrok. Note that grok is more stable but runs only on linux platforms. JGrok should work on any machine that supports Sun Java.

Contact information

For more information on MySql fact extraction please contact us at .