lkml.org 
[lkml]   [2013]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v9 3/3] trace,x86: code-sharing between non-trace and trace irq handlers
    From
    Date
    On Fri, 2013-02-15 at 16:13 -0800, H. Peter Anvin wrote:

    > How important is it that the tracepoint is *inside* the enter/exit
    > handling? If not, it would be simpler to just do:
    >
    > smp_trace_irq_handler()
    > {
    > trace_irq_entry();
    > smp_irq_handler();
    > trace_irq_exit();
    > }
    >
    > ... which seems a bit cleaner. If this isn't possible, then this patch
    > is fine, but please add to the patch description why the simple wrapper
    > isn't doable.

    The problem is with irq_enter/exit() being called. They must be called
    before trace_irq_enter/exit(), because of the rcu_irq_enter() must be
    called before any tracepoints are used, as tracepoints use rcu to
    synchronize.

    Now perhaps we could do this and have trace_irq_entry().

    Not only that, the tracepoint callbacks expect irq_enter() to already be
    called.

    Hmm, if irq_enter() can nest, which I think it can, perhaps we can call
    irq_enter() first. I'm not sure if that will screw up the second
    irq_entry() inside smp_irq_handler().

    smp_trace_irq_hander()
    {
    irq_entry();
    trace_irq_entry();
    smp_irq_handler();
    trace_irq_exit();
    irq_exit();
    }

    -- Steve




    \
     
     \ /
      Last update: 2013-02-16 02:41    [W:8.115 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site