Allow tools to provide some statistics in suppression list produced at the end

Option -v outputs a list of used suppressions. This only gives
the nr of times a suppression was used.
For a leak search, this only gives the nr of loss records that
have been suppressed, but it does not give additional needed details
to understand more precisely what has been suppressed
(i.e. nr of blocks and nr of bytes).

=> Add in the tool interface update_extra_suppression_use and
print_extra_suppression_info functions to allow the tool to record
additioonal use statistics for a suppression. These statistics
can be done depending on the error (and its data) which is suppressed.

Use this in memcheck for the leak suppressions, to maintain and output
the nr of blocks and bytes suppressed by a suppression during
the last leak search.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13651 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c
index af0bfcf..8bfd02a 100644
--- a/memcheck/mc_leakcheck.c
+++ b/memcheck/mc_leakcheck.c
@@ -474,6 +474,10 @@
 // The below avoids replicating the delta_mode in each LossRecord.
 LeakCheckDeltaMode MC_(detect_memory_leaks_last_delta_mode);
 
+// Each leak search run increments the below generation counter.
+// A used suppression during a leak search will contain this
+// generation number.
+UInt MC_(leak_search_gen);
 
 // Records chunks that are currently being processed.  Each element in the
 // stack is an index into lc_chunks and lc_extras.  Its size is
@@ -1646,7 +1650,7 @@
    // before checking for (smaller) page skipping.
    tl_assert((SM_SIZE % VKI_PAGE_SIZE) == 0);
 
-
+   MC_(leak_search_gen)++;
    MC_(detect_memory_leaks_last_delta_mode) = lcp->deltamode;
    detect_memory_leaks_last_heuristics = lcp->heuristics;