<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><br class=""></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><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=""><div><blockquote class=""><div class="">On 23 May 2017, at 12:55, Victor Toso <<a href="mailto:victortoso@redhat.com" class="" target="_blank">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 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="" target="_blank">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></div></div></blockquote><div>These seems to suggest the usage of glib for more refined control.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><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=""><div>Pavel also recently commented on having some trouble with --spice-debug and SPICE_DEBUG and…<br class=""></div></div></div></blockquote><div>Would be helpful if you had recap Pavel problems. I don't remember.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><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=""><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="" target="_blank">https://github.com/c3d/spice-common/compare/cast-warnings...c3d:traces</a><br data-mce-bogus="1"></div><div class=""><div><a href="https://github.com/c3d/spice-gtk/compare/cast-warnings...c3d:traces" class="" target="_blank">https://github.com/c3d/spice-gtk/compare/cast-warnings...c3d:traces</a><br data-mce-bogus="1"></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></div></blockquote><div>The main questions are:<br></div><div>- what are the original problems exactly?<br></div><div>- why your solution is good in your opinion?<br></div><div>- did you try other options (like Marc-andre' suggested) ?<br></div><div><br></div><div>Reading the code is not clear where exactly you implemented the different domains<br></div><div>suggested by the bug report. Did you just coded SSL as an example? </div><div>Also you introduced a new "TRACE" logging level; why DEBUG was not enough?<br></div><div><br></div><div>Frediano<br></div><div><br></div></div></body></html>