Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1174037ybl; Thu, 12 Dec 2019 10:45:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwwA8+kza0ncy+Kj1ShXSITHa4Jkn+mErif7JK84bm0EZlYvXa9oNq4eFryGJmqvTxE9Jg0 X-Received: by 2002:a05:6830:22e3:: with SMTP id t3mr9303713otc.193.1576176330496; Thu, 12 Dec 2019 10:45:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576176330; cv=none; d=google.com; s=arc-20160816; b=yA6O176Cz2RsV3xngg3CH6aXdASvStCpcLyEqbwVQ8BRy2+G3uIbS5Bwm/rSMGJ/aI oMgLo2fMlPzbZTmt3kytNp8oHkwz9yOmTBKsPAVd/t8t9cNOudIGncyvKArSk08GRWwV RcWSzS8tjDgUP7McRnVdo/yNvpOqgzdUn4KuEg5IIQZVIZRAZfAedGvj6wZ3F4/nIqKf MGFtyJM8sV9E7mEbIqaAz0MEpuWh0PJ5ZqOoidD8PxYbXN1tDmnTMp9cU3jwkNm0zyRk iIo9/qSmZ6wePPOmIkRp2YdBjJ5/+sXRgRx1Si5zyVvVdroXzWmHQ2/qn8NTHoM5lWFN bqng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=fEIPg/nQz4H3SkrhOeevoDfxx5kg6oJ1sVD3wkmZeI0=; b=JBK2Sk/pAlSx/L2fnixsaGO9oFC5+qr7l5qBHwg3fiISKvRF5tLkb4BTyWB+9EPXmQ EfVr2CYz+cA6MekbcXXFFTXSHpuyiB2TCCm7UxtllGhxiFqxqxYrlwpyP31nmMTuJMLQ ozsUGFcv9ox9ah7o57d97OS6LaDEPpK4GsmST0kfJibIpGWAYvlw14exP1UQLEdUheq2 oKk7G9FwNATeDCHokRAd54Mz7HdaeH++fqr4CuHuthL3OuyvbECPTrEnyu7dLyfip/sZ yXWiwgJV1h/rKGrwjYkF4+I1toeomjtXsII/jrO1sj1pdyp/nL9RN94IeAFkZKSvZT5b aBbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b="ABRb/h4S"; 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 l8si3725760oii.249.2019.12.12.10.45.18; Thu, 12 Dec 2019 10:45:30 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b="ABRb/h4S"; 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 S1730516AbfLLSnj (ORCPT + 99 others); Thu, 12 Dec 2019 13:43:39 -0500 Received: from mail-pf1-f182.google.com ([209.85.210.182]:38035 "EHLO mail-pf1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730454AbfLLSni (ORCPT ); Thu, 12 Dec 2019 13:43:38 -0500 Received: by mail-pf1-f182.google.com with SMTP id x185so1241381pfc.5 for ; Thu, 12 Dec 2019 10:43:38 -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=fEIPg/nQz4H3SkrhOeevoDfxx5kg6oJ1sVD3wkmZeI0=; b=ABRb/h4SFCN15IlJ59pRxlKmFUVBRkKSP6xEkKHRgMqwZqw8UpadE/n46IhjBKm0xI Hw1BTt6v5y/rIocXnccHBkGIZVICyVqoz7xSWV3uvQoQCugmlWIqMOnOZYzBrg5cUpmG 0+5vBkHOKMxEjtmzhGa3uzOdCsXMc7nOlFLXDOzzplMSDchmHph+zrBYze+a5cBo+LX2 ymnHRs8Jc2JLBOi7lFmdClxmXEtdYs8rvZ5Bap2HczqawwPjhm47w2r/96Lb/IiRn55+ Vc8URDEpeNvnjiUsCGI37gERHaXpJDwJbNcy+GHI8WYirzeS+z/DZdl/KAJQzyYcmXDj q2vw== 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=fEIPg/nQz4H3SkrhOeevoDfxx5kg6oJ1sVD3wkmZeI0=; b=ZCi+epnPq8q67X/uGRIrRqwEQfjWZNy+PbQjchTiVFoyPa+qqjSFY9Wf+EDNhWlivL ajK4S66UugB4bzmLfdvTAm8MvlhHc2hahuhuchq4bukmlMJvcml5QMLbHTAxIZlNx+9b tZRiO9bc3ofy3JoQrpcGPmqdd9ldphEjzlYIhe4ojS2e+jnUeEQMgr33duxLWByT71Uj leSBZTRhqpJf608k8oQD5NHQ/jGYgxlMcAHvrkvFJhMr0KEWZ0rvF87fNTX3GqSDqYNi LPXaeaSag3PmyFVwXhj6ifPYOM8973j+fzwjmEqXMGB02yQbmiIiEpoGmiDbj1JVl2P5 RT8A== X-Gm-Message-State: APjAAAV8qmcKyZHYMu9+A6O1tDVamNb1/Wrxb6Rkpzg6rzOfPcsDt0L0 IDhjMMSBLfdwgYYSV5x1OgiExg== X-Received: by 2002:a62:1742:: with SMTP id 63mr11114346pfx.231.1576176217889; Thu, 12 Dec 2019 10:43:37 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id j14sm7532044pgs.57.2019.12.12.10.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 10:43:37 -0800 (PST) Date: Thu, 12 Dec 2019 10:43:34 -0800 From: Jakub Kicinski To: Andrii Nakryiko Cc: Stanislav Fomichev , 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: <20191212104334.222552a1@cakuba.netronome.com> In-Reply-To: References: <20191210225900.GB3105713@mini-arch> <20191211172432.GC3105713@mini-arch> <20191211191518.GD3105713@mini-arch> <20191211200924.GE3105713@mini-arch> <20191212025735.GK3105713@mini-arch> <20191212162953.GM3105713@mini-arch> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.