blob: 0860cb27b2a143c28354880b0254e8cc45c5ae48 [file] [log] [blame]
Jimmy Brissoncb545bd2021-01-06 13:52:58 -06001Scripts that Generate Graphs
2============================
3
4This directory contains scripts that generate graphs. Each script is run with
5bash and may require additional tools. All of the scripts require gnuplot.
6
7All scripts produce a PNG graph on stdout and the data on stderr.
8
Chris Kay32d73bc2021-12-09 14:37:06 +00009Tests by Category
10-----------------
Jimmy Brissoncb545bd2021-01-06 13:52:58 -060011
12The script `categorize-tests.bash`, and its associated awk and plot scripts,
Chris Kay32d73bc2021-12-09 14:37:06 +000013generate a stacked bar chart with bars representing groups of tests (L1 L2,
14etc.) and segments of the bars representing types. ``categorize-tests.bash``
Jimmy Brissoncb545bd2021-01-06 13:52:58 -060015accepts an argument to filter the tests included with grep.
16
Chris Kay32d73bc2021-12-09 14:37:06 +000017For example, the following will produce a graph of the Juno-specific tests:
18
19.. code-block::
Jimmy Brissoncb545bd2021-01-06 13:52:58 -060020
21 bash categorize-tests.bash juno > juno-tests.png 2> juno-tests.txt
22
Jimmy Brissonc7e28f52021-01-21 16:23:21 -060023Lines of Code by Module
24-----------------------
25
Chris Kay32d73bc2021-12-09 14:37:06 +000026The script ``sloc-viz.bash``, and its associated plot script, generate a stacked
27bar chart where each bar is a module and the bars' segments represent
28programming languages (or documentation languages). This script will produce a
29graph for whatever directory it's run within, and has special logic that
30includes more detail when run from the Trusted Firmware - A project's root
31directory.
Jimmy Brissonc7e28f52021-01-21 16:23:21 -060032
33This script has additional requirements:
Chris Kay32d73bc2021-12-09 14:37:06 +000034
Jimmy Brissonc7e28f52021-01-21 16:23:21 -060035* ``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 Kay32d73bc2021-12-09 14:37:06 +000039For example, when run from the root of TF-A, the following command line will
40graph SLOC of TF-A:
41
42.. code-block::
Jimmy Brissonc7e28f52021-01-21 16:23:21 -060043
44 bash ../<this-repo>/script/graph/sloc-viz.bash > sloc.png 2> sloc.tsv
45
Chris Kay32d73bc2021-12-09 14:37:06 +000046*Copyright (c) 2021-2022, Arm Limited. All rights reserved.*