Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1376809imm; Fri, 22 Jun 2018 15:50:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLdGTfaUcXvamswdoZMiGQbiynutZtRtkD8Rrm4sDmXS+ISniPDjB8mG1Mo2/DOi3l4g6BJ X-Received: by 2002:a62:e401:: with SMTP id r1-v6mr3567779pfh.172.1529707802577; Fri, 22 Jun 2018 15:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529707802; cv=none; d=google.com; s=arc-20160816; b=u+H1PorzDtq8HcHcccQIrtI+GToXVjdjtHjQyhIZD4j/Re7Bxiysi/82R/gqwsUEzW vDBkv9oqgV1lu/cX+B+o/lO08VvX0Pt8KkOZCzoJVGjv9lcSlrYiBQQtyZq09nnC6k6C f5cygAU7YUXN2cgcqibJKYmoh5LJQQps62k1c994A/3G/cbazoo4mQGmd2BbiBiIhhMA xoNDSIrnipdKNxBJVxStYZoEC40jwwBxtobhw3guKNulxLbRQAZX5VMTeNftzNLA7VmD 5uO7YKygWpNNahpB+bIarK6XZTa9pWQwUSz2Hb4nA5cp+s6V3Rf3BdEt6tFIRZrUjd7T ywxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=z6QM3WWQdKplHy9rJdf4XVvc/2uhaGk3koOp1kEFSuk=; b=gUVtTPmHCokL1pOkO59bVUHWjsie5ngz7ERJDZ4AvRy2/tNGKDEOdjG9mUysuP4hyq utHMFDEoC3ENaftt97RKRFbzfiIBwu+WoNmqFs1p+1YmQIlFAPZ/RhAsK6YRDESPuOvF Zz+0UIo5lVSzUtdry+zpBz+444E2iHFtsaAi8jIt+JGHRwJ6XCUxrHNr3jP1fDdK1+J0 PGuyVNnw1A5sLh7LlCLGsjyFaPelIP8AsZjn5gNwhoctbPOp+1yfhZrZnfINd/ZABz6b g4fjEnvZMJ8r1a6t4lJ2w8KjxMVgxtqpTt/ty5RkiavpbA4OZs6+WIMd8HyOy/eGnh/e 9WUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=F1CFofBC; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=k4SDKpX2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 84-v6si8217707pfa.60.2018.06.22.15.49.48; Fri, 22 Jun 2018 15:50:02 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=F1CFofBC; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=k4SDKpX2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833AbeFVWtD (ORCPT + 99 others); Fri, 22 Jun 2018 18:49:03 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:53376 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754559AbeFVWs7 (ORCPT ); Fri, 22 Jun 2018 18:48:59 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5MMki42004761; Fri, 22 Jun 2018 15:48:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=z6QM3WWQdKplHy9rJdf4XVvc/2uhaGk3koOp1kEFSuk=; b=F1CFofBC1Y3N+J2sBYHXNOQGG1cDGOsbavYGud3Nx4NtsZ41UhLEJGqkkC++1i6ZDv60 a5Hen188Ht8Ba8ZPzEkdJc3xKSZwjAnlIuQAWc6R+oFJrD3rVlhwTKFuZ3UGR5r2BNQK HkPd3a9+e4wejkaCedkkFPeml2OcyBhRgwQ= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0b-00082601.pphosted.com with ESMTP id 2js4nx8wpe-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 22 Jun 2018 15:48:31 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.25) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 22 Jun 2018 18:48:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z6QM3WWQdKplHy9rJdf4XVvc/2uhaGk3koOp1kEFSuk=; b=k4SDKpX29uLdseH25p8PaE4XAnb/f+L6iOiEw1/1kQWmzZMF79/uw9NLvBewQlTuANSCFhmUVBSSdqNFS2uyCW3nYkesdz4pwitQsausdd8n7Cj2QqLTfuxijjJ4MN1q9eppP8wAddi6OKVK9nHrbGB9LshdESGFpETvDx7wSqA= Received: from w1t1fb (2620:10d:c090:180::1:f383) by DM6PR15MB2508.namprd15.prod.outlook.com (2603:10b6:5:8f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Fri, 22 Jun 2018 22:48:24 +0000 Date: Fri, 22 Jun 2018 23:48:12 +0100 From: Okash Khawaja To: Jakub Kicinski CC: Martin KaFai Lau , Daniel Borkmann , Alexei Starovoitov , Yonghong Song , Quentin Monnet , "David S. Miller" , , , Subject: Re: [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality Message-ID: <20180622224811.GA2566@w1t1fb> References: <20180620203703.101156292@fb.com> <20180621145935.41ff8974@cakuba.netronome.com> <20180621225117.dhrkrtmkfbeihbe4@kafai-mbp.dhcp.thefacebook.com> <20180621160719.2cfb4b58@cakuba.netronome.com> <20180621235746.dfq6kdtkogftw3ws@kafai-mbp.dhcp.thefacebook.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180622142743.2b890d0f@cakuba.netronome.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Originating-IP: [2620:10d:c090:180::1:f383] X-ClientProxiedBy: MWHPR19CA0023.namprd19.prod.outlook.com (2603:10b6:300:d4::33) To DM6PR15MB2508.namprd15.prod.outlook.com (2603:10b6:5:8f::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87e917f4-3e50-466e-db95-08d5d8924546 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DM6PR15MB2508; X-Microsoft-Exchange-Diagnostics: 1;DM6PR15MB2508;3:yFKQ0vQyb/yKSl6cJr3Pnm6kZhlc01ieQSLgHnaMEuyQ3V1TodPDOVFJbSIx1lf4m+Nq+kDA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ZaDcFZAHZ+mfKiZCf6OarakloGmjvzWCBBjyF25EFelnhcc6aQAUrhsH/hMaH/FNZ5MKstLiY8mGRJi5G3CB4ZzFlSdsgVh3DgZlfsttoRsqPj7iJZnde5KQaVXdc8ZWPfxuWdXnniMiCs1xdUNMgF6mk4z7s+w87pdSpyUk57R3Xup0NvSiOIHS+78U9sHHY0ro57bT5LKhr+pGGyGMNfhiTvsiszRktoCfbKXL3LbTXyBme2rKsCvCTipcYppSQE5YcC0XKwLz98DR;4:1UbA7xLkjKS4lT7PaGKQ0lreH1VQJWdc1p9dYhETvSYuwoM5F27tkuk2Iue9ulQTmIwbznSreMQCPRZTXh/i2DQ3+0G+gMm6Gy82gDvIVtE1JE06vKoVQs38oDixiX2TJdhTR33MVjUho6NBF7D22ILZdmfoTrPRKjjuBUg7AsdeTPFulGyakXtn4RhhaJ6lv+xD71yl3Lgwi3zjj3mysxQE3lCVM73ac6B+32AppwlR8AuVJ+uYIEsvQ8XGwc4gTUha0Et7HHJelKpq36JVXg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DM6PR15MB2508;BCL:0;PCL:0;RULEID:;SRVR:DM6PR15MB2508; X-Forefront-PRVS: 071156160B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(366004)(396003)(346002)(39860400002)(39380400002)(189003)(199004)(229853002)(478600001)(81166006)(81156014)(8676002)(97736004)(47776003)(54906003)(55016002)(7736002)(305945005)(33656002)(8936002)(6916009)(6666003)(46003)(5660300001)(6116002)(316002)(33716001)(1076002)(58126008)(16586007)(39060400002)(6496006)(33896004)(186003)(16526019)(59450400001)(52116002)(386003)(52396003)(25786009)(76176011)(93886005)(4326008)(6246003)(105586002)(68736007)(11346002)(9686003)(53936002)(86362001)(446003)(2906002)(106356001)(476003)(23726003)(486006)(50466002)(18370500001)(21314002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR15MB2508;H:w1t1fb;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM6PR15MB2508;23:6hw/OAiJsocizF8n+lwA+D4U1efGimIJ8/IWJrztm?= =?us-ascii?Q?ezX1eTZaYB1MAIK7E8mgtZ8UB2t+gsgDXzkRF60BsJIHtUY8l29Q71Rt1uSw?= =?us-ascii?Q?FWsMoHVsR+02v9aO+kio3u8ILxqtEavwTgpMISQXnlPT8ozsgREyEUxl/U9l?= =?us-ascii?Q?kMZM5wFED16Uc55H+gFg1eG/oCN8jTkeJb0aL9/2G3z0xGX9Y8mIfr22/XcD?= =?us-ascii?Q?PWXd57nvqhbpsCkKDfkFiVzKyZLakZ5oQx1PoKgdDuaKMuGkooruyi08loXH?= =?us-ascii?Q?ApF6au7OPSdQNEU5fPXrWesuebWHjzg0kh4SuWsDJSDY1EuzZ6euOlche7K1?= =?us-ascii?Q?yhHSn7whaBpSUh/2wC7T2dz75y2Rzk9HZ/ZTZ6hpZqcPUtZmP1n0ohY1H5MS?= =?us-ascii?Q?8zYePICPRwge0kwJMjsdyE2szKiL8/0a2HppHyIMgTebncPAkWMa6ikPnxnJ?= =?us-ascii?Q?TVo816PcrICEzIy9Y11Vk+CLdQLmxJ9R/ULiGr+SbykGU+WiGZlarNaeVOW1?= =?us-ascii?Q?F/y+XDOCAmZxAs+ZBLTV0w9CFf2tjcDaxF99PcUaX1VOQj5Dmjf4jHZ/zjC+?= =?us-ascii?Q?rL5BSDjXCG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I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM6PR15MB2508;7:5GZWoYsbh1tKioj0pnz5Xaqs0nQXL5Ra2uEP8snyGs2f5npYCHQqDuTvN80BgnAidT9UmnunjhSc3l0EpkJ+eqR8AXfRBeBGPH94M0UPfgVC2UqfxgrZ6D18IlLTilsBPvnu45Od5YIbEA8W/6BUbEH+Y94a651okn1t9l/zu3BlHbIWAD+FnzBSiDsWgBzbfhN6T99bjfyEhAGaQPGPYlgzPiKzBgHikvKm026wUF0Jhhkz5Rpw11f/8VkKqTRr;20:oplfJkZjyHIZesS4ivKCKShtSOf/diN9JpQ7OdCHwLR0/ig3zG2xRzpLTR5IxD4LDjbWmX5oNjO/CEZ9zbXUAGcozFIqeCAPDzLvyhSkA566lwUntQoR0moAutvkMa4W+7dWMNUfdflXX4JozPzgs/ppWp9ysw+EyP7p4Wwx1EU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2018 22:48:24.6955 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87e917f4-3e50-466e-db95-08d5d8924546 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR15MB2508 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-22_03:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 02:27:43PM -0700, Jakub Kicinski wrote: [...] > > > should just use the BTF, I'm not sure we should format indexes for > > > arrays nicely or not :S > > > > > > > The key could also be a struct (e.g. a struct to describe ip:port). > > > > Can you suggest how the "key_struct" will look like? > > > > > > Hm. I think in my mind it has only been a struct but that's not true :S > > > So the struct in the name makes very limited sense now. > > > > > > Should we do: > > > "formatted" : { > > > "value" : XXX > > > } > > > > > > Where > > > XXX == plain int for integers, e.g. "value":0 > > > XXX == array for arrays, e.g. "value":[1,2,3,4] > > > XXX == object for objects, e.g. "value":{"field":XXX, "field2":XXX} > > It is exactly how this patch is using json's {}, [] and int. ;) > > Great, then just wrap that in a "formatted" object instead of > redefining fields and we're good? Please don't let two formats of same data in a single ouput. Overloading same output with multple formats suggests a confused design, IMO. It will confuse users too. > > > but other than that, it does not have to be json. > > In the next spin, lets stop calling this output json to avoid wrong > > user's expection and I also don't want the future readability > > improvements to be limited by that. Lets call it something > > like plain text output with BTF. > > I don't understand. We are discussing JSON output here. The example we > are commenting on is output of: > > $ sudo bpftool map dump -p id 14 > > That -p means JSON. Nobody objects to plain test output changes. I > actually didn't realize you haven't implemented plain text in this > series, we should have both. > > > How about: > > When "bpftool map dump id 1" is used, it will print the BTF plaintext output > > if a map has BTF available. If not, it will print the existing > > plaintext output. That should solve the concern about the user may not > > know BTF is available. > > > > This ascii output is for human. The script should not parse the ascii output > > because it is silly not to use the binary ABI (like what this patch is using) > > which does not suffer backward compat issue. > > What binary ABI? Reading binary data and linking it with BTF information. > I'm also not 100% sure what this patch is doing as it > adds bunch of code in new files that never gets called: Please take a look at the patch then :) Code in these files does get called. We seem to be conflating two different - and conflicting - intents here. First is progam-readability of the output and second is human readability of the output. I believe both are important. Let's leave existing output for programs to read. That way we can try to keep it backward compatible as well as JSON compatible. Let's dedicate the new BTF format for humans to read. That way, we don't have to worry about backward compatibility or JSON compatibility. Let me know if this is not clear. If we agree on above then I think we can move towards a solution. Thanks, Okash