Gathering data about Spice

Friday, July 7, 2017

Added recorder support for up to 12 arguments. There is one existing DISPLAY_DEBUG statement in spice-widget.c that requires 9 arguments.

One problem that I need to address now is glib filtering.

Also, one thing I don't understand is why I have some unsatisfied unless I had some symbols in spice-glib-sym-file, which lists the exports from the library:

recorder_activate
recorder_order
recorder_tick
recorder_channel_record
recorder_spice_debug_record
recorder_trace_entry
ring_peek

The problem is not that I need to export symbol, it is that there are only unsatisfied symbols for some of them. I can't seem to figure out what makes these specific symbols required, and not others.

Another issue is the order of activation for recorders using constructors:

recorder/recorder.c:1318: [0 0.000000] recorders: Activating 'channel' (0x10561d4e0)
recorder/recorder.c:1458: [1 0.000100] recorder_traces: Setting traces to .*recorder.*
recorder/recorder.c:1562: [2 0.000229] recorder_traces: Numerical testing channel = NO
recorder/recorder.c:1458: [3 0.000237] recorder_traces: Setting traces to .*_warning|.*_error|.*_critical
recorder/recorder.c:1562: [4 0.000330] recorder_traces: Numerical testing channel = NO
recorder/recorder.c:1274: [5 0.000337] signals: Activating dump for signal mask 0xE3001C58
recorder/recorder.c:1318: [6 0.000366] recorders: Activating 'spice_info' (0x10561f780)
recorder/recorder.c:1318: [7 0.000369] recorders: Activating 'spice_debug' (0x105621800)
recorder/recorder.c:1318: [8 0.000369] recorders: Activating 'spice_warning' (0x105623880)
recorder/recorder.c:1318: [9 0.000369] recorders: Activating 'spice_error' (0x105625900)
recorder/recorder.c:1318: [10 0.000370] recorders: Activating 'spice_critical' (0x105627980)
recorder/recorder.c:1318: [11 0.000799] recorders: Activating 'recorders' (0x105628ea0)
recorder/recorder.c:1330: [12 0.000799] recorders: Activating tweak 'recorder_dump_sleep' (0x105628f00)
recorder/recorder.c:1318: [13 0.000800] recorders: Activating 'signals' (0x105629750)
recorder/recorder.c:1330: [14 0.000800] recorders: Activating tweak 'recorder_signals' (0x1056297a0)
recorder/recorder.c:1330: [15 0.000800] recorders: Activating tweak 'recorder_export_size' (0x1056297c0)
recorder/recorder.c:1318: [16 0.000800] recorders: Activating 'recorder_traces' (0x10562a810)
recorder/recorder.c:1318: [17 0.000842] recorders: Activating 'display' (0x1054b5ab0)

The problem here being that setting traces only works after recorders are put in the linked list. I tried to use the constructor priority:

__attribute__((constructor(777)))

But that does not help.

So I ended up reworking the initialization, and for Spice, that means two separate initialization steps. That was already the case for debug and log initialization, so I'm not really adding anything new here, but still, I would have preferred to simplify that.

First results

Started investigating things like network utilization. I got my first graphs with spicy, and they are somewhat puzzling. This is the number of bytes per second, and number of packets.

I find the pattern about number of packets quite strange, and frankly, I suspect there is nothing voluntary about this pattern.