Re: [PATCH v9 3/3] trace,x86: code-sharing between non-trace andtrace irq handlers

From: H. Peter Anvin
Date: Fri Feb 15 2013 - 19:15:14 EST


On 02/04/2013 02:50 PM, Seiji Aguchi wrote:
> [Issue]
>
> Currently, irq vector handlers for tracing are just
> copied non-trace handlers by simply inserting tracepoints.
>
> It is difficult to manage the codes.
>
> [Solution]
>
> This patch shares common codes between non-trace and trace handlers
> as follows to make them manageable and readable.
>
> Non-trace irq handler:
> smp_irq_handler()
> {
> entering_irq(); /* pre-processing of this handler */
> __smp_irq_handler(); /*
> * common logic between non-trace and trace handlers
> * in a vector.
> */
> exiting_irq(); /* post-processing of this handler */
>
> }
>
> Trace irq_handler:
> smp_trace_irq_handler()
> {
> entering_irq(); /* pre-processing of this handler */
> trace_irq_entry(); /* tracepoint for irq entry */
> __smp_irq_handler(); /*
> * common logic between non-trace and trace handlers
> * in a vector.
> */
> trace_irq_exit(); /* tracepoint for irq exit */
> exiting_irq(); /* post-processing of this handler */
>
> }
>

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.

-hpa


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