File: README

package info (click to toggle)
bmt 0.6-1
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 324 kB
  • sloc: perl: 1,711; sh: 828; makefile: 90
file content (224 lines) | stat: -rw-r--r-- 9,223 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
********************************
* CPROVER Benchmarking Toolkit *
********************************

The benchmarking toolkit consists of three main components:

- Patch set management tools
- Benchmark execution helpers
- Result evaluation

All steps are performed by subcommands of the main `cpbm' command. Type `cpbm
help' to get the list of all subcommands.


Please report problems, bugs, questions, suggestions to Michael Tautschnig
<michael.tautschnig@gmail.com>.

Benchmark Execution Example
===========================

Download the benchmark package
$ wget http://www.cprover.org/software/benchmarks/linux-2.6.19-ddverify.cprover-bm.tar.gz

Unpack the kernel sources and the patch set
$ cpbm unpack \
  http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.bz2 \
  linux-2.6.19-ddverify.cprover-bm.tar.gz

Enter the new directory
$ cd linux-2.6.19-ddverify

Run the default benchmark configuration and produce a LaTeX table
$ cprover/rules -j4 table

Produce a TikZ graph as TeX, PDF and PNG
$ cprover/rules graph

Build a web page providing an overview table and all log files in
cprover/results.satabs.dfl.web/:
$ cprover/rules web

Patch Set Management
====================

Benchmarks consist of two files:
(1) an original source archive as obtained from its original authors, without
modification and 
(2) a corresponding patch set <NAME>.cprover-bm.tar.gz that contains all
modifications, execution scripts, and other helpers.
This design is inspired by Debian v3 source packages and may thus sound familiar
to people who are used to working with Debian packages.

(1) The original source archive must be a .zip, .tar.gz, .tgz, .tar.bz2, or .tar
    archive. If the authors of the software to be benchmarked do not offer such
    an archive, it should be built manually from whatever the authors provide as
    source.

(2) The patch set <NAME>.cprover-bm.tar.gz is created and managed by cpbm update as
    described below. The archive ships a cprover/ directory that may contain
    arbitrary files, but at least a Makefile cprover/rules must be provided. The
    patch set management scripts will populate a cprover/patches directory that
    precisely describes all modification to original sources.

The basic design of this archive solution is completely independent of the
software to be benchmarked. Its main purpose is the precise description of
changes to the original source that were made in order to benchmark some tool.

Patch set management commands
-----------------------------

- cpbm unpack: Takes an archive of original source (or a URL to download the
  archive from) and the corresponding patch set <NAME>.cprover-bm.tar.gz.
  cpbm unpack then builds the directory <NAME> from the contents of the original
  source archive, unpacks the cprover directory in <NAME>, and applies patches
  from cprover/patches, if any.
  
- cpbm init and cpbm update: Create and maintain a <NAME>.cprover-bm.tar.gz
  file. This file is initially created in the parent directory by running cpbm
  init <SOURCE ARCHIVE> from within directory <NAME> resulting from manually
  unpacking <SOURCE ARCHIVE>. This step creates the cprover/ directory and
  populates it with a template cprover/rules file.
  Once the <NAME>.cprover-bm.tar.gz file has been created for the first time, it
  will only be updated by cpbm update. To this end, cpbm update <SOURCE ARCHIVE>
  unpacks the source archive into a temporary directory, applies patches
  previously recorded in cprover/patches, and computes the diff between the
  current working directory and the contents of the patched source.
  If new changes are found, these are recorded as new patches in
  cprover/patches. The sequence of patches to be applied is stored in
  cprover/patches series. It is recommended that automatically created patches
  are renamed to more descriptive names.  Consequently such renamings must be
  reflected in cprover/patches/series.

Usage Example
-------------

Creating a new benchmark suite, e.g., for the Linux kernel:

Download the original sources from kernel.org:
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.bz2

Manually unpack them:
$ tar xjf linux-2.6.19.tar.bz2

We rename the directory to get proper benchmark name "linux-2.6.19-foo"
$ mv linux-2.6.19 linux-2.6.19-foo
$ cd linux-2.6.19-foo

Create the basic patch set linux-2.6.19-foo.cprover-bm.tar.gz
$ cpbm init ../linux-2.6.19.tar.bz2

