Jimmy Brisson | cb545bd | 2021-01-06 13:52:58 -0600 | [diff] [blame] | 1 | Scripts that Generate Graphs |
| 2 | ============================ |
| 3 | |
| 4 | This directory contains scripts that generate graphs. Each script is run with |
| 5 | bash and may require additional tools. All of the scripts require gnuplot. |
| 6 | |
| 7 | All scripts produce a PNG graph on stdout and the data on stderr. |
| 8 | |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 9 | Tests by Category |
| 10 | ----------------- |
Jimmy Brisson | cb545bd | 2021-01-06 13:52:58 -0600 | [diff] [blame] | 11 | |
| 12 | The script `categorize-tests.bash`, and its associated awk and plot scripts, |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 13 | generate a stacked bar chart with bars representing groups of tests (L1 L2, |
| 14 | etc.) and segments of the bars representing types. ``categorize-tests.bash`` |
Jimmy Brisson | cb545bd | 2021-01-06 13:52:58 -0600 | [diff] [blame] | 15 | accepts an argument to filter the tests included with grep. |
| 16 | |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 17 | For example, the following will produce a graph of the Juno-specific tests: |
| 18 | |
| 19 | .. code-block:: |
Jimmy Brisson | cb545bd | 2021-01-06 13:52:58 -0600 | [diff] [blame] | 20 | |
| 21 | bash categorize-tests.bash juno > juno-tests.png 2> juno-tests.txt |
| 22 | |
Jimmy Brisson | c7e28f5 | 2021-01-21 16:23:21 -0600 | [diff] [blame] | 23 | Lines of Code by Module |
| 24 | ----------------------- |
| 25 | |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 26 | The script ``sloc-viz.bash``, and its associated plot script, generate a stacked |
| 27 | bar chart where each bar is a module and the bars' segments represent |
| 28 | programming languages (or documentation languages). This script will produce a |
| 29 | graph for whatever directory it's run within, and has special logic that |
| 30 | includes more detail when run from the Trusted Firmware - A project's root |
| 31 | directory. |
Jimmy Brisson | c7e28f5 | 2021-01-21 16:23:21 -0600 | [diff] [blame] | 32 | |
| 33 | This script has additional requirements: |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 34 | |
Jimmy Brisson | c7e28f5 | 2021-01-21 16:23:21 -0600 | [diff] [blame] | 35 | * ``tokei`` - a quick source lines of code counting tool |
| 36 | * ``jq`` - a JSON query language for the command line, version 1.6 or later |
| 37 | as the ``--jsonargs`` option is required |
| 38 | |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 39 | For example, when run from the root of TF-A, the following command line will |
| 40 | graph SLOC of TF-A: |
| 41 | |
| 42 | .. code-block:: |
Jimmy Brisson | c7e28f5 | 2021-01-21 16:23:21 -0600 | [diff] [blame] | 43 | |
| 44 | bash ../<this-repo>/script/graph/sloc-viz.bash > sloc.png 2> sloc.tsv |
| 45 | |
Chris Kay | 32d73bc | 2021-12-09 14:37:06 +0000 | [diff] [blame^] | 46 | *Copyright (c) 2021-2022, Arm Limited. All rights reserved.* |