GNOME Bugzilla – Bug 574484
[patch] Make caps in DOT debug graphs more readable
Last modified: 2009-03-11 08:29:54 UTC
When DEBUG_BIN_TO_DOT_FILE() is used with DEBUG_GRAPH_SHOW_CAPS_DETAILS, the caps are put in the DOT file by simply taking the to_string() of the caps and replacing ',' with '\n'. This is a problem because commas aren't only present between caps field name but also inside values such as { 1234, 4321 }. When the caps have not been negotiated and you are trying to figure out why by looking at the caps in the DOT file you will see this terribly difficult to read block of text: audio/x-raw-float rate=(int)[ 1 2147483647 ] channels=(int)[ 1 2147483647 ] endianness=(int) { 1234 4321 } width=(int)64; audio/x-raw-float rate=(int)[ 1 2147483647 ] channels=(int)[ 1 2147483647 ] endianness=(int) { 1234 4321 } width=(int)32; You will also notice that none of the lines start at the same place because the text is centred. My patch changes the font to monospace (so we can make things line up like in the terminal), and then outputs the caps in the same style as gst-inspect-0.10 does. The same caps above will now appear like this in the DOT file: audio/x-raw-float rate: [ 1, 2147483647 ] channels: [ 1, 2147483647 ] endianness: { 1234, 4321 } width: 64 audio/x-raw-float rate: [ 1, 2147483647 ] channels: [ 1, 2147483647 ] endianness: { 1234, 4321 } width: 32 Other information:
Created attachment 130237 [details] [review] patch to make caps output in DOT more readable I am not entirely sure about the policy for using private macros such as STRUCTURE_ESTIMATED_STRING_LEN(). Please review, and let me know. Thanks!
I have actually already fixed the naive \n scheme in git. I does not replace , inside [](){}. The doump now also figures not negotiated caps and shows both the caps or src and sink. I am not really convinced about the formatting. You are supposed to render the dot as png or such and not look at it in a terminal :) What shall we do?
Created attachment 130433 [details] A cropped DOT file rendering of the unreadable caps (gstreamer head)
Created attachment 130434 [details] A cropped DOT file rendering of good caps (gstreamer with patch applied)
Created attachment 130439 [details] [review] patch to make caps output in DOT more readable, updated to current git
I made a small change to set the label font per dot file and not for each label. Thanks for the patch! commit 0890ebc0349e6363b0f73e222945b3d3f27a59e1 Author: Laszlo Pandy <laszlok2@gmail.com> Date: Wed Mar 11 10:27:16 2009 +0200 dump2dot: make caps in DOT debug graphs more readable. Fixes 574484 Use a monospace font for edge labels and indent.