[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-api
Subject:    Re: [PATCH v4 tip 3/7] tracing: allow BPF programs to call ktime_get_ns()
From:       Alexei Starovoitov <ast () plumgrid ! com>
Date:       2015-02-28 17:21:20
Message-ID: CAMEtUux5qv=b8HM1_p_WV5_HWzgmJhSq+AHSGQ4Ag9c-QLr81A () mail ! gmail ! com
[Download RAW message or body]

On Sat, Feb 28, 2015 at 2:20 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>>
>> +static u64 bpf_ktime_get_ns(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
>> +{
>> +     return ktime_get_ns();
>> +}
>
> Please use ktime_get_mono_fast_ns() instead. If you ever want to allow
> running BPF stuff from general tracepoints and the like you need to
> be NMI safe.

good point. will do.
Currently in trace_call_bpf() I have:
if (in_nmi()) /* not supported yet */
  return 1;
to tackle nmi after all pieces are in place.
Likely nmi-safe programs will have access to reduced set
of helper functions.
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic