summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-10-13 00:20:37 +0300
committerStefan Kost <ensonic@users.sf.net>2010-10-13 00:20:37 +0300
commit2919eb649f0ba9fa173eb78326f146d77415d4bb (patch)
treeb4294870082fef4cd2d463cfab96f250f5ccc819
parent924a270f2c5bc2d377573c57559ff8d324f9704b (diff)
ui: more logging and better error handling
Add more logging to track down the graphviz crashers.
-rw-r--r--TODO29
-rw-r--r--src/ui/main-window.c46
2 files changed, 64 insertions, 11 deletions
diff --git a/TODO b/TODO
index 50b11b8..c861eca 100644
--- a/TODO
+++ b/TODO
@@ -171,11 +171,38 @@ gst_pad_set_caps
- proxy-pads of ghostpads are not properly handled
- could/should we always account all data activity on proxy-pads to its parent
- ghostpad
+ ghostpad?
== bugs ==
- we seem to not fully catch the removal of proxy-pads
- the playbin2 example has pad_link_full/pad_unlink pairs with a proxypad,
but the proxypad is never appearing for anything else
(e.g. decodepad3_proxypad4)
+ - we don't need to catch request_pads separately
+
+- we have crashers in graphviz:
+main-window.c:382:refresh_layout graphs: 27, nodes: 50, edges: 28
+...
+mincross pipelines: 0 crossings, 0,00 secs.
+network simplex: 131 nodes 344 edges maxiter=2147483647 balance=2
+network simplex: 131 nodes 344 edges 17 iter 0,00 sec
+routesplines: 28 edges, 83 boxes 0,00 sec
+
+main-window.c:1040:on_new_log_event [l+] ----------------------------------------
+main-window.c:382:refresh_layout graphs: 27, nodes: 50, edges: 29
+...
+mincross pipelines: 0 crossings, 0,00 secs.
+network simplex: 134 nodes 349 edges maxiter=2147483647 balance=2
+network simplex: 134 nodes 349 edges 20 iter 0,00 sec
+
+#0 0xffffe424 in __kernel_vsyscall ()
+#1 0xb73d47ff in raise () from /lib/libc.so.6
+#2 0xb73d6140 in abort () from /lib/libc.so.6
+#3 0xb7f267d9 in growdq (polyp=0xbfffd868, eps=0xbfffd838, output=0xbfffd860) at shortest.c:563
+#4 Pshortestpath (polyp=0xbfffd868, eps=0xbfffd838, output=0xbfffd860) at shortest.c:124
+#5 0xb7f5a89f in _routesplines (pp=0x88ef748, npoints=0xbfffe2dc, polyline=0) at routespl.c:424
+#6 0xb2d6a61b in make_regular_edge (g=0x88ce858, normalize=1) at dotsplines.c:1591
+#7 _dot_splines (g=0x88ce858, normalize=1) at dotsplines.c:446
+#8 0xb2d60378 in dot_layout (g=0x88ce858) at dotinit.c:278
+#9 0xb7f400f8 in gvLayoutJobs (gvc=0x80bb158, g=0x88ce858) at gvlayout.c:91
diff --git a/src/ui/main-window.c b/src/ui/main-window.c
index fc9ce70..e841a6e 100644
--- a/src/ui/main-window.c
+++ b/src/ui/main-window.c
@@ -129,11 +129,16 @@ G_DEFINE_TYPE (GstTLMainWindow, gsttl_main_window, GTK_TYPE_WINDOW);
#define PAD_TYPE_FONT_SIZE "28"
#define DPI 72.0
+/* graphviz configuration */
/* tell graphviz to have y=0 at top
* causes negative coordinates :/, known bug in some graphviz 2.26
extern int Y_invert=1;
*/
+/* verbose stderr output
+extern unsigned char Verbose=4;
+*/
+
/* helper */
static gpointer
@@ -202,8 +207,11 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
Agraph_t *parent, *root;
gboolean re_run;
gint gw,gh;
- guint *bin_z_order, z_ix;
-
+ guint *bin_z_order=NULL, z_ix;
+#ifdef ENABLE_TRACE
+ guint __nr_graphs=0, __nr_nodes=0, __nr_edges=0;
+#endif
+
/* FIXME: use mode to avoid some work if e.g. only a link has been changed
* unfortunately graphviz does not seem to like even modifications and
* relayouting
@@ -260,6 +268,9 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
z_ix++;
TRACE("[%2d:b/e] label=%s, parent=%u,%p = %p",i,
(item->name?item->name:""),item->bin_ix,parent,item->graph);
+#ifdef ENABLE_TRACE
+ __nr_graphs++;
+#endif
}
}
}
@@ -283,6 +294,9 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
}
TRACE("[%2d:p] label=%s, parent=%u,%p = %p",i,
(item->name?item->name:""),item->elem_ix,parent,item->node);
+#ifdef ENABLE_TRACE
+ __nr_nodes++;
+#endif
} else {
if (item->ci_group) {
gint child_num = goo_canvas_item_find_child (self->priv->canvas_root, item->ci_group);
@@ -349,6 +363,12 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
} else {
item->edge = agedge (root, pitem1->node, pitem2->node);
}
+ TRACE("[%4d:l] parent=%p",i,parent);
+#ifdef ENABLE_TRACE
+ if (item->edge) {
+ __nr_edges++;
+ }
+#endif
}
if (!item->edge && item->ci_line) {
gint child_num = goo_canvas_item_find_child (self->priv->canvas_root, item->ci_line);
@@ -357,19 +377,26 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
}
item->ns = pitem1;
item->ne = pitem2;
- TRACE("[%2d:l] parent=%p",i,parent);
}
}
+ TRACE("graphs: %4d, nodes: %4d, edges: %4d",__nr_graphs, __nr_nodes, __nr_edges);
// layout the graph
- gvLayout (self->priv->gvc, root, "dot");
- gvRender (self->priv->gvc, root, "dot", NULL);
+ if (gvLayout (self->priv->gvc, root, "dot")!=0) {
+ fprintf (stderr, "graphviz layout failed\n");
+ goto done;
+ }
+ if (gvRender (self->priv->gvc, root, "dot", NULL)!=0) {
+ fprintf (stderr, "graphviz rendering failed\n");
+ goto done;
+ }
// write out the dot file or image for testing
-#if 0
+#if 1
{
static guint __ct=0;
gchar __fname[50];
+ TRACE("=== %d ===",__ct);
sprintf (__fname, "/tmp/gsttl_%03d.dot", __ct);
gvRenderFilename (self->priv->gvc, root, "dot", __fname);
//sprintf (__fname, "/tmp/gsttl_%03d.png", __ct);
@@ -491,8 +518,8 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
item->ci_box = goo_canvas_rect_new (item->ci_group,
0, 0, item->w, item->h,
"line-width", 1.5,
- /*"radius-x", 10.0,
- "radius-y", 10.0,*/
+ /*"radius-x", 5.0,
+ "radius-y", 5.0,*/
"stroke-color-rgba", 0x204a87ff,
"fill-color-rgba", (item->is_bin ? 0xeeeeec1e : 0x729fcf1e),
NULL);
@@ -604,8 +631,6 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
item->ci_box = goo_canvas_rect_new (item->ci_group,
0, 0, item->w, item->h,
"line-width", 1.0,
- /*"radius-x", 5.0,
- "radius-y", 5.0,*/
"stroke-color-rgba", 0x204a87ff,
"fill-color-rgba", ((item->pad_type!=0)?0x9ebedeff:0x729fcfff),
NULL);
@@ -688,6 +713,7 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
}
}
+done:
g_slice_free1 (sizeof(guint)*self->priv->elements->len, bin_z_order);
// destroy graph