Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1116086ybl; Fri, 13 Dec 2019 09:49:17 -0800 (PST) X-Google-Smtp-Source: APXvYqx5Ty3mT9ISXCgog5aCHHlB3KddWO+Gpcag7bYXp85u4M9Lx1WO66uDg7zmTKDq3S7cqVLP X-Received: by 2002:a05:6830:2154:: with SMTP id r20mr15891309otd.66.1576259357171; Fri, 13 Dec 2019 09:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576259357; cv=none; d=google.com; s=arc-20160816; b=fpabPO3ELnS4HrWs5wMrcqj9r+IJBC6/qQexgyl3ibKqZjrhO1JP8rAXBAKrBxFlle HUVqQPvsGjjxeutYZeXL6CrvXZK7DKz7oXe29R0ep5D8iL4xSlFwYACVquKDnFcNkDMn TxWJgy3JojOO3oWQdJkEBrza9lP9+UoynxpdXQr9ZnfmjYbzSvfLOYaAi47/umaBk71E xN1ngcASj4Ooup+epohp//Rrxp+9hO3Dbdjmvh4drdqntAFReRnnOdfWUr5Ppm9ftxAE P3ZA1vYZ5Tp4Hw/ateun6HeQa/IuyDAGq0mtZ9Uin8ZyYMaZ5VdLGpH3Zne8Vz+P26qg eOgQ== 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=eoAJedssCRtORBBwXDIR4/QT9NuQsdzJ4Ntg4pSM5cY=; b=r6vjOYi1c0av2iBWE0ptV7GeL5tfR8yfpiBqn9td/TzxuWhEjXiqRfzK7d2FfinjiO L39uNXFyBYeIDaUIBbjWV1t2ApqnalUzjUHmnhfJA4JE3Pypa/dTX7lcg+MYcq9ez/0X cLnjx5ax/OZAOYkmAQuV31rfsQSHOvs4PnUuzbEgACWvoE7cLob6ibouXEtjl3BnjelK IIOgaZm7/Li1Bt9WqTRFUJWuL3FFF6jiAMd+ZuugU8/W+w/lKrUjJmO+aDmkzf+cALeq kX08Vb6RHdZ9f0r3xjcS7tJEYVtMAFDCbRv8sFp6EKFpBIfRWhzZ1DqwsnwAQHDJbevO 5GQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=1bgwUcAZ; 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 200si5330422oii.156.2019.12.13.09.49.05; Fri, 13 Dec 2019 09:49:17 -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=1bgwUcAZ; 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 S1728589AbfLMRrR (ORCPT + 99 others); Fri, 13 Dec 2019 12:47:17 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46036 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbfLMRrR (ORCPT ); Fri, 13 Dec 2019 12:47:17 -0500 Received: by mail-lj1-f193.google.com with SMTP id d20so3540696ljc.12 for ; Fri, 13 Dec 2019 09:47:15 -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=eoAJedssCRtORBBwXDIR4/QT9NuQsdzJ4Ntg4pSM5cY=; b=1bgwUcAZ78xCTIqaqNviEKuMJb97CygulYIPlFUqxsRkcRsnof435hIi2Xo9UN6RIc AZYzu5lldy7TGNkcuuLDtmbqA1CDS4B8+QWKjQIUCcDOGvfan9LAwAD5e4SGX5E4fWZ8 PXr8h/WLRIBnR5CSWvuAyIOKbY3V1te0Yx+wzlK6CRWEW1gFd8vpWsNfyjUJWPWCOmfv MUC3EwO12smFILAg7MrScMAH0IE4qq/4k65nNGoDEWhlbyWO1MQ6X5wlg7AQ/TmO0+oK uVCG6N9DC/fHP5UGuJFkKhRSC/pUrkPeWc06iatwR9gPJUnsjrur6Nrv/Sbm2NM0Hqat RGTg== 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=eoAJedssCRtORBBwXDIR4/QT9NuQsdzJ4Ntg4pSM5cY=; b=MPoAk/66RoIC1DoCtmOIfTRyU8TEJii3xcbR+i+DIIdDDbZOsL8ZAK7wjDA868Ztfd 3hbo+NdATMS2DfjJtaVnBUIRDV5eVGB/8hanh74/CW7fwf8kfaJkyYLT7+PC9TI4cHuV e5Gjez9VZUjHHVnCc4qkK9gjbz59wpEyJB2RDOw5+DuH67twe6MB8n7FRkHcNzdNBARt Bv252reRBVWETJ3CAcSqtGtLxh0rDrg1xoT2i61s3RiX34/9Zdvw9LGTeB9FzMEf6O66 QZAzX0WVt113eKTSZU2CafZilvxLPtNLisQPz7gJy1RXdHsSaA9G2H4frTQp3UYFLePP gQjQ== X-Gm-Message-State: APjAAAWWUxGzqH/vozvVYQxnA29HaRzkVqQLPq/sa++pGRbwBFfs+tKO HjPQGtUrjq1uvUT2PYKADcxpjg== X-Received: by 2002:a2e:868c:: with SMTP id l12mr9458337lji.194.1576259234756; Fri, 13 Dec 2019 09:47:14 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id j19sm5555628lfb.90.2019.12.13.09.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2019 09:47:14 -0800 (PST) Date: Fri, 13 Dec 2019 09:47:05 -0800 From: Jakub Kicinski To: Andrii Nakryiko Cc: Alexei Starovoitov , 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: <20191213094705.486101a0@cakuba.netronome.com> In-Reply-To: References: <20191211191518.GD3105713@mini-arch> <20191211200924.GE3105713@mini-arch> <20191212025735.GK3105713@mini-arch> <20191212162953.GM3105713@mini-arch> <20191212104334.222552a1@cakuba.netronome.com> <20191212195415.ubnuypco536rp6mu@ast-mbp.dhcp.thefacebook.com> <20191212122115.612bb13b@cakuba.netronome.com> 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 22:48:10 -0800, Andrii Nakryiko wrote: > > improve and hack on it. Baking it into as system tool is counter > > productive. Users should be able to grab the skel tool single-file > > source and adjust for their project's needs. Distributing your own copy > > of bpftool because you want to adjust skel is a heavy lift. > > Skeleton is auto-generated code, it's not supposed to be tweaked or > "adjusted" by hand. Obviously not, I said adjusting the codegen tool, not the output. > Because next time you do tiny change to your BPF > source code (just swap order of two global variables), skeleton > changes. If someone is not satisfied with the way skeleton generation > looks like, they should propose changes and contribute to common > algorithm. Or, of course, they can just go and re-implement it on > their own, if struct bpf_object_skeleton suits them still (which is > what libbpf works with). Then they can do it in Python, Go, Scala, > Java, Perl, whatnot. But somehow I doubt anyone would want to do that. > > > And maybe one day we do have Python/Go/whatever bindings, and we can > > convert the skel tool to a higher level language with modern templating. > > Because high-level implementation is going to be so much simpler and > shorter, really? Is it that complicated in C right now? What's the > real benefit of waiting to be able to do it in "higher level" language > beyond being the contrarian? I did not say wait, I said do C and convert to something else once easy. You really gotta read responses more carefully :/ > Apart from \n\ (which is mostly hidden > from view), I don't think high-level templates are going to be much > more clean. > > > > We cannot and should not adopt kernel-like ABI guarantees to user space > > > code. It will paralyze the development. > > > > Discussion for another time :) > > If this "experimental" disclaimer is a real blocker for all of this, I > don't mind making it a public API right now. bpf_object_skeleton is > already designed to be backward/forward compatible with size of struct > itself and all the sub-structs recorded during initialization. I > didn't mean to create impression like this whole approach is so raw > and untried that it will most certainly break and we are still unsure > about it. It's not and it certainly improves set up code for > real-world applications. We might need to add some extra option here > and there, but the stuff that's there already will stay as is. As explained the experimental disclaimer is fairly useless and it gives people precedent for maybe not caring as hard as they should about ironing the details out before sending code upstream. I think we can just add a switch or option for improved generation when needed. You already check there are not extra trailing arguments so we should be good. > Would moving all the skeleton-related stuff into libbpf.h and > "stabilizing" it make all this more tolerable for you? I think I'm too tired if this to have an option any more.