Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1887584imm; Sun, 8 Jul 2018 13:38:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe7obGo8J7m/LCI8XYOlb7CJ0GxpLjViPRjxqCrRcn0qbw6YjromoC3NqN3iJq36wL7K+w5 X-Received: by 2002:a63:4002:: with SMTP id n2-v6mr11587853pga.285.1531082337435; Sun, 08 Jul 2018 13:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531082337; cv=none; d=google.com; s=arc-20160816; b=cGEA5J3rZPX8EXc31QMRJVrW06o7HSeY9tf6kGDkee/A+MJM8GzmICcWQYvoQ1WX9+ daVgSuayCS7npmF12N5Vnug4/ZEnphX+TtGVAIvT/AMzEpTNip6ZT4ZGT/KPUOwYauNn CPAbKmhl2ilbavViqq7y1hp+gCZaxLFWqbIT85K5Y32XrdPHnAocFe6CVHgpQscYb4JE G5B+VeGbTMLohzU13uPjUmuB7ZqBCAUVZf+zneaD/j1p6LsEwmS+fOqlLJjSZO8zMX9o pB1RI1mI9gE6A5QABe5PHYXdX1l5P8ccJFg8lKk5qd4zOsEyEV4cSC6ridXjc5RSrTfz El9A== 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=P3Mzxzjpwp9ViK2zKLb5ExG74ULYHV1LgHxJ+0D9DD4=; b=00KkHm1D2PJPvduebgpYJmwau7gCH0JvnkGZAFw4meuTg3RpBXGgXeLBZu8An7iN99 1XSog10mndWIuvoToec/1dV8RlQtdH3G+AGuiw6Dpi+642rx5zR0HCkE7wl4W0R8+u6y PVeesNQsC3OVSRctT4stM8XmMJSKa8lauruBPkDJiQjlxDPmc9vEheA9Fv0SJwjNiS8/ CRKoCfgqSLfumrt72wQG4SJ12N7yARFOWHUztS5co9lVgnjiBXSanKwplXq9T21PpJ7g 8mOTp2a3PRPdcFuy3BLD5y+kSpepjnOHJ9O0xDlS3Wmwva+2mzbubODB+1bj3I9CVKP2 dCIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=UdlkG6e2; 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 c4-v6si14062580pfk.361.2018.07.08.13.38.42; Sun, 08 Jul 2018 13:38:57 -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=UdlkG6e2; 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 S932518AbeGHUgO (ORCPT + 99 others); Sun, 8 Jul 2018 16:36:14 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:51458 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754289AbeGHUgC (ORCPT ); Sun, 8 Jul 2018 16:36:02 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w68KXLmN016499 for ; Sun, 8 Jul 2018 13:36:01 -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=P3Mzxzjpwp9ViK2zKLb5ExG74ULYHV1LgHxJ+0D9DD4=; b=UdlkG6e2IBzPmcE0EHc9pGDMvutbv65k4Z4WAfR09jyFkchUs4cOUz/CAHCTTqa6EiOf Cza7n1+HuqozV8bO3AZPdILxtoOXpnQ39TdTl5Ge00aml82j4ci3N/q+sNPKyKgeB++B 2haBnLjdIaBjJIN4CTCcagrrQAYWVL8AseI= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2k2u1p25fw-4 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 08 Jul 2018 13:36:01 -0700 Received: from mx-out.facebook.com (192.168.52.123) by mail.thefacebook.com (192.168.16.13) with Microsoft SMTP Server (TLS) id 14.3.361.1; Sun, 8 Jul 2018 13:36:00 -0700 Received: by dev026.lla1.facebook.com (Postfix, from userid 152872) id 4D24C8A2461; Sun, 8 Jul 2018 13:33:36 -0700 (PDT) Message-ID: <20180708203002.543403467@fb.com> User-Agent: quilt/0.63-1 Date: Sun, 8 Jul 2018 13:30:02 -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 v3 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-08_12:,, 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 v3 contains incorporates feedback from v2, including a fix for big endian when extracting bitfields. Below is a summary of all changes. patch 1: - use kernel integer types instead of stdint patch 2: - change stdint types to kernel equivalents - remove variable ret from btf_dumper_modifier() - remove unnecessary parentheses in btf_dumper_enum() - remove unnecessary parentheses in btf_dumper_array() - change integer types from explicitly sized to int in btf_dumper_int_bits - fix btf_dumper_int_bits() so it works for little and big endian - remove double space in btf_dumper_int() - print non-printable characters as string - remove ret variable from btf_dumper_int() - don't initialise variable with function which needs error check in btf_dumper_struct() - use a temp variable to avoid multi-line statement in btf_dumper_struct() - call jsonw_end_object before returning in error case in btf_dumper_struct() - print something in case of BTF_KIND_FWD in btf_dumper_do_type() - return directly from cases in switch-case and save 9 LOC in btf_dumper_do_type() - remove check for null argument in btf_dumper_type() - remove header file btf_dumper.h and move declarations to main.h patch 3: - change stdint types to kernel equivalents - keep header includes in alphabetical order - use goto in do_dump_btf() to ensure jsonw_end_object() in cases of error - don't initialise variable with functions that can fail in get_btf() - remove json-breaking printf in get_btf() - refactor so that there isn't too much code in if (!err) case in do_lookup() Thanks, Okash