analysis_tools.txt 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Raptor Build Analysis Tools
  2. ============================
  3. There are a growing number of tools for analysing raptor builds. Tools become
  4. particularly important as the size and complexity of the builds becomes
  5. larger and one cannot merely "eyeball" the logs to find issues because it
  6. would take forever.
  7. Comparing Builds - is the new one a regression? sbs_diff.py
  8. ------------------------------------------------------------
  9. The Log Differ (sbs_diff.py) allows one to compare the errors,
  10. types of components etc of one build versus a control build - enabling one
  11. to see immediately if there is some important difference despite the build
  12. logs being hundreds of megabytes.
  13. It processes both builds and then creates two files diff_left.txt and
  14. diff_right.txt which can be placed into a file difference viewer like Vimdiff,
  15. Meld, kdiff etc. In a short format one can see the salient differences
  16. between two potentially enormous builds.
  17. Example - find all log files in two build output directories and compare
  18. errors between the two sets:
  19. python sbs_diff.py build1/logdir build2/logdir
  20. vimdiff diff_left.txt diff_right.txt
  21. Example - compare the logs of two specific builds:
  22. python sbs_diff.py build1/ui_build.log build2/ubuild.log
  23. vimdiff diff_left.txt diff_right.txt
  24. Finding Performance Problems
  25. ============================
  26. Which jobs take the most time? - recipestats.py
  27. ------------------------------------------------
  28. Recipestats produces a CSV file which can be imported into a spreadsheet
  29. to allow one to draw graphs. It acts on a build log and for all recipe
  30. names it counts the number of instances and the total time so that one
  31. can see what dominates a build and where to aim efforts at performance
  32. improvement.
  33. Example:
  34. python $SBS_HOME/bin/recipestats.py < logilename > stats.csv
  35. Performance of a sequence of Electric make builds - grokbuild.py
  36. -----------------------------------------------------------------
  37. Raptor produces as many as 5 makefiles per build and in a large
  38. build process raptor might be called 5 or more times. When using
  39. Electric Make, a lot of performance information is available
  40. in annotation files of which there is one per makefile but it's
  41. a great effort to gather all this information together in one
  42. place so that one can compare it and spot problems.
  43. grokbuild.py looks for annotation files and also extracts performance
  44. data from raptor logs and combines it all into one XML output file.
  45. It expects to be given a path to an epocroot directory produced by
  46. Helium build management tool. It assumes that under this directory
  47. there are output/logs/makefile and output/logs/compile directories
  48. with the annofiles and raptor log files respectively.
  49. Example:
  50. python $SBS_HOME/bin/grokbuild.py /build1 >build1_grokked.xml
  51. One can use gk2csv.py to convert this xml output into a CSV file
  52. to enable comparisons, sorting etc to be done in a spreadsheet.
  53. python $SBS_HOME/bin/gk2csv.py build1_grokked.xml > build1_grokked.csv