From: Philippe Waroquiers Date: Sun, 23 Dec 2018 19:35:09 +0000 (+0100) Subject: Factorize producing the 'For counts of detected and suppressed errors' msg X-Git-Tag: VALGRIND_3_15_0~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36bf7c0647f25742636223df8d2f3c81ef57a6ae;p=thirdparty%2Fvalgrind.git Factorize producing the 'For counts of detected and suppressed errors' msg Each tool producing errors had identical code to produce this msg. Factorize the production of the message in m_main.c This prepares the work to have a specific option to show the list of detected errors and the count of suppressed errors. This has a (small) visible effect on the output of memcheck: Instead of producing For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from memcheck now produces: Use --track-origins=yes to see where uninitialised values come from For counts of detected and suppressed errors, rerun with: -v i.e. the track origin and counts of errors msg are inverted. --- diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 93998cfaa3..cb4268569d 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -2152,15 +2152,19 @@ void shutdown_actions_NORETURN( ThreadId tid, the error management machinery. */ VG_TDICT_CALL(tool_fini, 0/*exitcode*/); - /* Show the error counts. */ - if (VG_(clo_xml) - && (VG_(needs).core_errors || VG_(needs).tool_errors)) { - VG_(show_error_counts_as_XML)(); - } + if (VG_(needs).core_errors || VG_(needs).tool_errors) { + if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) + VG_(message)(Vg_UserMsg, + "For counts of detected and suppressed errors, rerun with: -v\n"); - /* In XML mode, this merely prints the used suppressions. */ - if (VG_(needs).core_errors || VG_(needs).tool_errors) + /* Show the error counts. */ + if (VG_(clo_xml)) { + VG_(show_error_counts_as_XML)(); + } + + /* In XML mode, this merely prints the used suppressions. */ VG_(show_all_errors)(VG_(clo_verbosity), VG_(clo_xml)); + } if (VG_(clo_xml)) { VG_(printf_xml)("\n"); diff --git a/drd/drd_main.c b/drd/drd_main.c index 79bdce2aec..3df967ef28 100644 --- a/drd/drd_main.c +++ b/drd/drd_main.c @@ -761,10 +761,6 @@ static void drd_start_client_code(const ThreadId tid, const ULong bbs_done) static void DRD_(fini)(Int exitcode) { // thread_print_all(); - if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) { - VG_(message)(Vg_UserMsg, "For counts of detected and suppressed errors, " - "rerun with: -v\n"); - } if ((VG_(clo_stats) || s_print_stats) && !VG_(clo_xml)) { diff --git a/exp-sgcheck/h_main.c b/exp-sgcheck/h_main.c index 073e66a589..1baf1cd13b 100644 --- a/exp-sgcheck/h_main.c +++ b/exp-sgcheck/h_main.c @@ -708,12 +708,6 @@ IRSB* h_instrument ( VgCallbackClosure* closure, void h_fini ( Int exitcode ) { - if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) { - VG_(message)(Vg_UserMsg, - "For counts of detected and suppressed errors, " - "rerun with: -v\n"); - } - if (VG_(clo_stats)) { VG_(message)(Vg_DebugMsg, " h_: %'10llu client allocs, %'10llu client frees\n", diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 0a3beea7d0..d75aa43d82 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -5897,11 +5897,6 @@ static void hg_print_stats (void) static void hg_fini ( Int exitcode ) { HG_(xtmemory_report) (VG_(clo_xtree_memory_file), True); - if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) { - VG_(message)(Vg_UserMsg, - "For counts of detected and suppressed errors, " - "rerun with: -v\n"); - } if (VG_(clo_verbosity) == 1 && !VG_(clo_xml) && HG_(clo_history_level) >= 2) { diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 101916b5a3..253f091dc3 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -8019,11 +8019,6 @@ static void mc_fini ( Int exitcode ) } } - if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) { - VG_(message)(Vg_UserMsg, - "For counts of detected and suppressed errors, rerun with: -v\n"); - } - if (MC_(any_value_errors) && !VG_(clo_xml) && VG_(clo_verbosity) >= 1 && MC_(clo_mc_level) == 2) { VG_(message)(Vg_UserMsg, diff --git a/memcheck/tests/addressable.stderr.exp b/memcheck/tests/addressable.stderr.exp index 8fbd9528f3..b3441cd404 100644 --- a/memcheck/tests/addressable.stderr.exp +++ b/memcheck/tests/addressable.stderr.exp @@ -77,8 +77,8 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) HEAP SUMMARY: diff --git a/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp b/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp index e4d60a5594..f637e6d0d3 100644 --- a/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp +++ b/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp @@ -937,6 +937,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 130 errors from 100 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp b/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp index 366bcc0a76..e2b863b5bf 100644 --- a/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp +++ b/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp @@ -863,6 +863,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 99 errors from 99 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le b/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le index 1cf415d501..19e1b22ebc 100644 --- a/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le +++ b/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le @@ -572,6 +572,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 66 errors from 66 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-64bit-le b/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-64bit-le index c81db9b377..d16bfe0a0d 100644 --- a/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-64bit-le +++ b/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-64bit-le @@ -572,6 +572,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 66 errors from 66 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-32bit-le b/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-32bit-le index 099af00055..34d597a085 100644 --- a/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-32bit-le +++ b/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-32bit-le @@ -463,6 +463,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 51 errors from 51 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-64bit-le b/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-64bit-le index e95bebc234..3623245951 100644 --- a/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-64bit-le +++ b/memcheck/tests/common/sh-mem-vec128-plo-yes.stderr.exp-64bit-le @@ -463,6 +463,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 51 errors from 51 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/partiallydefinedeq.stderr.exp b/memcheck/tests/partiallydefinedeq.stderr.exp index 9f38011aca..c6d1f0b553 100644 --- a/memcheck/tests/partiallydefinedeq.stderr.exp +++ b/memcheck/tests/partiallydefinedeq.stderr.exp @@ -14,6 +14,6 @@ HEAP SUMMARY: For a detailed leak analysis, rerun with: --leak-check=full -For counts of detected and suppressed errors, rerun with: -v Use --track-origins=yes to see where uninitialised values come from +For counts of detected and suppressed errors, rerun with: -v ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)