Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6175766imm; Wed, 27 Jun 2018 03:35:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLTCLQXgwiwLSqqUoOzieaHEc50/qLMItn6tbIHAusjqoDbtJ6rbhAkBH5Pf5Q0igz3iyD+ X-Received: by 2002:a17:902:650c:: with SMTP id b12-v6mr5566804plk.31.1530095756379; Wed, 27 Jun 2018 03:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530095756; cv=none; d=google.com; s=arc-20160816; b=USYzPHAcD7Py4zd4G11/Dks79m878eEzyxGOMdcbx1kjrnIsP2vgqQuD0e2hLndEd+ vj0VpCoQET4fPxWchcUR/xXaCIsKZ0tvNBvuvOp8kJHaeOOaPGXHuLX8jlR/XjDgATX0 xBFdt4ovQbaMWoFjKqlgf6NULVWEJJMc/TbXjWuwAlflcKHLtnSjgsgbLW4SqvMZxyWH MV8kQq1DFuDFdsLhM1Xu5H3V122ToQM/Ew252O55TDz82hUGD5oHcQac8me4Gi+UE/xJ 2hy+RF5z+LtdOoUM48Wmj4lEDdfxvZmPst7OHiEBtAAj+egD2X2P+P3NxWVj3zCVKReF 4XqQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=A7U0Its3Oy1eBt2AFWtfzDvLBcaf49K5znWr/uK6ztE=; b=pwWKiROhaLrWP7BPs2FEUpu1rfLUqO5uRF0FNiH32zBLH7Igm0U3q1rd4hnPVnY4oC x0/NHdMG7jG2u62Cz5lRd1xob6up4Mx5PIpIwisuyEnYx44oQ2EAUnXp4rAYpxFHgtPD pid6saCbbcINVWVJMODayRSBbg5RLZh1E2NgLu76EWIiai9w4XUtZdXbHfqL/+LjDtLu yUXEdggY/NVjRCV6cpldql5MjgHgsT8QHXA5szeP/RKlFvhkE1qSVT223cbLLQxkSf2P jOAo5OzOMr37sN94BgjcCJKQ3k+cQdM6w/IjC6yOb3Eyw9VQzu+1UJdUPJ1lslD6JMcq MdWg== ARC-Authentication-Results: i=1; mx.google.com; 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 g2-v6si3365739pgo.367.2018.06.27.03.35.39; Wed, 27 Jun 2018 03:35:56 -0700 (PDT) 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; 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 S1753607AbeF0Keo (ORCPT + 99 others); Wed, 27 Jun 2018 06:34:44 -0400 Received: from www62.your-server.de ([213.133.104.62]:47984 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753445AbeF0Ken (ORCPT ); Wed, 27 Jun 2018 06:34:43 -0400 Received: from [62.203.87.61] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fY7mW-0002vT-1d; Wed, 27 Jun 2018 12:34:36 +0200 Subject: Re: [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality To: Jakub Kicinski , Martin KaFai Lau Cc: Okash Khawaja , Alexei Starovoitov , Yonghong Song , Quentin Monnet , "David S. Miller" , netdev@vger.kernel.org, kernel-team@fb.com, linux-kernel@vger.kernel.org References: <20180621172523.6cd00ed1@cakuba.netronome.com> <20180622012052.htkvholi674x6i4f@kafai-mbp.dhcp.thefacebook.com> <20180622114032.162b2a76@cakuba.netronome.com> <20180622205535.c6vjhdwt5er4wc32@kafai-mbp.dhcp.thefacebook.com> <20180622142743.2b890d0f@cakuba.netronome.com> <20180622225408.jor7lpvsksnwiiec@kafai-mbp.dhcp.thefacebook.com> <20180622163200.20564ec4@cakuba.netronome.com> <20180623002639.h4qxy7aakypi6t7b@kafai-mbp.dhcp.thefacebook.com> <20180626164820.GA12981@w1t1fb> <20180626133133.618af1d3@cakuba.netronome.com> <20180626222709.fsznwqauxojhhx7v@kafai-mbp.dhcp.thefacebook.com> <20180626153559.0511f709@cakuba.netronome.com> From: Daniel Borkmann Message-ID: <23968d53-2895-f0bc-a38c-5bc99e1846ab@iogearbox.net> Date: Wed, 27 Jun 2018 12:34:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180626153559.0511f709@cakuba.netronome.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.0/24700/Wed Jun 27 06:38:23 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/27/2018 12:35 AM, Jakub Kicinski wrote: > On Tue, 26 Jun 2018 15:27:09 -0700, Martin KaFai Lau wrote: >> On Tue, Jun 26, 2018 at 01:31:33PM -0700, Jakub Kicinski wrote: [...] >>> Implementing both outputs in one series will help you structure your >>> code to best suit both of the formats up front. >> hex and "formatted" are the only things missing? As always, things >> can be refactored when new use case comes up. Lets wait for >> Okash input. >> >> Regardless, plaintext is our current use case. Having the current >> patchset in does not stop us or others from contributing other use >> cases (json, "bpftool map find"...etc), and IMO it is actually >> the opposite. Others may help us get there faster than us alone. >> We should not stop making forward progress and take this patch >> as hostage because "abc" and "xyz" are not done together. > > Parity between JSON and plain text output is non negotiable. Longish discussion and some confusion in this thread. :-) First of all thanks a lot for working on it, very useful! My $0.02 on it is that so far great care has been taken in bpftool to indeed have feature parity between JSON and plain text, so it would be highly desirable to keep continuing this practice if the consensus is that it indeed is feasible and makes sense wrt BTF data. There has been mentioned that given BTF data can be dynamic depending on what the user loads via bpf(2) so a potential JSON output may look different/break each time anyway. This however could all be embedded under a container object that has a fixed key like 'formatted' where tools like jq(1) can query into it. I think this would be fine since the rest of the (non-dynamic) output is still retained as-is and then wouldn't confuse or collide with existing users, and anyone programmatically parsing deeper into the BTF data under such JSON container object needs to have awareness of what specific data it wants to query from it; so there's no conflict wrt breaking anything here. Imho, both outputs would be very valuable. Thanks, Daniel