Commit Graph

64 Commits

Author SHA1 Message Date
7ab5a491ed dump-hops: needs CONFIG_INJECTIONPOINT_HOPS
Change-Id: Id884e968c903372d4f81748fbc496fea0fb7bc9e
2014-06-03 11:47:21 +02:00
277958b31b cleanups
Change-Id: I8022d937477668253c613e97c3a579ae65084b1e
2014-06-03 11:47:20 +02:00
5df364dea2 compute-hops: re-enabled memory usage lookup
Change-Id: I51c7dcac5e6077364da63f4189fea9a90c43e059
2014-01-23 18:53:21 +01:00
0e7ee03937 compute-hops: bugfix rollback-threshold
Rollback threshold was not set by command line argument.

Change-Id: I68ba63cc5cd31e3af8408f83caec8b3d7bb10c78
2014-01-23 18:53:21 +01:00
8b5098abdd tools: added compute-hops and dump-hops tools
As these tools work closely together with fail components, its
easiest, to build them in this context. As these tools don't
really matter for fail use, they might never be pushed to the
master branch.

Change-Id: I8c8bd80376d0475f08a531a995d829e85032371b
2014-01-23 18:53:11 +01:00
a307dc6df7 import-trace: fix for using non-gzipped traces
As non-gzipped trace-files cause the tool to always import zero events, the
input file is now openend as in the dump-trace tool, where opening non-gzipped
files obviously works fine.

Change-Id: If2575dbeb93ed657c7b8ddd9f14f41b5cc7bf7c6
2014-01-22 17:54:09 +01:00
c000b50101 Merge branch 'tracing-off-by-one' 2013-10-28 18:37:07 +01:00
148b09be2e tools/import-trace: added ElfImporter
The ElfImporter is not a real trace importer, but we locate it
into the import-trace utility, since here the infrastructure is
already in place to import things related to an elf binary into
the database.

The ElfImporter calls objdump and dissassembles an elf binary
and imports the results into the database.

Change-Id: I6e35673c8dbee3b7e8dfc7549d10e5dca9b55935
2013-10-24 15:30:17 +02:00
22b9646b80 import-trace: dynamic instruction off-by-one
Richard noticed that instr2 values are off by one when done with the
MemoryImporter vs. with his own importer.  The core problem is that
the dynamic instruction counter in the Importer base class
(Importer::copy_to_database, instruction_count_t instr) gets increased
*after* reporting an IP event to the importer implementation; this has
the side-effect that memory access events have a +1 dynamic
instruction count offset with regard to the IP event of the
instruction they belong to.

Bottom line: IP events and all memory events belonging to that
instruction should have the same dynamic instruction number.
Christian argued for the numbers starting with 0, which, as a side
effect, relativizes the repercussions of the change introduced in the
previous commit, as the new "first" event gets the sequence number 0
now.

 -  All experiments and importers only dealing with memory accesses
    (MemoryImporter) are affected by this change:  The dynamic
    instruction count now starts with 0 instead of 1.  Together with
    the previous commit, the only change is one additional dynamic
    instruction at position 0.  Note that existing trace files do not
    have this additional instruction, which shifts all trace positions
    by 1.

 -  All importers that process *only* IP events (InstructionImporter,
    RandomJumpImporter, RegisterImporter) won't see any difference.
    Commit 036e340, though, introduced a +1 offset.

 -  Experiments that use these instruction counts for navigating to
    the target instruction must be checked to properly deal with the
    dynamic instruction #0 (no forwarding necessary).  All dynamic
    instruction offsetting should now work uniformly for both memory
    accesses and all other fault models.  To be sure everything works
    in order, sanity-check the current absolute instruction pointer
    right before fault injection.

Change-Id: I3f509f1b47836fa78fd029a7bb7c36c878912d97
2013-10-17 18:28:40 +02:00
e636924d0f import-trace: reparse parameters after importer instantiation
Without this change, import-trace won't recognize, e.g., the -e and -t
parameters if they come after a parameter that was added by the Importer:

import-trace -i objdump --objdump arm-none-eabi-objdump -e B.elf -t C.tc
[...]
[import-trace 14:37:32] couldn't open trace.pb

Change-Id: I9532b01e432055479c79d801b1ca2736a8fd21cc
2013-10-14 14:43:47 +02:00
f2e76bfd70 bochs-runner: pass on additional arguments to fail-client
Change-Id: Icae29d819e4cbebc26e441a6daf74f9abafdb3ad
2013-09-19 14:56:49 +02:00
3307828690 import-trace: fixes for build on amd64
"std::vector<T>::size_type" is compatible to "unsigned int" on ia32,
but not on amd64.

