Re: Make'em suffer!



I wrote:

> > So now we can integrate this great torture test into the continuous
> > integration systems like jhautobuild or buildbot, for automatic
> > testing/profiling to detect performance regressions and so.
> 
> So great.  Thanks Manu & Fernando.

Patched gtk-theme-torturer to provide XML log (attached); patched
jhbuild to upload it, sample output available on
  http://jhautobuild.0d.be/builds/2006-08-08-0000/logs/gtk-theme-torturer/#test-results

It still needs to be integrated in the full daily build so results can
be aggregated and pretty lines can be drawn.



        Frederic
diff -Naur /tmp/soc-gtk/gtk-theme-torturer/Makefile gtk-theme-torturer/Makefile
--- /tmp/soc-gtk/gtk-theme-torturer/Makefile	2006-08-08 11:47:50.000000000 +0200
+++ gtk-theme-torturer/Makefile	2006-08-08 09:16:22.000000000 +0200
@@ -23,3 +23,6 @@
 
 clean:
 	rm -f *.o torturer
+
+log.xml: torturer
+	./torturer -t -X > log.xml
diff -Naur /tmp/soc-gtk/gtk-theme-torturer/torturer.c gtk-theme-torturer/torturer.c
--- /tmp/soc-gtk/gtk-theme-torturer/torturer.c	2006-08-08 11:47:50.000000000 +0200
+++ gtk-theme-torturer/torturer.c	2006-08-08 11:49:42.000000000 +0200
@@ -16,6 +16,7 @@
 gdouble    total_map = 0.;
 gdouble    total_expose = 0.;
 gdouble    total_destroy = 0.;
+gboolean   xml_output = FALSE;
 
 static void 
 initialize_types (void) {
@@ -193,10 +194,22 @@
   gtk_widget_profiler_profile_expose_with_resize (profiler, 0.1, 0.5);
   total_expose_in_resize = total_expose;
   
-  fprintf (stderr, "\n%s: total times for 3 * %i iterations\n", g_type_name (types[current_widget_type]), n_iter);
-  fprintf (stderr, "%s\nTotal boot time for %i iterations:\n--> Create: %g sec (average %g sec)\n--> Map: %g sec (average %g sec)\n--> Expose: %g sec (average %g sec)\n--> Destroy: %g sec (average %g sec)\n%s\n", separator, n_iter, total_create, total_create / n_iter, total_map, total_map / n_iter, total_expose_in_boot, total_expose / n_iter, total_destroy, total_destroy / n_iter, separator);
-  fprintf (stderr, "Total expose time for %i iterations:\n--> Expose: %g sec (average %g sec)\n%s\n", n_iter, total_expose_in_expose, total_expose_in_expose / n_iter, separator);
-  fprintf (stderr, "Total expose/resize time for %i iterations:\n--> Expose: %g sec (average %g sec)\n%s\n\n", n_iter, total_expose_in_resize, total_expose_in_resize / n_iter, separator);
+  if (!xml_output) {
+    fprintf (stderr, "\n%s: total times for 3 * %i iterations\n", g_type_name (types[current_widget_type]), n_iter);
+    fprintf (stderr, "%s\nTotal boot time for %i iterations:\n--> Create: %g sec (average %g sec)\n--> Map: %g sec (average %g sec)\n--> Expose: %g sec (average %g sec)\n--> Destroy: %g sec (average %g sec)\n%s\n", separator, n_iter, total_create, total_create / n_iter, total_map, total_map / n_iter, total_expose_in_boot, total_expose / n_iter, total_destroy, total_destroy / n_iter, separator);
+    fprintf (stderr, "Total expose time for %i iterations:\n--> Expose: %g sec (average %g sec)\n%s\n", n_iter, total_expose_in_expose, total_expose_in_expose / n_iter, separator);
+    fprintf (stderr, "Total expose/resize time for %i iterations:\n--> Expose: %g sec (average %g sec)\n%s\n\n", n_iter, total_expose_in_resize, total_expose_in_resize / n_iter, separator);
+  } else {
+    fprintf (stdout, "<widget name=\"%s\">\n", g_type_name (types[current_widget_type]));
+    fprintf (stdout, "  <iters>%i</iters>\n", n_iter);
+    fprintf (stdout, "  <timing name=\"boot\" subname=\"Create\">%g</timing>\n", total_create);
+    fprintf (stdout, "  <timing name=\"boot\" subname=\"Map\">%g</timing>\n", total_map);
+    fprintf (stdout, "  <timing name=\"boot\" subname=\"Expose\">%g</timing>\n", total_expose);
+    fprintf (stdout, "  <timing name=\"boot\" subname=\"Destroy\">%g</timing>\n", total_destroy);
+    fprintf (stdout, "  <timing name=\"expose\" subname=\"Expose\">%g</timing>\n", total_expose_in_expose);
+    fprintf (stdout, "  <timing name=\"expose/resize\" subname=\"Expose\">%g</timing>\n", total_expose_in_resize);
+    fprintf (stdout, "</widget>\n");
+  }
   
   g_free (separator);
  }
@@ -205,9 +218,12 @@
 full_torture (void) {
   int i;
   
+  fprintf (stdout, "<?xml version=\"1.0\"?>\n");
+  fprintf (stdout, "<gtk-torture>\n");
   for (i = 0; types[i] != 0; i++) {
     torture_widget (NULL, GINT_TO_POINTER (i));
   }
+  fprintf (stdout, "</gtk-torture>\n");
 }
 
 static void
@@ -457,6 +473,7 @@
     { "crash-full", 'c', 0, G_OPTION_ARG_NONE, &crash_full, "Run full crashes", NULL },
     { "crash-functions", 'f', 0, G_OPTION_ARG_STRING, &crash_str, "Run crashes over specified functions", "coma separated list of functions to crash" },
     { "list-crash-functions", 'z', 0, G_OPTION_ARG_NONE, &list_crash, "List supported crash functions", NULL },
+    { "xml-output", 'X', 0, G_OPTION_ARG_NONE, &xml_output, "XML Output", NULL },
     { NULL }
   };
   GOptionContext *ctx;
@@ -500,6 +517,8 @@
   if (widgets_str) {
     int i,j;
     gchar **widgets = g_strsplit (widgets_str, ",", 0);
+    fprintf (stdout, "<?xml version=\"1.0\"?>\n");
+    fprintf (stdout, "<gtk-torture>\n");
     for (i = 0; widgets[i];  i++) {
       gboolean run = FALSE;
       for (j = 0; types[j] != 0; j++) {
@@ -516,6 +535,7 @@
       }
     }
     g_strfreev(widgets);
+    fprintf (stdout, "</gtk-torture>\n");
     return 0;
   }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]