lkml.org 
[lkml]   [2012]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 4/6] trace: trace syscall in its handler not from ptrace handler
    On Wed, Mar 28, 2012 at 11:20 PM, Ingo Molnar <mingo@kernel.org> wrote:
    >
    > * Vaibhav Nagarnaik <vnagarnaik@google.com> wrote:
    >
    >> On Wed, Mar 28, 2012 at 7:43 PM, H. Peter Anvin <hpa@zytor.com> wrote:
    >> > But instead you add a penalty for every syscall, even if tracing is
    >> > disabled.  Not cool.
    >>
    >> I just ran a small test binary which calls syscall(SYS_getuid) in a
    >> tight loop and calculates the latency per syscall.
    >>
    >> Without my patch: it is 70 ns/call
    >> With my patch: it is 83 ns/call
    >>
    >> So yes, it does add a bit of latency to the syscall even if
    >> tracing is disabled. I wonder if I can change the redirection
    >> function so that it doesn't add so much latency.
    >
    > There's a really simple rule for anything tracing/debugging
    > related: and syscalls don't add *ANY* kind of latency to the
    > non-tracing case. That is true of the current syscall tracing
    > bits, they work via a TIF flag and don't add any latency.
    >

    Thanks for the feedback. I had missed this added latency due to this
    patch when tracing is disabled.

    To fix that, instead of a TIF flag, I am using a flag in the
    current->trace bitmap. I check that flag before jumping to the tracing
    function. That reduces the latency from 83 ns/call to 74 ns/call.


    Thanks

    Vaibhav Nagarnaik
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-03-29 21:05    [W:4.487 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site