)]}'
{
  "commit": "59da66849215eccf1dce2154c84f217a3c39678b",
  "tree": "cdb2e7a8c9af492e64ebfef23f2ff6d6d368c0a6",
  "parents": [
    "0c1592d93585ddce572a71a77534ca765c5f5d34"
  ],
  "author": {
    "name": "Stefan Hajnoczi",
    "email": "stefanha@linux.vnet.ibm.com",
    "time": "Tue Feb 22 13:59:41 2011 +0000"
  },
  "committer": {
    "name": "Aurelien Jarno",
    "email": "aurelien@aurel32.net",
    "time": "Sun Mar 06 19:06:33 2011 +0100"
  },
  "message": "simpletrace: Make simpletrace.py a Python module\n\nThe simpletrace.py script pretty-prints a binary trace file.  Most of\nthe code can be reused by trace file analysis scripts, so turn it into a\nmodule.\n\nHere is an example script that uses the new simpletrace module:\n\n  #!/usr/bin/env python\n  # Print virtqueue elements that were never returned to the guest.\n\n  import simpletrace\n\n  class VirtqueueRequestTracker(simpletrace.Analyzer):\n      def __init__(self):\n          self.elems \u003d set()\n\n      def virtqueue_pop(self, vq, elem, in_num, out_num):\n          self.elems.add(elem)\n\n      def virtqueue_fill(self, vq, elem, length, idx):\n          self.elems.remove(elem)\n\n      def end(self):\n          for elem in self.elems:\n              print hex(elem)\n\n  simpletrace.run(VirtqueueRequestTracker())\n\nThe simpletrace API is based around the Analyzer class.  Users implement\nan analyzer subclass and add methods for trace events they want to\nprocess.  A catchall() method is invoked for trace events which do not\nhave dedicated methods.  Finally, there are also begin() and end()\nmethods like in sed that can be used to perform setup or print\nstatistics at the end.\n\nA binary trace file is processed either with:\n\n  simpletrace.run(analyzer) # uses command-line args\n\nor with:\n\n  simpletrace.process(\u0027path/to/trace-events\u0027,\n                      \u0027path/to/trace-file\u0027,\n                      analyzer)\n\nSigned-off-by: Stefan Hajnoczi \u003cstefanha@linux.vnet.ibm.com\u003e\nSigned-off-by: Aurelien Jarno \u003caurelien@aurel32.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "553a72709f99901b409085dd8ea5581985024405",
      "old_mode": 33261,
      "old_path": "scripts/simpletrace.py",
      "new_id": "9fe3dda0769ae49a5d3b872d7e6258fd0b3fc68d",
      "new_mode": 33261,
      "new_path": "scripts/simpletrace.py"
    }
  ]
}
