Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp968641imw; Fri, 8 Jul 2022 15:30:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAMhSg/EhvUIBWy0I+XbT7h/iGzsClGhqHRrrEsLR77KEbVbrkTESmAV5RlOl5Kt66IsZv X-Received: by 2002:a05:6a00:2292:b0:525:6c57:8dd5 with SMTP id f18-20020a056a00229200b005256c578dd5mr6161011pfe.17.1657319440039; Fri, 08 Jul 2022 15:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657319440; cv=none; d=google.com; s=arc-20160816; b=fM8qSzkeEpyx3frCCkF87rni1/BBnQN3JCDrd279PECCRfFDM8Vby7ZEPOFHuG0bfV CIZjkQWoTfahsNy16fPFMSB3b5o+6x1E9geFn2+9gH1vTpywvHeZAdz8+/toZ8Vroam8 21StQB5W3cV/BL9WqsJc93vAKC9XQLkJPyS9JJI/7wyIZ35v7mpwmuv1I9lj1UcQZu5k e0OJRB5gBogeifU4P8CPFHTdIyGCnr20SB9ICfr7lQov2NCICJrDE7WROB8z2YVJxbSR hCgqZmXgetHcoo0W3jRQl6r+7NriwLm4gD7lx48+SAnhuACD3vVtOv1/q+Y2XuiSZGy9 fE3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HWlKpaLv2VR3Vok4iSI8gNXJv7MjF7LayWn7Z5iN4Q0=; b=eAqiaTa1IHK0BHeYwOOs5AzB3wPzfI91uY5889Ac6B5bMaQS/JDcZ4MR0p5pbQ4TMH HR4+HXF+r1Oj6zMYjOIyj2tJNrP0qkIxe2gTHhlCJbfRk4IaRV+EIn28knEKoDckBIdS ju7aYKObbebiWEgHQl6jnwRKQOXx7cEdlKINEd+fZILc7p0Cxf9X38R5Uk28vlvfALRW QkeJEsVIa9yFEaw0WmI3JqMKdAK/3nZr1PNTZTz46+uzzhzp4sND6/zWUFIYDF2+ss1d 0gipLMWMqKfvcMMwhRcwhOMm3R1BdhkBttujBQ/p+KlVhHl+XIedZ4AMYYM6atI8/2Yo h/dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U8aaplgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o28-20020a634e5c000000b00410702fb5f1si44465661pgl.805.2022.07.08.15.30.27; Fri, 08 Jul 2022 15:30:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U8aaplgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239103AbiGHW0W (ORCPT + 99 others); Fri, 8 Jul 2022 18:26:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238089AbiGHW0V (ORCPT ); Fri, 8 Jul 2022 18:26:21 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D82CDA2E72; Fri, 8 Jul 2022 15:26:20 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id j22so13631741ejs.2; Fri, 08 Jul 2022 15:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HWlKpaLv2VR3Vok4iSI8gNXJv7MjF7LayWn7Z5iN4Q0=; b=U8aaplgioalA7mIrEOI6BxlQFR6mErtWpV+io2v+ksxQVg+k9lnEYU+zCdHIv2Ac6X I9nsORy3aehZXRS3syRxg3scRJHMdJXhMzT2fJSi0GF9wsbNnJvSyLVpmePzCGt0IQJ7 OCw9XBtGA0AkSM0ja5tk5M2vHFUfYb+LjreZu7aYLEJOUqBbOaRjrAiOSlWJ//C+NpUs zKJjR2a0kIDhYaeGNWABr2hacMVUnvi1PXcvtUTFA6rpPko+hKaw4j2QaqL4/9PbHPLF znos7RHZmL1Kkfh3B/JugMS0HkdzEjPP9nQd6wY61WglfVfM8pTvOx5qa2SMUrpM2aWq i4ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HWlKpaLv2VR3Vok4iSI8gNXJv7MjF7LayWn7Z5iN4Q0=; b=tZcPfj/sMNJfxphZPSo5YpFciFnZp3B6FinbGNhO/l3QMHBnLew/3wgPp6RAYggxft o4DrmQe5HFSP0VV56jbuIQYYU9w8+Up0CaMcUG9Pm6Hn8C2agNy869w0m6pB5jxD6NdL NX9KP9J3QIJxWGLj9DVdiezx+dnf8QggVXQXZCn5ahXLWrlSVDtEFpRQ6e/o7dDlno2n pGIFQzyQcdm3YZb+FtGN/mY0Na7MMHzxW0XApgH8GDH+YqbWSd1I6HyZ6IIekB7ZJ3XY WwI/AAy/iqqxjW/7F/ksRw9nCJhkxD8mHezv0wfqk1sw2LdiYQgXVe3GQP4aWECxL47r aHnw== X-Gm-Message-State: AJIora9J0cuL5+E06UlOAcN98wwCn44PS5U9ui+6o/EVXuq5XVxVJnhH Mhu3Jmb6W/3JORx4RKBawEhLnBCttAxFF3Yt+Jk= X-Received: by 2002:a17:906:a3ca:b0:726:2bd2:87bc with SMTP id ca10-20020a170906a3ca00b007262bd287bcmr5782990ejb.226.1657319179460; Fri, 08 Jul 2022 15:26:19 -0700 (PDT) MIME-Version: 1.0 References: <1657113391-5624-1-git-send-email-alan.maguire@oracle.com> <1657113391-5624-2-git-send-email-alan.maguire@oracle.com> In-Reply-To: <1657113391-5624-2-git-send-email-alan.maguire@oracle.com> From: Andrii Nakryiko Date: Fri, 8 Jul 2022 15:26:08 -0700 Message-ID: Subject: Re: [PATCH v4 bpf-next 1/2] bpf: add a ksym BPF iterator To: Alan Maguire Cc: Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin Lau , Song Liu , Yonghong Song , john fastabend , KP Singh , Jiri Olsa , Masami Hiramatsu , Andrew Morton , David Vernet , swboyd@chromium.org, Nick Desaulniers , Dmitrii Dolgov <9erthalion6@gmail.com>, Kenny Yu , Geliang Tang , Kuniyuki Iwashima , bpf , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 6, 2022 at 6:17 AM Alan Maguire 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 > Signed-off-by: Alan Maguire > Acked-by: Yonghong Song > --- > kernel/kallsyms.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 95 insertions(+) > LGTM, except for unnecessary pr_warn(), see below [...] > + > +BTF_ID_LIST(btf_ksym_iter_id) > +BTF_ID(struct, kallsym_iter) > + > +static int __init bpf_ksym_iter_register(void) > +{ > + int ret; > + > + ksym_iter_reg_info.ctx_arg_info[0].btf_id = *btf_ksym_iter_id; > + ret = bpf_iter_reg_target(&ksym_iter_reg_info); > + if (ret) > + pr_warn("Warning: could not register bpf ksym iterator: %d\n", ret); we don't emit such warnings for some other iterators I checked (map, link, etc). Do we really need this? It's very unlikely to happen anyways. > + return ret; > +} > + > +late_initcall(bpf_ksym_iter_register); > + > +#endif /* CONFIG_BPF_SYSCALL */ > + > static inline int kallsyms_for_perf(void) > { > #ifdef CONFIG_PERF_EVENTS > -- > 1.8.3.1 >