Edit some source files ... and record patches
$ cpbm update ../linux-2.6.19.tar.bz2

To make the benchmark source and all patches available for others to use
publish linux-2.6.19-foo.cprover-bm.tar.gz and the original source archive or
its URL.

Using the benchmark suite:

$ cpbm unpack \
  http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.19.tar.bz2 \
  linux-2.6.19-foo.cprover-bm.tar.gz
$ cd linux-2.6.19-foo


Benchmark Execution
===================
 
cpbm init, as described above, creates as template the cprover/rules file (a
Makefile). For most basic use cases filling in the names of the benchmarks to be
run (e.g., all C files without the .c suffix) in the BENCHMARKS = XXX line and
choosing a suitable default configuration in CONFIG = XXX (see examples in there)
will suffice to produce a working benchmark package.
The file may, however, be fully customized as deemed necessary. The only
assumption made by cpbm is that `cprover/rules clean` performs a cleanup.
Remember to run cpbm update before distributing the .cprover-bm.tar.gz file.

The actual benchmark execution is then triggered by

$ cprover/rules -j4 verify

to perform verification of all benchmark instances in 4 parallel threads of
execution with the default configuration. This step first induces a build of
each benchmark from source, if necessary.

To choose a different configuration for the verification run, override the
CONFIG variable. For instance, to perform verification using CPAchecker's
explicit analysis use

$ cprover/rules -j4 verify CONFIG=cpachecker.explicit

Benchmark Execution Helpers
---------------------------

Benchmark execution makes use of a number of helpers:

- cpbm cillify: transform C sources using the C Intermediate Language tool to a
  format suitable, e.g., for CPAchecker or BLAST (requires Cil installation).

- cpbm list-claims: the CPROVER tools are able to selectively verify a chosen
  claim in a program under scrutiny. This tool lists the possible claims as
  pairs <CLAIM>:<STATUS>, where <CLAIM> is the identifier used by the
  verification tool and <STATUS> is either UNKNOWN, or TRUE in case a claim is
  trivially satisfied.
  If the verification CONFIG does not support specific claims (as is the case
  for all non-CPROVER tools), ALL_CLAIMS:UNKNOWN is return as pseudo claim
  identifier and verification status.

- cpbm run: actually executes the verification tool with the configured options
  and produces a log file. This log file contains the output of the verification
  tool plus environment information and statistics. All further benchmark
  evaluation is based on such log files.


Result Evaluation
=================

The names of all log files produced by cpbm run will be listed in
cprover/verified.$CONFIG. Performing

$ cprover/rules csv

yields a CSV (comma-separated value) formatted summary of all results in
cprover/results.$CONFIG.csv. This file may be read using most spreadsheet
programs for further manual inspection and evaluation. With cpbm, however, also
LaTeX tables, TikZ graphs, or web pages may be produced:

$ cprover/rules table

yields a LaTeX summary of execution times and memory usage of all benchmark
instances. With

$ cprover/rules graph

furthermore a graph is produced using TikZ and LaTeX.

$ cprover/rules web

collects all log files in a new directory cprover/results.$CONFIG.web plus an
index.html file that contains an HTML formatted version of the CSV table. Each
benchmark links to the respective log file.

These steps permits a number of customizations:

- The CSV data is produced by cpbm csv, which uses a specific parser of the
  output for each verification tool. These parsers are perl scriptlets found in
  the parse-*.pl file of the CPROVER benchmarking toolkit distribution.
  To produce additional columns in the CSV file, add further patterns to these
  parsers or copy and adapt one of the existing parsers. New parsers are
  preferably added to the distribution, but can also be put in the cprover/
  directory. If a parser exists both in cprover/ and in the distribution, the
  former will be used.

- The LaTeX table is generated using cpbm table, which takes as arguments a CSV
  file and one or more column names that shall be included (in the specified
  order) in the LaTeX output. Consequently, adding further columns to CSV output
  as described above also permits printing this output to LaTeX.

- The presently supported graphs include bar charts, scatter plots and cactus plots,
  as well some others. These are built using TikZ and LaTeX and display CPU time and
  memory usage (in box plots) or scatter plots (using cpbm graph -s) for comparison 
  of two tools. For box plots an arbitrary number of CSV files may be specified, whereas
  scatter plots require exactly two CSV files.