Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751089AbeAOTRO (ORCPT + 1 other); Mon, 15 Jan 2018 14:17:14 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:58472 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbeAOTRL (ORCPT ); Mon, 15 Jan 2018 14:17:11 -0500 From: Roman Gushchin To: CC: , , Roman Gushchin , Jakub Kicinski , Quentin Monnet , Daniel Borkmann , Alexei Starovoitov Subject: [PATCH bpf-next] bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs Date: Mon, 15 Jan 2018 19:16:15 +0000 Message-ID: <20180115191615.13911-1-guro@fb.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c092:200::1:4892] X-ClientProxiedBy: AM4P190CA0021.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::31) To DM3PR15MB1082.namprd15.prod.outlook.com (2603:10b6:0:12::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8978d9cb-560e-4878-9404-08d55c4c85bb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:DM3PR15MB1082; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1082;3:MbhU5okWj60kLUaNf7RaDrwncre5ktaVXIgq0iqu2CxnOUwX5dflpDsSY0QQ1EAXMWyHOQJmiZPlj/HjxpCn0M0Z5yRHJJPt9cuu/z2H1hE0PfA24v4HoUwMosT70pHje3DKEGKOBtmrKrUx3j2Y48OCVdB9Bh2J5M7mVdZ2p7InDLZ4pwu48ho1+VFL9pO3UIebCuKShLP/0NBKDyTa4hsirzQoV8r2ZVhEe0jEe4SIei+9peLSC5t1vJdtzZEi;25:7KEftmK4WXq5prmBIKh/bz+dQxHi4DZroUqNoU3jbPx/S9p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RvJXZIpOFIA28Ok3rqwtgEkFrm38Q/zxYDG4+Ccze5LjeYbHzq;4:B5x+jVgVV8D/yOUaycbp3Zi+Ukg0yyoVQEC05OCNOccGG8umMBnK4saW0LV1zp5Pm5gFLkCDj7SsJBrXUAA4Moyi4vuXJnJtsdc+ay1ptBDA9Bnce0XFvmIlYyMNX1y2AuZb6+o4uWhHO20y1mtiTinZP6JRZGPjjL7G2UZW08RLYtWJcTATt7ii4nwQKNkOB3Av6P28vKCDIVs1lqpqSq6BDhtVl4LzssGfAIEvKXuu/UDGo7o4QI5hGX1N4ldyMXWeNasBDOShHGjvitxzs6mhcYOaeX+rECB41pEaXMAWQA79wB60zslj4ZzrAZbS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(10201501046)(3231023)(11241501184)(944501161)(3002001)(93006095)(93001095)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM3PR15MB1082;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM3PR15MB1082; X-Forefront-PRVS: 0553CBB77A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(346002)(366004)(39860400002)(396003)(39380400002)(189003)(199004)(386003)(51416003)(52116002)(52396003)(97736004)(36756003)(5660300001)(6916009)(6666003)(53936002)(6116002)(1076002)(48376002)(316002)(6512007)(50466002)(6506007)(16586007)(6486002)(2361001)(478600001)(50226002)(69596002)(86362001)(54906003)(305945005)(47776003)(105586002)(53416004)(2351001)(106356001)(2906002)(7736002)(39060400002)(25786009)(81166006)(4326008)(68736007)(8676002)(8936002)(81156014)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1082;H:castle.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A: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puEhGAffmDdhy9+axZ9e91pNQg6KhyL1Zo=;7:l1j36534VrcHKMShiLVffijpmTSOyt4NI2XvNmb4Ctnu0/vZvTg21ojfL5ohdGaeiQ89wS5OZKovXOB+6k7pyVUEwOL7gBAb2RXAaM2onHdNjW6t3JqJBJsmFVzGU6qLL6OWhTUWHSoLlZycmJh46d3rWs2KUNp2JxMAp02F87RgrCgLN7kxLs8j6ouPoCQhdqAJkSjvCFXlfpnb2L4MTgPBS0OAaOg3fl4CZBRksU70X4wxFiEC9GteeRleslYC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1082;20:EeJRYfOKAf5v7ZQ+JUYEnBxuxFUd4Nwadwk01/04CjtS41Yx1pZ4zlKmtOlQSW1a0E1DacS4MxoGGIb6pNSJ61/M9Wihsh2Mn48XVD/LOV/5aD762iElzR1ZqSBD9fdH22Xc3JuJNwWxEPftPlFc+eCGwvVh6Npaw54XwMTh1cM= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2018 19:16:46.0131 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8978d9cb-560e-4878-9404-08d55c4c85bb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1082 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-15_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Bpftool doesn't recognize BPF_PROG_TYPE_CGROUP_DEVICE programs, so the prog show command prints the numeric type value: $ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096B This patch defines the corresponding textual representation: $ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096B Signed-off-by: Roman Gushchin Cc: Jakub Kicinski Cc: Quentin Monnet Cc: Daniel Borkmann Cc: Alexei Starovoitov --- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index c6a28be4665c..099e21cf1b5c 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -66,6 +66,7 @@ static const char * const prog_type_name[] = { [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", [BPF_PROG_TYPE_SK_SKB] = "sk_skb", + [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device", }; static void print_boot_time(__u64 nsecs, char *buf, unsigned int size) -- 2.14.3