Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5427477imm; Tue, 26 Jun 2018 11:02:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJuTlH4HhX1bo16FbVj2rRQkyHpDyFJOD6FgjgT1LLXiPmEtNlCxkPMD8iiNHik/dfTKTN9 X-Received: by 2002:a17:902:89:: with SMTP id a9-v6mr2607466pla.326.1530036151863; Tue, 26 Jun 2018 11:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530036151; cv=none; d=google.com; s=arc-20160816; b=L7mUB2zwBrYtX6gmjB6f9nImNMhT7yCb/lvlaRpdtCkuZmUWP66PIEDOfYzEqeKO2r DnztuqaVekkp8mnjoIRJ7V9RJYgf/zg2lcN3dxveBaM6yt+hibYeJKIIvxz5cxAmvbuk o0UrnXcXEOOgiWK+PoVNjDu6Hei3ghX5Ar1gZ2GY+oCovDU93PQyUZf4/c7jSrTWxVrB XwLqGz7CFHg4AQRT28Ed+hGXPg0Gwt8Qj6GDhmJvnMMXVUO7kVv3LYxvp2woJvgtMAma S6frXuDSdmZAFu4gCyYqoTftTKH0D+CmEcQHfxQCg8m+XLcPGNv18UPDSxeD5yZbl/+X Ta0A== 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=+YLNWF5K6W19FwaBUwiWxUsjK8w37zM+t9N/QxQ46RM=; b=c/nYsEBbzbYr7rNYAFInMei4JkKXu2TgyM96QVvetVx1agy8hNPGa8A1FrfRtHppbn t1GKbVGXxjL1HxQUmJTTqZmJa4EZ4n0eHYT6A4ClItX6TmAfsQ58nM8xVN9upbZK57ZL nDKVZxQZxzTd52HIUUSaukIFIxIkDeRLilSNrhhtJbBmD+y+7XaQ2QlJ8M0TPMuBu1bh KQGssq8AwNJYOyJW/ZU5VFMKiRS534/rs2nUzOisZW5v1jUt3+UYzPobB5yWYCWc7f8R aT7YHlU3UH7gQ5cy4mri+EUYtvA409dkH7jKBVkaMSZOnWEg35QxJfpisFe53t1BRzhO 1B5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=gUBGLzwS; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=eviOkKrc; 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 q18-v6si1773762pge.576.2018.06.26.11.02.17; Tue, 26 Jun 2018 11:02:31 -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=gUBGLzwS; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=eviOkKrc; 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 S1752805AbeFZQtB (ORCPT + 99 others); Tue, 26 Jun 2018 12:49:01 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:53414 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbeFZQs6 (ORCPT ); Tue, 26 Jun 2018 12:48:58 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5QGj5l8001600; Tue, 26 Jun 2018 09:48:42 -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=+YLNWF5K6W19FwaBUwiWxUsjK8w37zM+t9N/QxQ46RM=; b=gUBGLzwSVzph3NEQVqmhU9GwagPc2GnCfTPLKkw9OJ8KJVyz1wnr8eTYI3cfnB8/OMNK mWoAZE0y0h9yhPF1IR3kMg1OcdeGzxY5Pr68wa7fLc61AJdu5dqAMztgXykNrDuZ4kz5 4asVKUqEern58clOLTr3/DsgRb9EZsE7Y30= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2jus8m00h3-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Jun 2018 09:48:42 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.33) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Jun 2018 12:48:40 -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=+YLNWF5K6W19FwaBUwiWxUsjK8w37zM+t9N/QxQ46RM=; b=eviOkKrcCwrrCQbDVoVFKzCRitEekc8dhRBYANyEsoE+N7vhNCSD31XrV9voYiUEfAW2HL8mbRNDIe3/Sng+n+OPx5qcG0OoZAttl/CFaKHXrnDGaAV33UgHZyeU1r4R8CgQwywd7UEJj5Foh+KTGKa92ET2gRer9HKrABXxAGw= Received: from w1t1fb (2620:10d:c092:200::1:a234) by DM6PR15MB2507.namprd15.prod.outlook.com (2603:10b6:5:8e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.23; Tue, 26 Jun 2018 16:48:37 +0000 Date: Tue, 26 Jun 2018 17:48:22 +0100 From: Okash Khawaja To: Martin KaFai Lau CC: Jakub Kicinski , 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: <20180626164820.GA12981@w1t1fb> References: <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> <20180622225408.jor7lpvsksnwiiec@kafai-mbp.dhcp.thefacebook.com> <20180622163200.20564ec4@cakuba.netronome.com> <20180623002639.h4qxy7aakypi6t7b@kafai-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180623002639.h4qxy7aakypi6t7b@kafai-mbp.dhcp.thefacebook.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Originating-IP: [2620:10d:c092:200::1:a234] X-ClientProxiedBy: AM5PR0202CA0001.eurprd02.prod.outlook.com (2603:10a6:203:69::11) To DM6PR15MB2507.namprd15.prod.outlook.com (2603:10b6:5:8e::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd7007c3-da73-41ca-1502-08d5db84aa9e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(8989117)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DM6PR15MB2507; X-Microsoft-Exchange-Diagnostics: 1;DM6PR15MB2507;3:A5ZUK4fcr8q68BXkGq8GPfT/GPcqdnnMD7hjvdR+GpbHpqyWNOUUeqt5DLc9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BxA0ISTLiA8bFj8ueUWUQMbx5fPgYc3TTLwAI1MX/ERPd37AcK/w1A9y5tYG8NLEdg3EJ1Usy1CURJ7bXkcfTu/0lF8jvtkQvFjmifMKntISAh3uEKrncvzY4S5bokd5tyhlz9BbbJLZwdCfb/6NC573m/C8UZ5sOFWIQ5IK45CxS67PF60c0GOJMoErwA8/CkyivWmAEgbnQl0FrcHauoiwRjzzPCcGX7Rn8FbYo2w4wGCzX8Brm0M4fksAnShZYCc6Et91pLrE8ziup3cBJ;4:JdXBoLpxrajstPhlsWhB55jaY7jhmTjRUldGt4VnGPI1l2fcVul6Y75LmWWklnNQgX+TxEbBulzVKv1vvBq5+opVVOviglbboXiabfBfSHj4+Jp6nFoJWFbeOpiKfVVGZQgyHhohamK5i0Uyt7QRnwWi9LdtorNw91I7EzpK4bXpcueJwX4nadaTaSA8Pv15Na4JBymO6QuD2+cFzUvmhtGrnrlXsw/CeKcFQJL6179x5rnIEw5dH95zUJQzkgLrtumsy3TC2oyatOjRm0XwMmGxY3dKA9o0m/0ZHiht61XW6jLrjvomGPi4g2iJLSwC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231254)(11241501184)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM6PR15MB2507;BCL:0;PCL:0;RULEID:;SRVR:DM6PR15MB2507; X-Forefront-PRVS: 071518EF63 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(136003)(396003)(189003)(199004)(51914003)(39060400002)(76176011)(54906003)(53936002)(93886005)(52116002)(316002)(68736007)(9686003)(46003)(16586007)(58126008)(33716001)(25786009)(6246003)(81156014)(4326008)(81166006)(86362001)(6636002)(5660300001)(6666003)(55016002)(33656002)(478600001)(50466002)(47776003)(8936002)(105586002)(33896004)(6862004)(106356001)(8676002)(2906002)(16526019)(446003)(6496006)(52396003)(11346002)(476003)(486006)(305945005)(23726003)(1076002)(386003)(97736004)(6116002)(229853002)(14444005)(7736002)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR15MB2507;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;DM6PR15MB2507;23:15aE4b2JV+fbfi4GFIsDD+grAn98GeIZVrHNfrMeV?= =?us-ascii?Q?U0emHbbw0iln45km/WG85N78QfbiOe+VHO4AtxUAId0rvplhD4bTeuBxLOhn?= =?us-ascii?Q?TtjVW7UQ0ZkxToKb/N9jJOHS3H1D3Nm67q01x4SeSlPDAaeSCN+Srr8iv38B?= =?us-ascii?Q?Q24IQ9/xKJQhGyEaHBgw9K8DdFSV6kU77kjXK6+ctKhNzlX0RfGOgB5wScRS?= =?us-ascii?Q?d0QscZmz/HcGa1fPIJLylPVKKfA4qubH3Q+w5IhPitD28GVEP/Aexs56FnLO?= =?us-ascii?Q?geK6qwmlPdFeyL+fRbpCZrbURMDKTguyUXC07GC/ni6orsDXYT9uu4PQLg3k?= =?us-ascii?Q?pnR4BGR2r8ZVjPB5Et7qMsXigPLWgsL2nkL9BvWnUQ0o83fzHDA2ufaH8p5t?= =?us-ascii?Q?PYy1Dvug9XrCyV03ZuhrK9G/6XOQW+IZL4MqvitPWWzr+iZWWaV+h2+ax3uS?= =?us-ascii?Q?PHSXdMR9wIcebbSErIyNRQNffCZBXiAKHIk5XSsiQEf6CvnZpZUA01fFI1xz?= =?us-ascii?Q?lrpJBlh1kIlmwZAVh7xGhLJjGN3b3fc7/PKapEXYVX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OuctnVl3hXlof1Za+bXBMzPmsX20+dYm79sDqieeeNr8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM6PR15MB2507;7:HzTIBxjJ++adpUXXWbcWpuaWKuaPY9fv+LLOLwoGt8WVA7t2oPKtQElE6bqtrR4IkFw8Eje1R7uAXmjt7SpyyOR2RcfT/ikpn8q1Oa2VMcYuuUBvAOeGnVmWeWVT6b8cBS4mdS10sz5BtBaF4ixLpI/5ZOqFPPjpRsdKENugI1aoxUgU4+nxV1bi23eSIh1ukKK0VMfQ/5y9vzTPd0qLPQiiqOtdLG87xjwN4ua8vVug/9j8fVbVTmDU2uQ1FNwf;20:3ExUIND10A1UHjtR31OgwqDLiwJ7MJmGqnR8aZBgLhNvhJY6okbnna2Z0kCRn704hCy6AUhvrkrIzLssVw3azXmX8yqLirJrAElHFT9zhs8irLHoZmq8jxnc/qL5QA6B+uwinY5usHqh+HAmXcdFMCL0AboLdxNDXYqGVjMXVoI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2018 16:48:37.1976 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd7007c3-da73-41ca-1502-08d5db84aa9e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR15MB2507 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-26_08:,, 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 05:26:39PM -0700, Martin KaFai Lau wrote: > On Fri, Jun 22, 2018 at 04:32:00PM -0700, Jakub Kicinski wrote: > > On Fri, 22 Jun 2018 15:54:08 -0700, Martin KaFai Lau wrote: > > > > > > > > > > > > "value": ["0x02","0x00","0x00","0x00","0x00","0x00","0x00","0x00" > > > > > > > > > > > > ], > > > > > > > > > > > > "value_struct":{ > > > > > > > > > > > > "src_ip":2, > > > > > > > If for the same map the user changes the "src_ip" to an array of int[4] > > > > > > > later (e.g. to support ipv6), it will become "src_ip": [1, 2, 3, 4]. > > > > > > > Is it breaking backward compat? > > > > > > > i.e. > > > > > > > struct five_tuples { > > > > > > > - int src_ip; > > > > > > > + int src_ip[4]; > > > > > > > /* ... */ > > > > > > > }; > > > > > > > > > > > > Well, it is breaking backward compat, but it's the program doing it, > > > > > > not bpftool :) BTF changes so does the output. > > > > > As we see, the key/value's btf-output is inherently not backward compat. > > > > > Hence, "-j" and "-p" will stay as is. The whole existing json will > > > > > be backward compat instead of only partly backward compat. > > > > > > > > No. There is a difference between user of a facility changing their > > > > input and kernel/libraries providing different output in response to > > > > that, and the libraries suddenly changing the output on their own. > > > > > > > > Your example is like saying if user started using IPv6 addresses > > > > instead of IPv4 the netlink attributes in dumps will be different so > > > > kernel didn't keep backwards compat. While what you're doing is more > > > > equivalent to dropping support for old ioctl interfaces because there > > > > is a better mechanism now. > > > Sorry, I don't follow this. I don't see netlink suffer json issue like > > > the one on "key" and "value". > > > > > > All I can grasp is, the json should normally be backward compat but now > > > we are saying anything added by btf-output is an exception because > > > the script parsing it will treat it differently than "key" and "value" > > > > Backward compatibility means that if I run *the same* program against > > different kernels/libraries it continues to work. If someone decides > > to upgrade their program to work with IPv6 (which was your example) > > obviously there is no way system as a whole will look 1:1 the same. > > > > > > BTF in JSON is very useful, and will help people who writes simple > > > > orchestration/scripts based on bpftool *a* *lot*. I really appreciate > > > Can you share what the script will do? I want to understand why > > > it cannot directly use the BTF format and the map data. > > > > Think about a python script which wants to read a counter in a map. > > Right now it would have to get the BTF, find out which bytes are the > > counter, then convert the bytes into a larger int. With JSON BTF if > > just does entry["formatted"]["value"]["counter"]. > > > > Real life example from my test code (conversion of 3 element counter > > array): > > > > def str2int(strtab): > > inttab = [] > > for i in strtab: > > inttab.append(int(i, 16)) > > ba = bytearray(inttab) > > if len(strtab) == 4: > > fmt = "I" > > elif len(strtab) == 8: > > fmt = "Q" > > else: > > raise Exception("String array of len %d can't be unpacked to an int" % > > (len(strtab))) > > return struct.unpack(fmt, ba)[0] > > > > def convert(elems, idx): > > val = [] > > for i in range(3): > > part = elems[idx]["value"][i * length:(i + 1) * length] > > val.append(str2int(part)) > > return val > > > > With BTF it would be: > > > > elems[idx]["formatted"]["value"] > > > > Which is fairly awesome. > Thanks for the example. Agree that with BTF, things are easier in general. > > btw, what more awesome is, > #> bpftool map find id 100 key 1 > { > "counter_x": 1, > "counter_y": 10 > } > > > > > > > this addition to bpftool and will start using it myself as soon as it > > > > lands. I'm not sure why the reluctance to slightly change the output > > > > format? > > > The initial change argument is because the json has to be backward compat. > > > > > > Then we show that btf-output is inherently not backward compat, so > > > printing it in json does not make sense at all. > > > > > > However, now it is saying part of it does not have to be backward compat. > > > > Compatibility of "formatted" member is defined as -> fields broken out > > according to BTF. So it is backward compatible. The definition of > > "value" member is -> an array of unfortunately formatted array of > > ugly hex strings :( > > > > > I am fine putting it under "formatted" for "-j" or "-p" if that is the > > > case, other than the double output is still confusing. Lets wait for > > > Okash's input. > > > > > > At the same time, the same output will be used as the default plaintext > > > output when BTF is available. Then the plaintext BTF output > > > will not be limited by the json restrictions when we want > > > to improve human readability later. Apparently, the > > > improvements on plaintext will not be always applicable > > > to json output. > > hi, so i guess following is what we want: 1. a "formatted" object nested inside -p and -j switches for bpf map dump. this will be JSON and backward compatible 2. an output for humans - which is like the current output. this will not be JSON. this won't have to be backward compatible. this output will be shown when neither of -j and -p are supplied and btf info is available. i can update the patches to v2 which covers 2 above + all other comments on the patchset. later we can follow up with a patch for 1. thanks for valuable feedback :) okash