<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 23 May 2017, at 12:55, Victor Toso <<a href="mailto:victortoso@redhat.com" class="">victortoso@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Tue, May 23, 2017 at 11:51:01AM +0200, Christophe Fergeau wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">or something like glib (SPICE_XXX_DEBUG=alignment:foo:bar)<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Just to point out that we have a bug for this [0] and IMHO it would be</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">the best approach but it would take some effort to have it besides the</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">glib that we would need is 2.50 (current required is 2.36)</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">[0]<span class="Apple-converted-space"> </span></span><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91838" class="">https://bugs.freedesktop.org/show_bug.cgi?id=91838</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>Pavel also recently commented on having some trouble with --spice-debug and SPICE_DEBUG and…<br class=""><div><br class=""></div><div>For what it’s worth, I’ve implemented in several of my own projects a low-key tracing facility which for Spice would basically look like this:</div><div><br class=""></div><div><div><a href="https://github.com/c3d/spice-common/compare/cast-warnings...c3d:traces" class="">https://github.com/c3d/spice-common/compare/cast-warnings...c3d:traces</a></div><div class=""><div><a href="https://github.com/c3d/spice-gtk/compare/cast-warnings...c3d:traces" class="">https://github.com/c3d/spice-gtk/compare/cast-warnings...c3d:traces</a></div></div><div class=""><br class=""></div></div><div>Specifically:</div><div><br class=""></div><div>- Define available traces in spice-traces.def file, e.g.:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>// SPICE_TRACE(name, default_value, info)</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>SPICE_TRACE(foo, false, “Talk about foo")</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>SPICE_TRACE(bar, true, “A bar is a good thing, enabled by default")</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>#undef SPICE_TRACE</div><div><br class=""></div><div>- Declare a structure holding one bit per trace flag, as follows:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>extern struct spice_traces {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#define SPICE_TRACE(name, init, info)<span class="Apple-tab-span" style="white-space:pre">       </span>bool name:1;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#include “spice-traces.def”</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>} spice_traces;</div><div><br class=""></div>- Initialize it in log.c, as follows:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>struct spice_traces spice_traces = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#define SPICE_TRACE(name, init, info)<span class="Apple-tab-span" style="white-space:pre">       </span>init,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include “spice-traces.def"</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>};</div><div><br class=""></div><div>- In log.c, add a function to deal with passing trace options either from command-line or environemnt</div><div><br class=""></div><div>- In log.h, add macros to quickly test traces:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>#define TRACE(name)<span class="Apple-tab-span" style="white-space:pre">    </span>(spice_traces.name)</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>#define IFTRACE(name)<span class="Apple-tab-span" style="white-space:pre">  </span>if (TRACE(name))</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>#define spice_trace(name, …)<span class="Apple-tab-span" style="white-space:pre">      </span>IFTRACE(name) spice_debug(__VA_ARGS__)</div><div><br class=""></div><div>- In spice-option.c, add code to deal with testing the options.</div><div><br class=""></div><div>Would you find this useful? The most difficult part being to connect that to existing tracing mechanisms to avoid replication of traces, while at the same time ensuring that the existing enabling mechanisms work as before.</div><div><br class=""></div><div><br class=""></div><div>Christophe</div><div><br class=""><blockquote type="cite" class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Cheers,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Spice-devel mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:Spice-devel@lists.freedesktop.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Spice-devel@lists.freedesktop.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.freedesktop.org/mailman/listinfo/spice-devel" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.freedesktop.org/mailman/listinfo/spice-devel</a></div></blockquote></div><br class=""></div></div></body></html>