Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1185847ybl; Thu, 12 Dec 2019 10:59:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxQH2dkmRe0cv8V8z5xK7vgmUVRTO+ZPcYnQx6Z8p9pM+hBtObaasnGUErk3qaqrxjLwOwF X-Received: by 2002:a9d:da2:: with SMTP id 31mr9353033ots.319.1576177156560; Thu, 12 Dec 2019 10:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576177156; cv=none; d=google.com; s=arc-20160816; b=qp/E4PH7hMq3CDc4J0Q8guiM2SU1rf7iSdScXo4UdIe07GFeoPE2wcGKLmwycZqGQa 1FiP4v+evz6BmPplcTHTIVMkiJd4oOo8NRrWhMGrh3ag6pOriRjjj5NTrl0Y3XMtnaPU BG2wQbcXDQE3XdjQ3BOqNGCOTHmb+T0sSds26wnC2WnoQZ0Nq0KTuTz7iIQmEN7gd0IS g8KZoHoC/x/Glc3uk/DhjYCKCw4/WntfBV4diYwF90MZOuEjxQK9AsdAZgzsHWeZxKTW +HufTmYZ9nOn0FkXABKleySihg5n58GujvUh8cbuDN1sLs9qPGwzGw1Pg1EDAYg687Br uQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gYPGE035C6lEVvvqqJzcqgZi6QzjwvA5z8YoBsh/CjI=; b=o7abiSgUUcPiMBOxIeAOkuXtN79c8vzxFSzLu/htF09CZUKzC9254JB2WIj6Y3FwrQ 5ec3C8NXMMairI4iAqbctys6G67iO088Z5vAZNDM1PiHcFHhUo8rspnXkMOu3qj7xOVI KrK16mvwfpbAD5b+8OUtu3trND0+OWZiQQl6Th8LQU6QrYE8v7R8mURz93CWGqHDIzNX T1hFBUX6+aNzLlXF8izfQ8To4M9l+zD5GEtF+R9fxFSGjPTwfA/465Y5ZOyT1Zev4o+t /kY6i3TtTnvgGBsihi9fMNgAjv0c3iU6LWQjULDvXkyGDzdzlyL0dpcWpUscOvouHgEm UTJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fomichev-me.20150623.gappssmtp.com header.s=20150623 header.b=m0k9X5VO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si3741140otq.134.2019.12.12.10.59.04; Thu, 12 Dec 2019 10:59:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fomichev-me.20150623.gappssmtp.com header.s=20150623 header.b=m0k9X5VO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730496AbfLLS6d (ORCPT + 99 others); Thu, 12 Dec 2019 13:58:33 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41562 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730511AbfLLS6d (ORCPT ); Thu, 12 Dec 2019 13:58:33 -0500 Received: by mail-pf1-f196.google.com with SMTP id s18so1269916pfd.8 for ; Thu, 12 Dec 2019 10:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gYPGE035C6lEVvvqqJzcqgZi6QzjwvA5z8YoBsh/CjI=; b=m0k9X5VOLcp9Br4ajlBHHaK+6pNEd9o63DVIO/RsLqmTirnxWr3TenqJwCAftb3OjI beF/jxctjFLaYQGGrw72ZwgXtvBKRIi2N8ggMI3esTBOJ/E1y3ZUUeBPUQXa423IZtp3 oo20/lS83lIWMxo04iWXHSs52RpyT2ny72bAPDy23LzgdRknvBgIJ4NuBXXzEasg69mw hZCmlFfmBz02D1dJg89Md6fNhkVvrke57IznDIEhTiOG2De6Ng7A3nHqKF+Mk6aqdSjy er/fsvkubgws72c6LwA8wmeqSPMsub1tjJn2eNmiatyVbXSSPfIVoh/TPDtAozoS/HnB 2wCg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gYPGE035C6lEVvvqqJzcqgZi6QzjwvA5z8YoBsh/CjI=; b=BQkmIYAmZm+304GrhhOp5zcbmlFz35KFA4Z6Sn3nT+5WkmC4wwGXB2bjw+fheH6ZCd AFAOB6/5qoliKdLrtGKxtEytybIksM64wE8rVQN33GdckUKC5r7eUkE/Gm9hbXDTeYoM gfMr87XfSRepjuxF3H35iO8MXb3yl9WuAAWx03GKRYVlFiiMjAbzE5ruWZjIR8zvukzU FkdsQPVWtFtFv0hnH0O6E82cm72I0OnDPPQjzi2OvhT/RyE0I06QzV8OsAy3i76sxrVk Ph9ieBDOXNT5n6c5Ei6vKe7C0s9RFKVY5hlWSR8EWwInAwGUz0plQbHeaVGEoL8CjA8S iBoA== X-Gm-Message-State: APjAAAWlzwAbEPGDeaS/fTyXJnLLaIt8zj4rGIWQcKB561E6DFJfxlNQ i/87tKaJOTlTP4bj+vqDH3Cr2A== X-Received: by 2002:aa7:951c:: with SMTP id b28mr11200168pfp.97.1576177112270; Thu, 12 Dec 2019 10:58:32 -0800 (PST) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id h64sm6894647pje.2.2019.12.12.10.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 10:58:31 -0800 (PST) Date: Thu, 12 Dec 2019 10:58:31 -0800 From: Stanislav Fomichev To: Jakub Kicinski Cc: Andrii Nakryiko , Andrii Nakryiko , LKML , bpf , Networking , Alexei Starovoitov , Daniel Borkmann , Kernel Team Subject: Re: [PATCH bpf-next 11/15] bpftool: add skeleton codegen command Message-ID: <20191212185831.GN3105713@mini-arch> References: <20191211191518.GD3105713@mini-arch> <20191211200924.GE3105713@mini-arch> <20191212025735.GK3105713@mini-arch> <20191212162953.GM3105713@mini-arch> <20191212104334.222552a1@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212104334.222552a1@cakuba.netronome.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/12, Jakub Kicinski wrote: > On Thu, 12 Dec 2019 08:53:22 -0800, Andrii Nakryiko wrote: > > > > > Btw, how hard it would be to do this generation with a new python > > > > > script instead of bpftool? Something along the lines of > > > > > scripts/bpf_helpers_doc.py that parses BTF and spits out this C header > > > > > (shouldn't be that hard to write custom BTF parser in python, right)? > > > > > > > > > > > > > Not impossible, but harder than I'd care to deal with. I certainly > > > > don't want to re-implement a good chunk of ELF and BTF parsing (maps, > > > > progs, in addition to datasec stuff). But "it's hard to use bpftool in > > > > our build system" doesn't seem like good enough reason to do all that. > > > You can replace "our build system" with some other project you care about, > > > like systemd. They'd have the same problem with vendoring in recent enough > > > bpftool or waiting for every distro to do it. And all this work is > > > because you think that doing: > > > > > > my_obj->rodata->my_var = 123; > > > > > > Is easier / more type safe than doing: > > > int *my_var = bpf_object__rodata_lookup(obj, "my_var"); > > > *my_var = 123; > > > > Your arguments are confusing me. Did I say that we shouldn't add this > > type of "dynamic" interface to variables? Or did I say that every > > single BPF application has to adopt skeleton and bpftool? I made no > > such claims and it seems like discussion is just based around where I > > have to apply my time and efforts... You think it's not useful - don't > > integrate bpftool into your build system, simple as that. Skeleton is > > used for selftests, but it's up to maintainers to decide whether to > > keep this, similar to all the BTF decisions. > > Since we have two people suggesting this functionality to be a separate > tool could you please reconsider my arguments from two days ago? > > There absolutely nothing this tool needs from [bpftool], no > JSON needed, no bpffs etc. It can be a separate tool like > libbpf-skel-gen or libbpf-c-skel or something, distributed with libbpf. > That way you can actually soften the backward compat. In case people > become dependent on it they can carry that little tool on their own. [..] > I'd honestly leave the distro packaging problem for people who actually > work on that to complain about. I'm representing a 'Google distro' :-D