Chapter 3. Helper Components

Performing these tests and generating the reports requires a fair amount of work to setup the target and generate/calculate the result data; all of which can be automated. This section presents those helper programs and scripts.

3.1. Host Helper Components

3.1.1. plotlatency.sh

Convert a latency-server log file from text to two graphs
 - a measurement/loadavg graph and a histogram.
Usage: plotlatency.sh [options] <hist:boxes> <hist:spacing> <input file>
  where:
    <hist:boxes> indicates the granularity of the histogram
    <hist:spacing> indicates the width of each histogram box
    <input file> contains output from the latency-client application
  input file format:
    <date> <time> <iteration> <measurement> <loadavg> <average> <max> <min>
  options:
     -h      this help screen
     -y N    set max y value for measurements (default=1000)
     -l N    set max y value for loadavg (default=5)
        

This script takes a log file generated by the latency-server application and generates two graphs from it:

  1. a graph showing the latency measurements and loadavg

  2. a histogram of the latency distribution

In order to be able to generate these two graphs, in addition to the log file you also have to provide the number of boxes as well as the width of each box which indicate the granularity of the histogram. By default the first graph of the latency measurements will use a maximum value of 1000, but you can change that by specifying the -y option. If you need to specify the maximum Y value for the loadavg graph use the -l (ell) option.

This script requires the following components:

3.1.2. getstats.sh

Process a result file and generate entries for inclusion in this report.
Usage: getstats.sh <hist:boxes> <hist:spacing> <result file>
  where:
    <hist:boxes> indicates how many boxes to create for the histogram
    <hist:spacing> give the spacing that was provided for the histogram
    <result file> is a file containing the results to process
        

The results section of this report contains all the pertinent information needed to compare the performance of the boards and kernels under investigation. Some of those fields are easy to get, they're found in the resulting log file; others need to be calculated. This script takes a result log file and provides all the needed information. As an added bonus, the data returned already contains all the required DocBook markup.

In order to generate the histogram information for this report the script also needs to know the granularity of the histogram values; therefore the number of boxes as well as the width of each box needs to be supplied. It's probably a good idea to use the same histogram values as were used to generate the corresponding graph (the parameters to plotlatency.sh).

This script requires the following components:

  • The freqcurve application from this package.

3.1.3. freqcurve

Generate Frequency Curve Numbers
Usage: freqcurve [options] <boxes> <spacing> <data file>
  where:
    <boxes>     The number of frequency categories to create. [unsigned int]
    <spacing>   The width of each category. [float]
    <data file> The file to process (one column of numbers).
  options:
    -h | --help   Print this usage information and exit.
    -g | --graph  Present final data for use with GNU plotutils graph application.
NOTE: categories start at 0
The program will then spit out <boxes> number of numbers all on one line.
Each one represents the number of entities per box.
        

This application generates the histogram numbers given an input file. The required granularity needs to be provided as the number of boxes to use and the width of each box. A count of values found that fall outside the range specified will be printed to stderr as a lost count.

The -g option will ask this application to output the histogram numbers in (x y) format (without the parenthesis) which can be used as the input to the graph application.

3.1.4. ascii2docbook

This application filters plain ASCII and transforms any DocBook special characters into the corresponding CDATA which can then be included directly into the report's text. This is useful for when including patches, config files, or program help text. It is a very simple lex program.