Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp330757imm; Mon, 2 Jul 2018 12:17:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcOL8JFerXS8e4+r8UTlWhODql9jSPfeQ6HBLo80sCIFVyQEOe+Ydx9y2reYqL+0aVAzLTR X-Received: by 2002:a63:6949:: with SMTP id e70-v6mr17752098pgc.119.1530559064809; Mon, 02 Jul 2018 12:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530559064; cv=none; d=google.com; s=arc-20160816; b=zt8n2jsYMdBMuTvrjMV30KfPMDv+/lLdpIrYwJ4ZOeToEs5yPz/P24PW4n2vZ3oAp8 arixNZcJ8h69g3aReviFxMTODLiprPI34x1J2hknt8W22VSFRpfmYHHAkQ+V8FgWGZeR iY6OtZEe3cp3BOAOO4NY6e2aEWmJ7ZgpKFzrIW0bUS7CuDMW0bhIXZQtj67y9rU3T75J t/NyuE5Rq89FFN7Wspx6pbQbrJoMKQFgAHkkCRtd9Dz63CFOnqbmjVbdZxPxA3qnHqr7 YTS7WD+fawXq+CJHU8s/tEePULmxvYj2InLYpp7/i31Ph8fUlsMwCIATiK6gSJSPOIsu rlsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:subject:smtp-origin-cluster :cc:to:smtp-origin-hostname:from:smtp-origin-hostprefix:date :user-agent:message-id:dkim-signature:arc-authentication-results; bh=/FDWNq5W1LM6JOQKxAVnlmXl8mUoDZtczhm1mLEx2Hk=; b=WYoDGNhHiwLlFJ3aDBmmno4SJmGXvTMPNSi0LIA50cAfZQXe7OGrTQC9wofNxLhihJ 71EhiQFNRwhW5VnQEU53iao/+QjNE6arZEoq1WlEW5p8Rx36aaFlJFY1xjervPXUG0CI +n0qgDHE9IhneLFcBwz1AwCicnI3cGz0HwXnxeAoULys8n68ZeOKw7L5caVYM0TvoDed CGvBfkbdBcJ7UJt8t1XektVzfAZkI6hBsLwc/e0SaPqIM35xeECOH0igVSPl7A+EQyWu sj8ZGiN9Otvgu4AqGz6kXnjYorN/wx8cG/BmZuHGcfUEfhpglmUIclqilpIep70jo3Iu G3gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=hvYKr6mu; 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 v4-v6si13660349pgc.450.2018.07.02.12.17.30; Mon, 02 Jul 2018 12:17:44 -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=hvYKr6mu; 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 S1753424AbeGBTQZ (ORCPT + 99 others); Mon, 2 Jul 2018 15:16:25 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34348 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbeGBTQX (ORCPT ); Mon, 2 Jul 2018 15:16:23 -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 w62JEveX011901 for ; Mon, 2 Jul 2018 12:16:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=message-id : date : from : to : cc : subject : mime-version : content-type; s=facebook; bh=/FDWNq5W1LM6JOQKxAVnlmXl8mUoDZtczhm1mLEx2Hk=; b=hvYKr6muQVYMMpp10t+mMEfKk89t470CxZAKBuiQQnhtLjr1Qcy4OhLl1756vmZl3xAQ rYqNP3ilaZXiXRUbGnAFktwlp5KdvwPaSqzrBfw9PxsbXXHdrUsUMXdDRxYPO+fEWYVv DrRoIpFsYJnHIIdVs0YMrez0cKPfdGvshK0= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2jyq8nrg9e-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 02 Jul 2018 12:16:23 -0700 Received: from mx-out.facebook.com (192.168.52.123) by mail.thefacebook.com (192.168.16.14) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 2 Jul 2018 12:16:22 -0700 Received: by dev026.lla1.facebook.com (Postfix, from userid 152872) id 725948A245B; Mon, 2 Jul 2018 12:13:24 -0700 (PDT) Message-ID: <20180702183913.669030439@fb.com> User-Agent: quilt/0.63-1 Date: Mon, 2 Jul 2018 11:39:13 -0700 Smtp-Origin-Hostprefix: dev From: Okash Khawaja Smtp-Origin-Hostname: dev026.lla1.facebook.com To: Daniel Borkmann , Martin KaFai Lau , Alexei Starovoitov , Yonghong Song , Quentin Monnet , Jakub Kicinski , "David S. Miller" CC: , , Smtp-Origin-Cluster: lla1c22 Subject: [PATCH bpf-next v2 0/3] bpf: btf: print bpftool map data with btf X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-02_06:,, 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 Hi, This is v2. There are two key changes which mostly affect patches 2 and 3. First, we have two BTF outputs: 1. when -j or -p switches are supplied to a map command - this is json- and backward- compatible 2. when neither of -j and -p is supplied - this makes no promises on json- or backward- compatibility, and aimed for humans Second, in addition to map dump command, map lookup command has also been updated to print data with btf. The rules around -j and -p are same as above. Here is a summary of changes in v2: patch 1: - line continuation alignment fixes + other style fixes patch 2: - introduce struct btf_dumper which contains context for btf_dumper operation - line continuation alignment fixes + other style fixes - fix SPDX licence comment style to be C++ style - reverse christmas tree style comments - in btf_dumper_array() ensure we end json_writer array in case of error patch 3: - btf output for humans is shown when neither -j nor -p is supplied - when -j or -p are supplied, augment output with "formatted" object which shows btf data in json - added btf output to map lookup command also - declarations to follow reverse christmas tree style - error message grammar fix and remove full stop - line continuation alignment fixes + other style fixes - reorganise do_dump_btf() to remove goto and make it clearer - remove misleading comment about end of root json object - add comment to explain allocation btf buffer - brackets around else clause to harmonise with braces on if clause Thanks, Okash