linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Ingo Molnar <mingo@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Wang Nan <wangnan0@huawei.com>,
	lizefan@huawei.com, Daniel Wagner <daniel.wagner@bmw-carit.de>,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-api@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 net-next 3/3] bpf: let kprobe programs use bpf_get_smp_processor_id() helper
Date: Fri, 12 Jun 2015 19:39:14 -0700	[thread overview]
Message-ID: <1434163154-5218-4-git-send-email-ast@plumgrid.com> (raw)
In-Reply-To: <1434163154-5218-1-git-send-email-ast@plumgrid.com>

It's useful to do per-cpu histograms.

Suggested-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
---
v1->v2: no changes

 kernel/trace/bpf_trace.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 4f9b5d41869b..88a041adee90 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -181,6 +181,8 @@ static const struct bpf_func_proto *kprobe_prog_func_proto(enum bpf_func_id func
 		return &bpf_get_current_comm_proto;
 	case BPF_FUNC_trace_printk:
 		return bpf_get_trace_printk_proto();
+	case BPF_FUNC_get_smp_processor_id:
+		return &bpf_get_smp_processor_id_proto;
 	default:
 		return NULL;
 	}
-- 
1.7.9.5

  parent reply	other threads:[~2015-06-13  2:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13  2:39 [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking Alexei Starovoitov
2015-06-13  2:39 ` [PATCH v2 net-next 2/3] bpf: allow networking programs to use bpf_trace_printk() for debugging Alexei Starovoitov
2015-06-13  2:39 ` Alexei Starovoitov [this message]
     [not found]   ` <1434163154-5218-4-git-send-email-ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
2015-06-13  8:23     ` [PATCH v2 net-next 3/3] bpf: let kprobe programs use bpf_get_smp_processor_id() helper Daniel Borkmann
     [not found] ` <1434163154-5218-1-git-send-email-ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
2015-06-13  2:39   ` [PATCH v2 net-next 1/3] bpf: introduce current->pid, tgid, uid, gid, comm accessors Alexei Starovoitov
2015-06-15 23:01   ` [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking David Miller
     [not found]     ` <20150615.160130.583783771772303463.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-06-16  3:28       ` Alexei Starovoitov
2015-06-16  9:19         ` Daniel Borkmann
     [not found]           ` <557FEA2C.5080408-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
2015-06-16 17:10             ` Alexei Starovoitov
     [not found]               ` <558058A0.7030201-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
2015-06-18  8:10                 ` Daniel Borkmann

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=1434163154-5218-4-git-send-email-ast@plumgrid.com \
    --to=ast@plumgrid.com \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=wangnan0@huawei.com \
    /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).