Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750967AbeAOTcG (ORCPT + 1 other); Mon, 15 Jan 2018 14:32:06 -0500 Received: from mail-wr0-f174.google.com ([209.85.128.174]:37221 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbeAOTcE (ORCPT ); Mon, 15 Jan 2018 14:32:04 -0500 X-Google-Smtp-Source: ACJfBouOAA7aO/+0PESWGc+cj53gEYtzVOGuGF3MVfL/AU4e4V0DXqjO4ybXI7fyQuzwuQLwVf/WJQ== Subject: Re: [PATCH bpf-next] bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs To: Roman Gushchin , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, Jakub Kicinski , Daniel Borkmann , Alexei Starovoitov References: <20180115191615.13911-1-guro@fb.com> From: Quentin Monnet Message-ID: <34c43a17-7832-413e-fea8-4ad0f80f1585@netronome.com> Date: Mon, 15 Jan 2018 19:32:01 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180115191615.13911-1-guro@fb.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 2018-01-15 19:16 UTC+0000 ~ Roman Gushchin > 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) Looks good, thanks Roman! Would you mind updating the map names as well? It seems the BPF_MAP_TYPE_CPUMAP is missing from the list in map.c. Quentin