From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AFACC282C3 for ; Thu, 24 Jan 2019 18:59:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37709218A2 for ; Thu, 24 Jan 2019 18:59:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="ZN5vBWhC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727548AbfAXS7p (ORCPT ); Thu, 24 Jan 2019 13:59:45 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35080 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfAXS7o (ORCPT ); Thu, 24 Jan 2019 13:59:44 -0500 Received: by mail-pf1-f193.google.com with SMTP id z9so3456342pfi.2 for ; Thu, 24 Jan 2019 10:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=YFgzFrjkPMsOp//V0f53NMnLtq8s4Cw7dftz909jdco=; b=ZN5vBWhCAyxgGQPXDgWy7XORxc7xnv2rAPYa8ERlCX8GIe6TcKlsOmEzXhQ1vWpQrs kC7TD0N+/+TgnDjU1OSceHrI+tizz+voewn349EI3KpABzhRnbJVH8ExycFmTtKUAELY ooS+39OFMODsODGunOdZwZI2dA3ML+hMEDXW29uNKBr7LVMXMvYwrhcEQi95QKpU/uvr kIV6PV1zpDaga5MxqWcXh5Kp+p6eaJHTevZknRImZ1dJjUfhf0swifQDYPY7It5dt3U5 86iZc0EVg8EArilnciOi09IpoyFDVkqjej1qAHJ0iiv3zHNm6Aoc6J6nxgD1r09aVzTF NJjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=YFgzFrjkPMsOp//V0f53NMnLtq8s4Cw7dftz909jdco=; b=tJ61Q2EDn9p5K0qg4DuWoz8ycqbhWTJL0+qO5Vu8MNIagjUFT5abaFUzm7BRlF36qi MZvrheHvt5wVyuaOdkUHxgzj/8qMfp/Jx3hxUUiXZV7qqUZ794uY9+fPasWPBFApuduS tL1E9/UQzJyauxBW2w6b3nBVUr2WJJWBpyAKDifO7CQsdFNZaJnDB1iqSwbqDa9uoD6H OVae3jbcX0tWaFqT4qNTELFvKQvFyYrYw5ysCgo0sOQDHsjgcK1FRX+GAkaHCupxbr8G SPj7jFD/V1D+3rtbLSIWV82tTC4bvjeZnzuIEeEGqTd1+uMDw/vL+VIn+6kCcRKlI1FY 7gnA== X-Gm-Message-State: AJcUukcUbvH1E7pQbKOnECk9/B/4MCHSTpX7aFjIXOegJLTES0JaepVC 5FiIBmJhbvOsVtJwhDG1ZSPSd10dkXU= X-Google-Smtp-Source: ALg8bN5hd0qNMRwyhhAxya8mgTSDiLZ9iS8SgRHX4eGEGZhJDWVXFGGFoWhd0rtHlByY94yd9Cwadw== X-Received: by 2002:a63:bd1a:: with SMTP id a26mr6984150pgf.121.1548356384006; Thu, 24 Jan 2019 10:59:44 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id k129sm28800309pgk.29.2019.01.24.10.59.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 10:59:43 -0800 (PST) Date: Thu, 24 Jan 2019 10:59:40 -0800 From: Jakub Kicinski To: Maciej =?UTF-8?B?RmlqYcWCa293c2tp?= Cc: Jesper Dangaard Brouer , Daniel Borkmann , ast@kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH bpf-next v2 2/8] libbpf: Add a helper for retrieving a prog via index Message-ID: <20190124105940.34425143@cakuba.netronome.com> In-Reply-To: <20190124192735.76aaa463@maciek-lenovo> References: <20190121091041.14666-1-maciejromanfijalkowski@gmail.com> <20190121091041.14666-3-maciejromanfijalkowski@gmail.com> <91d162e0-3d15-c1d8-1e80-8d0a4f561540@iogearbox.net> <20190123144159.000051bd@gmail.com> <20190123152451.7fcdb226@redhat.com> <99b1958f-d04c-2b4a-81c1-e9942512df37@iogearbox.net> <20190124130949.1bfbbf15@redhat.com> <20190124192735.76aaa463@maciek-lenovo> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 24 Jan 2019 19:27:35 +0100, Maciej Fija=C5=82kowski wrote: > > > can live with this. In case of typo and program being not found it wo= uld be > > > good to print out the section names to choose from in usage(). =20 > >=20 > > Agree, might be nice as well via libbpf. =20 >=20 > Would it be acceptable to print them from within libbpf? Something as tri= vial > as: > void > bpf_object__print_type_sections(struct bpf_object *obj, > enum bpf_prog_type type) > { > struct bpf_program *prog; >=20 > bpf_object__for_each_program(prog, obj) { > if (bpf_program__is_type(prog, type)) > pr_info("section %s\n", prog->section_name); > } > } Better not. > Or do we want to add a accessor for section_name and go through programs = in > application? bpf_program__title(), no?