Change-Id: I7d0f96780f7c17757dcfd015a1b3f9d5a3947f1a
2013-09-18 17:13:08 +02:00
aec5798f32 remove accidental checkin
Change-Id: I3cc42e153070b78bcea7df08ef2eddd1c838776c
2013-09-12 20:31:26 +02:00
014684ae1c L4Sys: check Bochs AS ID for mem accesses, too
Change-Id: Ifa2b38dc0e762ff4f956dc0b98c78b43f0d139cb
2013-09-12 20:29:08 +02:00
00f920f487 merge conflict resolved
... I somehow missed that one, sorry.

Change-Id: I2daf6f9215f34e39090145ff70e70eaf84d0f286
2013-09-12 09:52:34 +02:00
ec969603d5 Merge commit 'dcd2c021a5ac91d38187d397914e5f51e2fc8819'
Conflicts:
	tools/import-trace/RegisterImporter.cc

Change-Id: I4f49c976bd60badba73c15746aa03c420cb9f77b
2013-09-11 14:38:55 +02:00
04e96b977c tools/import-trace: add --do-not-split option to RegisterImporter
The RegisterImporter splits each register into 1 byte chunks. The
--do-not-split flag prohibits this splitting. Be aware, that def/use
pruning won't work correctly in mixed-width cases (EAX/AX/AH/AL).

Change-Id: Ifa1930bdd9f317a6fd3ae50c4ff3cffc97504640
2013-09-11 10:30:01 +02:00
d26fc28fa4 cpn/database: include data_width in the fsppilot during prune step
During the prune step the data_width of the injected location was not
propagated before. It is now stored in fsppilot (database layout change!) and
sent in the fsppilot protobuf message.

Change-Id: I0562f6fc8957adea0f8a9fb63469ca5e3f4b7b2d
2013-09-11 10:27:04 +02:00
f106702d44 prune-trace: remove pilot_id from fspgroup PK
There's one fspgroup entry for every trace entry, the pilot_id is
therefore *not* part of the (unique) primary key.  If this had been
right in the first place, it would have revealed an equivalence-based
fault-space pruning bug early ... :-/

Change-Id: I449d4985645c6631c0a8db0c64510364677b1354
2013-09-10 17:43:32 +02:00
d961ac0a72 import-trace: add --no-write-ecs switch
If you only need raw failure counts, no-effect write equivalence classes
are redundant and only slow down access to the trace and fspgroup tables.
This switch prevents any accesstype='W' entries from finding their way into
the trace table.

Change-Id: Ifb415994063a2107769bc80ebd2fd780de5a4dda
2013-09-10 17:43:12 +02:00
d39a9278ff import-trace: split into public and protected iface
Change-Id: I4b7d15f9181b1485d0546a77bd8d4f400b2fa880
2013-09-10 17:37:26 +02:00
64b3af299e import-trace: sliding-window AdvancedMemoryImporter
Initially this was implemented by directly passing through trace
events to the MemoryImporter, keeping a record of conditional jumps
and opcodes, and UPDATEing all inserted rows in a second pass when the
MemoryImporter is finished.

Unfortunately, UPDATE is very slow, and keeping all information in
memory till the end doesn't scale indefinitely.  Therefore the
implementation now delays passing memory access events upwards to the
MemoryImporter only until enough branch history is aggregated, and
taps into Importer's database operations with a set of new virtual
functions that are called downwards.

Change-Id: I159b2533932087087fb3049f4ff07a5f17a25a00
2013-09-10 17:37:26 +02:00
ba7c663551 import-trace: introduce AdvancedMemoryImporter
A MemoryImporter that additionally imports Relyzer-style conditional
branch history, instruction opcodes, and a virtual
duration=time2-time1+1 column (MariaDB 5.2+ only) for fault-space
pruning purposes.

Change-Id: I6764a26fa8aae21655be44134b88fdee85e67ff6
2013-09-10 17:37:26 +02:00
12b539ff75 misc cleanups
This change touches several subsystems, tools and experiments
(sal, util, cmake, import-trace, generic-tracing, nanojpeg), and
changes details not worth separate commits.

Change-Id: Icd1d664d1be5cfc2212dbf77801c271183214d08
2013-09-10 17:37:25 +02:00
25d88bf93a import-trace: import extended traces
This tool can now import extended trace information with the
--extended-trace command-line parameter.  The existing importers cease
using artificial access_info_t objects in favor of passing through the
original Trace_Event wherever possible.  This allows us to import
extended trace information for all importers.

Change-Id: I3613e9d05d5e69ad49e96f4dc5ba0b1c4ef95a11
2013-09-10 17:37:25 +02:00
96f2f56d5e Merge branch 'register-mapping-fixes' 2013-09-10 11:46:58 +02:00
11513ef78d util: handle missing register mapping gracefully
It's OK if we cannot map every register LLVM knows to a Fail register
ID, but we need to explicitly skip these cases in the
RegisterImporter.

