netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Jiri Olsa <jolsa@redhat.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	"David S. Miller" <davem@davemloft.net>,
	Linux API <linux-api@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH v4 tip 3/7] tracing: allow BPF programs to call ktime_get_ns()
Date: Sat, 28 Feb 2015 09:21:20 -0800	[thread overview]
Message-ID: <CAMEtUux5qv=b8HM1_p_WV5_HWzgmJhSq+AHSGQ4Ag9c-QLr81A@mail.gmail.com> (raw)

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.

             reply	other threads:[~2015-02-28 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 17:21 Alexei Starovoitov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-02-28  0:08 [PATCH v4 tip 0/7] tracing: attach eBPF programs to kprobes Alexei Starovoitov
     [not found] ` <1425082135-11967-1-git-send-email-ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
2015-02-28  0:08   ` [PATCH v4 tip 3/7] tracing: allow BPF programs to call ktime_get_ns() Alexei Starovoitov
     [not found]     ` <1425082135-11967-4-git-send-email-ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
2015-02-28 10:20       ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMEtUux5qv=b8HM1_p_WV5_HWzgmJhSq+AHSGQ4Ag9c-QLr81A@mail.gmail.com' \
    --to=ast@plumgrid.com \
    --cc=acme@infradead.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jolsa@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).