Re: [PATCH v6 2/2] tracing: Add support for preempt and irq enable/disable events

From: Steven Rostedt
Date: Mon Oct 02 2017 - 15:38:03 EST


On Mon, 2 Oct 2017 12:33:30 -0700
Joel Fernandes <joelaf@xxxxxxxxxx> wrote:


> diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
> index 5dd1272d1ab2..2a1af0dd9cc4 100644
> --- a/include/linux/irqflags.h
> +++ b/include/linux/irqflags.h
> @@ -93,7 +93,9 @@
> #define local_irq_save(flags) \
> do { \
> raw_local_irq_save(flags); \
> - trace_hardirqs_off(); \
> + if (!raw_irqs_disabled_flags(flags)) { \
> + trace_hardirqs_off(); \
> + } \
> } while (0)
>
>
> @@ -101,7 +103,6 @@
> do { \
> if (raw_irqs_disabled_flags(flags)) { \
> raw_local_irq_restore(flags); \
> - trace_hardirqs_off(); \
> } else { \
> trace_hardirqs_on(); \
> raw_local_irq_restore(flags); \

I rather have the protection in trace_hardirqs_on/off(). Let's keep the
ugliness from spreading.

-- Steve