Change-Id: I2152f819fb94aa4de5720c5798b229b66988d382
2013-09-09 16:14:35 +02:00
9cd40842d2 introduce convert-trace tool
The input (taken on stdin) is a gem5.opt --debug-flags=MemoryAccess
trace (--format gem5), or a dump-trace output (--format dump) for easy
trace synthesis (for testing purposes).

gem5 format: Currently imports physical, not virtual memory addresses.
dump format: Currently ignores extended trace information.

Change-Id: Ic26a996d6fb9ce4175c855fadcbcff9ac9263888
2013-09-08 22:16:08 +02:00
f33789b1ac Merge branch 'find-mysql' 2013-09-04 13:09:48 +02:00
203ec6c5cc remove #ifndef __puma from code using LLVM
Contemporary AspectC++ versions can deal with the LLVM headers very
well, and #ifdef __puma stuff in Fail* headers results in
unmaintainable #ifdef __puma blocks in other parts of Fail* (e.g., the
trace importer).

Make sure you're using a 64-bit ac++ when living in a 64-bit userland
(the 32-bit version doesn't know about __int128), and be aware that
AspectC++ r325 introduced a regression that has not been fixed yet.

Change-Id: I5bb759b08995a74b020d44a2b40e9d7a6e18111c
2013-09-04 10:13:48 +02:00
2108c8932f util: disassembler register/address mapping fix
For def/use pruning, the linear address mapping of the x86
sub-registers (e.g., AX represents the lower 16 bits of EAX) must
overlap.  If it doesn't, e.g., AX and EAX are considered separate
registers by def/use pruning, resulting in a failure to correlate an
EAX def with a subsequent AX use.

The only user of this mapping up to now, RegisterImporter, forced all
register widths to 8 bits, thereby fortunately canceling out this
problem.  Nevertheless it makes no sense to continue encoding a
constant width in these virtual addresses.

Existing trace, fspgroup, fsppilot and result tables may be converted
to the new encoding by using this query:

UPDATE <tablename> SET data_address = ((data_address >> 4) & ~0xf) | data_address & 0xf;

Change-Id: I7a942b78c34f6140803a86af639eeedef3550f34
2013-09-02 09:50:55 +02:00
1ad99c9630 cmake: find MySQL client lib
This change introduces a CMake-style FindMySQL.cmake properly looking for
libmysqlclient_r with mysql_config.  This also fixes linking on some
machines.

Change-Id: Ifdbfdc3c7440dead37a8b63aaa86732d636aa0e2
2013-08-29 19:21:31 +02:00
64840c02e4 import-trace: compile with both LLVM 3.1+3.3
Commit 52322ac broke compilation with LLVM 3.1.

Change-Id: Ia0e1d91258e6be799cfbd3b6e9693894a6bc5650
2013-08-23 11:26:40 +02:00
32e041543c import-trace: remove --importer-args parameter
The parameter has no effect and has been superseded by
Importer::cb_commandline_init().

Change-Id: I8c2f26c878a1ff409a6b5e3ee35d93dea775b583
2013-07-16 12:20:51 +02:00
bc7ad24142 dump-trace: extended trace information dump configurable
This adds the same --extended-trace commandline switch as import-trace has.

Change-Id: I9c13df7b1df0f48ceeb7d1ebfa1a3ad45684c6a8
2013-07-11 10:38:54 +02:00
52322ac7b9 import-trace: compile with LLVM 3.3
This was necessary because LLVM 3.1's
ELFObjectFile<ELFT>::sectionContainsSymbolsectionContainsSymbol() (needed
for proper functioning of our LLVM disassembler, unless you're using
-ffunction-sections) is "unimplemented".

Change-Id: I81112627ebd1c92b718ac6f4ed58d7f188aedf0c
2013-07-11 10:38:54 +02:00
6c9bb21ab3 import-trace: introduce RandomJumpImporter
The random jump importer defines trace events, that indicate all
possible jumps into a specific instruction range. The region where
jumps should start can be defined by a memory map given with
--jump-from. For each instruction declared in that memory range, all
possible jumps to a memory region specified by with --jump-to are
inserted. The target of the jump is saved in the data_address
field. So all database tools work as expected.

for each event E \in region(--jump-from):
    foreach Instruction in region(--jump-to):
         insert_trace(injection_instr = E.IP(), data_address = Instruction.addr)

Change-Id: Ie163968acae47fc6c946fc77774c47ee07950bab
2013-07-05 10:19:58 +02:00
f47d50b182 import-trace: introduce RegisterImporter
The RegisterImporter disassembles the binary and adds a trace event
for each byte read or written from register. The register number (Fail
Register Numbers are used) and the offset within the register are
encoded within the trace event.

Change-Id: I2d2fd720841fedeeff5f28b64f24ec5f6d2ea0c3
2013-07-05 10:19:58 +02:00
bedb9c2eb2 import-trace: introduce InstructionImporter
The InstructionImporter does disassemble the binary and generate read
traces for every instruction byte executed.

Change-Id: I6b8697c711c009e106ed733c74c6ff8f9bbf8ac5
2013-07-05 10:19:58 +02:00
8e5aa9b1bd tools/dump-trace: dump extended traces properly
Output formatting was broken for extended traces (with register data
information etc.) before.

Change-Id: I48ca548ab29ecc855d803ce46a7713ef801f53f0
2013-07-04 10:41:22 +02:00
501384b0f4 import-/prune-trace: primary keys reordered
data_address is definitely part of the unique key to trace entries, but
instr2 is arbitrary (could be instr1, time1 or time2 as well).  Moving
data_address up the hierarchy to speed up certain FSP experiments.

Change-Id: I37a1f6c1e5b3957ba2f5bf46e0cd1a9c4aa7bfef
2013-07-03 13:46:55 +02:00
12aec4c1a4 import-trace: add --no-delete command line option
Change-Id: I1b100c2b11d28396b024478dc1d1af6118c644d6
2013-07-03 13:19:31 +02:00
be8d5edbc3 import-trace: reorder functionality in importer
BasicImporter is renamed to MemoryImporter. An alias for BasicImporter
in the cmdline interface will remain. The MemoryImporter does now only
handle memory and IP events. The simulation time, dynamic instruction
count and handling of open ECs is moved to Importer.

Change-Id: I04eb0fd4b52fbf5b0ca9ab97778a62130cb626ee
2013-07-03 13:19:12 +02:00
81fe0ea628 import-trace: dropped DCiAOKernelImporter
This importer is so similar to the basic importer, that it can be
dropped. The current state was used in the SOBRES 2013 Paper.

Change-Id: Ibed1af6e1a72286500d42e83e594557d6dcf3803
2013-07-03 13:17:53 +02:00
4750fa98a4 tools/dump-trace: --stats shows trace info only
The new parameter -s/--stats shows trace statistics such as number of
instructions, number of memory reads/writes, and duration in simulator
time.

Change-Id: I39a48ff62d9c308c420fe52e7ed17ed57ae9c139
2013-05-29 16:29:09 +02:00
950adac80e tools/import-trace: cover complete fault space
We need to cover the complete fault space when a memory map is
provided.  This means fake trace entries for completely unaccessed
addresses (e.g., unused parts of the stack), and makes sure we include
all of our fault space in the statistics later.

Without a memory map, we just don't know the extents of our fault
space; just guessing by using the minimum and maximum addresses is not
a good idea, we might have large holes in the fault space.

Change-Id: Ieb4b30a2e41a9921b969bf88513bfbacfc290c93
2013-05-29 16:29:08 +02:00
6789a313a9 DCiAOKernelImporter: different injection semantic.
Is now very similar to normal importer, and may be deleted in the future, but
at the moment, this should be merged, since it is the importer used in the
sobres-2013 paper.

This changes the MySQL Schema. instr1_absolute was introduced.

Change-Id: I1bc2919bd14c335beca6d586b7cc0f80767ad7d5
2013-05-29 16:17:03 +02:00
56bfa6c693 tools/prune-trace: various improvements
- Variants/benchmarks can now be selected with wildcards
  (--variant/--benchmark), and can be excluded from pruning
  (--variant-exclude/--benchmark-exclude).
- The database clearing step can be skipped with --no-delete to
  avoid deadlocks with concurrent DB accesses.
- Internals:
  * injection_instr / injection_instr_absolute moves from
    fspgroup to fsppilot.  fsppilot now contains all information we
    need for running FI experiments.
    TODO: generic campaign needs to be modified, too.
  * Force MySQL to use an efficient join order (STRAIGHT_JOIN).

Change-Id: I6241ea2de9da1a1e709fae6374df4fc06ef262a0
2013-04-22 14:24:50 +02:00
79363aec21 tools/import-trace: sanity checks
These can be enabled if something looks fishy.

Change-Id: Iba4f73dc0a70ec4e548456edb36e21fecbaad410
2013-04-22 14:24:50 +02:00
9273872d43 tools/import-trace: import timing information + various additions
- Import timing information from traces that were recorded with timing.
- Allow restricting import to a memory map ("vertical" restriction).
- Proper fault-space right-margin handling.
- Cleanups, data-type usage, etc.

Change-Id: I7a49e8e9e49894c458e884bfc234f36b9ba8b130
2013-04-22 14:24:50 +02:00