Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-27 Thread Dmitry Vyukov
On Tue, Sep 27, 2016 at 12:59 PM, Peter Zijlstra wrote: > On Tue, Sep 27, 2016 at 09:50:41AM +0200, Dmitry Vyukov wrote: >> On Tue, Sep 27, 2016 at 9:34 AM, Peter Zijlstra wrote: >> > On Tue, Sep 27, 2016 at 08:21:32AM +0200, Dmitry Vyukov wrote: >> >> >> >> I suspect there is a bunch of places t

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-27 Thread Vegard Nossum
On 09/27/2016 01:20 PM, Vegard Nossum wrote: Your patch was: -if (!t || in_interrupt()) +if (!t || (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_OFFSET +| NMI_MASK))) But look at the definitions: #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIR

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-27 Thread Vegard Nossum
On 09/27/2016 09:50 AM, Dmitry Vyukov wrote: On Tue, Sep 27, 2016 at 9:34 AM, Peter Zijlstra wrote: On Tue, Sep 27, 2016 at 08:21:32AM +0200, Dmitry Vyukov wrote: I suspect there is a bunch of places that use in_interrupt(), but mean the same as KCOV wants -- am I in interrupt? and not am I i

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-27 Thread Peter Zijlstra
On Tue, Sep 27, 2016 at 09:50:41AM +0200, Dmitry Vyukov wrote: > On Tue, Sep 27, 2016 at 9:34 AM, Peter Zijlstra wrote: > > On Tue, Sep 27, 2016 at 08:21:32AM +0200, Dmitry Vyukov wrote: > >> > >> I suspect there is a bunch of places that use in_interrupt(), but mean > >> the same as KCOV wants --

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-27 Thread Dmitry Vyukov
On Tue, Sep 27, 2016 at 9:34 AM, Peter Zijlstra wrote: > On Tue, Sep 27, 2016 at 08:21:32AM +0200, Dmitry Vyukov wrote: >> >> I suspect there is a bunch of places that use in_interrupt(), but mean >> the same as KCOV wants -- am I in interrupt? and not am I in interrupt >> context or in normal tas

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-27 Thread Peter Zijlstra
On Tue, Sep 27, 2016 at 08:21:32AM +0200, Dmitry Vyukov wrote: > > I suspect there is a bunch of places that use in_interrupt(), but mean > the same as KCOV wants -- am I in interrupt? and not am I in interrupt > context or in normal task context but inside local_bh_disable(). For > example, why d

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-26 Thread Dmitry Vyukov
On Tue, Sep 27, 2016 at 1:32 AM, Andrew Morton wrote: > On Fri, 23 Sep 2016 16:51:13 +0200 Andrey Konovalov > wrote: > >> in_interrupt() returns a nonzero value when we are either in an >> interrupt or have bh disabled via local_bh_disable(). Since we are >> interested in only ignoring coverage

Re: [PATCH] kcov: properly check if we are in an interrupt

2016-09-26 Thread Andrew Morton
On Fri, 23 Sep 2016 16:51:13 +0200 Andrey Konovalov wrote: > in_interrupt() returns a nonzero value when we are either in an > interrupt or have bh disabled via local_bh_disable(). Since we are > interested in only ignoring coverage from actual interrupts, do a > proper check of whether we are r

[PATCH] kcov: properly check if we are in an interrupt

2016-09-23 Thread Andrey Konovalov
in_interrupt() returns a nonzero value when we are either in an interrupt or have bh disabled via local_bh_disable(). Since we are interested in only ignoring coverage from actual interrupts, do a proper check of whether we are really in an interrupt. Signed-off-by: Andrey Konovalov --- It would