<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><span id="zwchr" data-marker="__DIVIDER__">---- On Jun 27, 2016, at 1:40 PM, Mohamad <mohamad.gebai@gmail.com> wrote:<br></span></div><div data-marker="__QUOTED_TEXT__"><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 class="moz-cite-prefix"><br>
      On 06/27/2016 12:13 PM, Mathieu Desnoyers wrote:<br></div><blockquote cite="mid:1451271429.49557.1467044037388.JavaMail.zimbra@efficios.com"><div style="font-family: arial, helvetica, sans-serif; font-size:
        12pt; color: #000000"><div><br></div><div><span id="zwchr">----- On Jun 27,
            2016, at 11:26 AM, mo geb <a class="moz-txt-link-rfc2396E" href="mailto:mohamad.gebai@gmail.com" target="_blank"><mohamad.gebai@gmail.com></a>
            wrote:<br>
          </span></div><div><div><br></div><div>Please use [PATCH lttng-modules] in the subject.<br></div><div><br></div></div></div></blockquote>
    Got it.<br><blockquote cite="mid:1451271429.49557.1467044037388.JavaMail.zimbra@efficios.com"><div style="font-family: arial, helvetica, sans-serif; font-size:
        12pt; color: #000000"><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="ltr"><div>Signed-off-by: Mohamad Gebai <<a class="moz-txt-link-abbreviated" href="mailto:mohamad.gebai@gmail.com" target="_blank">mohamad.gebai@gmail.com</a>><br>
                ---<br>
                 instrumentation/events/lttng-module/arch/x86/kvm/trace.h

                | 3 ++-<br>
                 1 file changed, 2 insertions(+), 1 deletion(-)</div><p>diff --git
                a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h<br>
                index 1282bea..ef3d8aa 100644<br>
                ---
                a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h<br>
                +++
                b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h<br>
                @@ -429,7 +429,8 @@
                LTTNG_TRACEPOINT_EVENT(kvm_emulate_insn,<br>
                                ctf_integer(__u8, len,
                vcpu->arch.emulate_ctxt.decode.eip<br>
                                                -
                vcpu->arch.emulate_ctxt.decode.fetch.start)<br>
                                ctf_array(__u8, insn,
                vcpu->arch.emulate_ctxt.decode.fetch.data, 15)<br>
                -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0))<br>
                +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) \<br>
                +    && !LTTNG_RHEL_KERNEL_RANGE(3,10,0,7,2,
                3,11,0,0,0))</p></div></blockquote><div><br></div><div>We don't use negation "!" in kernel version range tests.
            We also don't use<br></div><div>"&&" typically, to make the code easier to
            maintain.<br></div><div><br></div><div>Instead, we might want to swap the order in which ifdefs
            are done, and put<br></div><div>newer versions at the top, e.g.:<br></div><div><br></div><div>#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) \<br></div><div>  || LTTNG_RHEL_KERNEL_RANGE(3,10,0,7,2, 3,11,0,0,0))<br></div><div>...<br></div><div>#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))<br></div><div>...<br></div><div>#else<br></div><div>...<br></div><div>#endif<br></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu<br></div><div><br></div></div></div></blockquote><br>
    Thanks for the comments, I'll make those changes and resubmit. I
    just want to point out that I used a check similar to what's in
    wrapper/trace-clock.h:<br><br>
    #if ((LTTNG_KERNEL_RANGE(3,10,0, 3,10,14) &&
    !LTTNG_RHEL_KERNEL_RANGE(3,10,0,7,0, 3,10,14,0,0)) \<br>
        || LTTNG_KERNEL_RANGE(3,11,0, 3,11,3))<br>
    #error "Linux kernels 3.10 and 3.11 introduce a deadlock in the
    timekeeping subsystem. Fixed by commit
    7bd36014460f793c19e7d6c94dab67b0afcfcb7f \"timekeeping: Fix HRTICK
    related deadlock from ntp lock changes\" in Linux."<br>
    #endif</blockquote><div><br></div><div>This is OK for a single #if/endif that surrounds an error condition. For the instrumentation,<br data-mce-bogus="1"></div><div>we tend to end up having multiple #if #elif #elif #elif #endif that accumulate over time.<br data-mce-bogus="1"></div><div>In order to keep this maintainable, I try to avoid having && and ! there.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></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;"><br><br>
    Mohamad<br><br><br>_______________________________________________<br>lttng-dev mailing list<br>lttng-dev@lists.lttng.org<br>https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev<br></blockquote></div><div><br></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>