All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: <ast@fb.com>, <daniel@iogearbox.net>, <netdev@vger.kernel.org>
Cc: <kernel-team@fb.com>
Subject: [PATCH bpf-next v8 01/10] bpf: change prototype for stack_map_get_build_id_offset
Date: Sat, 28 Apr 2018 00:01:56 -0700	[thread overview]
Message-ID: <20180428070205.1059628-2-yhs@fb.com> (raw)
In-Reply-To: <20180428070205.1059628-1-yhs@fb.com>

This patch didn't incur functionality change. The function prototype
got changed so that the same function can be reused later.

Signed-off-by: Yonghong Song <yhs@fb.com>
---
 kernel/bpf/stackmap.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 57eeb12..04f6ec1 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -262,16 +262,11 @@ static int stack_map_get_build_id(struct vm_area_struct *vma,
 	return ret;
 }
 
-static void stack_map_get_build_id_offset(struct bpf_map *map,
-					  struct stack_map_bucket *bucket,
+static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
 					  u64 *ips, u32 trace_nr, bool user)
 {
 	int i;
 	struct vm_area_struct *vma;
-	struct bpf_stack_build_id *id_offs;
-
-	bucket->nr = trace_nr;
-	id_offs = (struct bpf_stack_build_id *)bucket->data;
 
 	/*
 	 * We cannot do up_read() in nmi context, so build_id lookup is
@@ -361,8 +356,10 @@ BPF_CALL_3(bpf_get_stackid, struct pt_regs *, regs, struct bpf_map *, map,
 			pcpu_freelist_pop(&smap->freelist);
 		if (unlikely(!new_bucket))
 			return -ENOMEM;
-		stack_map_get_build_id_offset(map, new_bucket, ips,
-					      trace_nr, user);
+		new_bucket->nr = trace_nr;
+		stack_map_get_build_id_offset(
+			(struct bpf_stack_build_id *)new_bucket->data,
+			ips, trace_nr, user);
 		trace_len = trace_nr * sizeof(struct bpf_stack_build_id);
 		if (hash_matches && bucket->nr == trace_nr &&
 		    memcmp(bucket->data, new_bucket->data, trace_len) == 0) {
-- 
2.9.5

  reply	other threads:[~2018-04-28  7:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28  7:01 [PATCH bpf-next v8 00/10] bpf: add bpf_get_stack helper Yonghong Song
2018-04-28  7:01 ` Yonghong Song [this message]
2018-04-28  7:01 ` [PATCH bpf-next v8 02/10] " Yonghong Song
2018-04-28  7:01 ` [PATCH bpf-next v8 03/10] bpf/verifier: refine retval R0 state for " Yonghong Song
2018-04-28  7:01 ` [PATCH bpf-next v8 04/10] bpf: remove never-hit branches in verifier adjust_scalar_min_max_vals Yonghong Song
2018-04-28  7:02 ` [PATCH bpf-next v8 05/10] bpf/verifier: improve register value range tracking with ARSH Yonghong Song
2018-04-28 16:52   ` Alexei Starovoitov
2018-04-28  7:02 ` [PATCH bpf-next v8 06/10] tools/bpf: add bpf_get_stack helper to tools headers Yonghong Song
2018-04-28  7:02 ` [PATCH bpf-next v8 07/10] samples/bpf: move common-purpose trace functions to selftests Yonghong Song
2018-04-28  7:02 ` [PATCH bpf-next v8 08/10] tools/bpf: add a verifier test case for bpf_get_stack helper and ARSH Yonghong Song
2018-04-28  7:02 ` [PATCH bpf-next v8 09/10] tools/bpf: add a test for bpf_get_stack with raw tracepoint prog Yonghong Song
2018-04-28 16:56   ` Alexei Starovoitov
2018-04-28 18:17     ` Y Song
2018-04-28 19:06       ` Alexei Starovoitov
2018-04-28 20:02         ` Yonghong Song
2018-04-28  7:02 ` [PATCH bpf-next v8 10/10] tools/bpf: add a test for bpf_get_stack with " Yonghong Song

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=20180428070205.1059628-2-yhs@fb.com \
    --to=yhs@fb.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.