|
From: <sv...@va...> - 2005-05-20 02:29:54
|
Author: sewardj
Date: 2005-05-20 03:29:52 +0100 (Fri, 20 May 2005)
New Revision: 3779
Modified:
trunk/coregrind/m_errormgr.c
trunk/coregrind/pub_core_errormgr.h
trunk/coregrind/vg_main.c
Log:
Print error counts in the XML output.
Modified: trunk/coregrind/m_errormgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_errormgr.c 2005-05-20 02:10:45 UTC (rev 3778)
+++ trunk/coregrind/m_errormgr.c 2005-05-20 02:29:52 UTC (rev 3779)
@@ -253,6 +253,8 @@
{
if (VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, "<error>");
+ VG_(message)(Vg_UserMsg, " <unique>0x%llx</unique>",
+ Ptr_to_ULong(err));
VG_(message)(Vg_UserMsg, " <tid>%d</tid>", err->tid);
}
=20
@@ -664,7 +666,8 @@
}
=20
=20
-/* This is called not from generated code but from the scheduler */
+/* Show all the errors that occurred, and possibly also the
+ suppressions used. */
void VG_(show_all_errors) ( void )
{
Int i, n_min;
@@ -749,6 +752,27 @@
}
}
=20
+
+/* Show occurrence counts of all errors, in XML form. */
+void VG_(show_error_counts_as_XML) ( void )
+{
+ Error* err;
+ VG_(message)(Vg_UserMsg, "<errorcounts>");
+ for (err =3D errors; err !=3D NULL; err =3D err->next) {
+ if (err->supp !=3D NULL)
+ continue;
+ if (err->count <=3D 0)
+ continue;
+ VG_(message)(
+ Vg_UserMsg, " <pair><unique>0x%llx</unique>"
+ "<count>%d</count></pair>",
+ Ptr_to_ULong(err), err->count
+ );
+ }
+ VG_(message)(Vg_UserMsg, "</errorcounts>");
+}
+
+
/*------------------------------------------------------------*/
/*--- Standard suppressions ---*/
/*------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_errormgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_errormgr.h 2005-05-20 02:10:45 UTC (rev 3778=
)
+++ trunk/coregrind/pub_core_errormgr.h 2005-05-20 02:29:52 UTC (rev 3779=
)
@@ -49,14 +49,16 @@
}
CoreErrorKind;
=20
-extern void VG_(load_suppressions) ( void );
+extern void VG_(load_suppressions) ( void );
=20
-extern void VG_(show_all_errors) ( void );
+extern void VG_(show_all_errors) ( void );
=20
-extern Bool VG_(is_action_requested) ( Char* action, Bool* clo );
+extern void VG_(show_error_counts_as_XML) ( void );
=20
-extern UInt VG_(get_n_errs_found) ( void );
+extern Bool VG_(is_action_requested) ( Char* action, Bool* clo );
=20
+extern UInt VG_(get_n_errs_found) ( void );
+
#endif // __PUB_CORE_ERRORMGR_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-05-20 02:10:45 UTC (rev 3778)
+++ trunk/coregrind/vg_main.c 2005-05-20 02:29:52 UTC (rev 3779)
@@ -2856,6 +2856,10 @@
VG_(message)(Vg_UserMsg, "");
=20
if (VG_(clo_xml)) {
+ if (VG_(needs).core_errors || VG_(needs).tool_errors) {
+ VG_(show_error_counts_as_XML)();
+ VG_(message)(Vg_UserMsg, "");
+ }
VG_(message)(Vg_UserMsg, "<status>FINISHED</status>");
VG_(message)(Vg_UserMsg, "");
}
|