[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+khW7gY5qAqP+EsHzEqrAk5OFKdR4Fhy76v_5WN+0ko+vkgsA@mail.gmail.com>
Date: Wed, 6 Jul 2022 16:01:42 -0700
From: Hao Luo <haoluo@...gle.com>
To: Alan Maguire <alan.maguire@...cle.com>
Cc: ast@...nel.org, andrii@...nel.org, daniel@...earbox.net,
kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org, jolsa@...nel.org,
mhiramat@...nel.org, akpm@...ux-foundation.org, void@...ifault.com,
swboyd@...omium.org, ndesaulniers@...gle.com,
9erthalion6@...il.com, kennyyu@...com, geliang.tang@...e.com,
kuniyu@...zon.co.jp, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 bpf-next 1/2] bpf: add a ksym BPF iterator
On Fri, Jul 1, 2022 at 2:28 AM Alan Maguire <alan.maguire@...cle.com> wrote:
>
> add a "ksym" iterator which provides access to a "struct kallsym_iter"
> for each symbol. Intent is to support more flexible symbol parsing
> as discussed in [1].
>
> [1] https://lore.kernel.org/all/YjRPZj6Z8vuLeEZo@krava/
>
> Suggested-by: Alexei Starovoitov <alexei.starovoitov@...il.com>
> Signed-off-by: Alan Maguire <alan.maguire@...cle.com>
> ---
> kernel/kallsyms.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 89 insertions(+)
>
> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> index fbdf8d3..8b662da 100644
> --- a/kernel/kallsyms.c
> +++ b/kernel/kallsyms.c
> @@ -30,6 +30,7 @@
[...]
> +
> +static struct bpf_iter_reg ksym_iter_reg_info = {
> + .target = "ksym",
> + .ctx_arg_info_size = 1,
> + .ctx_arg_info = {
> + { offsetof(struct bpf_iter__ksym, ksym),
> + PTR_TO_BTF_ID_OR_NULL },
> + },
> + .seq_info = &ksym_iter_seq_info,
> +};
It would be great to allow cond_resched() while iterating. Disabling
resched is unnecessary for iterating ksyms IMO.
.feature = BPF_ITER_RESCHED,
Hao
> +
[...]
> --
> 1.8.3.1
>
Powered by blists - more mailing lists