Received: by 10.192.165.148 with SMTP id m20csp1705737imm; Thu, 26 Apr 2018 00:40:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx48BOG4pK/9MGmq+O297ita/hiaKAe1oW021Bc3cmnjLeUZ5bWrfbyTj8vvTSKH8SO/rnGvM X-Received: by 10.99.158.2 with SMTP id s2mr26851319pgd.48.1524728448499; Thu, 26 Apr 2018 00:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524728448; cv=none; d=google.com; s=arc-20160816; b=YdwASTRwqD+DEEMdBGzSSrQnq0q9KsNj0M452zEW77xOi8B/941HVvGRh+F7HUkqUc MlILZK916wE/pBa0MVmT4RXD8KoGoqux3G7sh7yos89JjfM3BP1PhN5qbIy8CEtMXhqY 16Eyu7CGTMa0skQB8uB+2sqji0tEubZz1WaVeovZBKpSNLS8B7OZEbCzix37hW3uGZE/ coB30uM24DXyiwfY4a5mmMEp9Vujdi1uKm3ZwzlOIl1Jrk7IN+cCY2tfVybnmno3sycZ jFgaNZ3Y4zFZ8KM1/koC+Scyh87WNbIU+hqN+ZP4Z0yOowrP7v6p9KqD3bcELUwWUJfN XeCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=y7+Mtv+MweGdl/dOz5JUFARJzKMrxkEhNZ9O3R9XMkM=; b=RIAe86tn1A68Qv5MqWbkDXc97e1OJBZESpstAjQeLjZT7P9IoleEZ4FrLAP33tvkNS s+EhbXlc1UPkSf1anwT1wmBBwvvAcJopllbFOsLAr0oVmBE0FeIIY26O2Hi70B4c5b/N tPnqXOQtWbYIX8gaPPB28zV9n4jfcLmrDyqrpbSGqW5u9pf0ZPU4NvWEB/b/MyHHkwbU T2w1ALOUQUugONy48Bc5KC7yZqmx7DpICAIyxhrvi4Jkb6CM5GgIh+SCJqYLpcmm6Jcp +zCqGNvuWobYmuLyrWDweT0gfpSoyP52v/ELehd0Y+n2rT0em9rcvcOZIV6p1cuahkuc mAow== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si5090308pgq.21.2018.04.26.00.40.33; Thu, 26 Apr 2018 00:40:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754081AbeDZHjL (ORCPT + 99 others); Thu, 26 Apr 2018 03:39:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753882AbeDZHjI (ORCPT ); Thu, 26 Apr 2018 03:39:08 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E025E406C740; Thu, 26 Apr 2018 07:39:07 +0000 (UTC) Received: from krava (unknown [10.43.17.29]) by smtp.corp.redhat.com (Postfix) with SMTP id 9B7058442D; Thu, 26 Apr 2018 07:39:06 +0000 (UTC) Date: Thu, 26 Apr 2018 09:39:05 +0200 From: Jiri Olsa To: Daniel Borkmann Cc: Jakub Kicinski , Jiri Olsa , Alexei Starovoitov , lkml , netdev@vger.kernel.org, Quentin Monnet Subject: Re: [PATCH 3/3] tools bpftool: Display license GPL compatible in prog show/list Message-ID: <20180426073905.GI3396@krava> References: <20180425174108.6586-1-jolsa@kernel.org> <20180425174108.6586-4-jolsa@kernel.org> <20180425140346.3e0f3ba7@cakuba.netronome.com> <0e84fe67-59c9-a419-5ff7-05be2aa1991e@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e84fe67-59c9-a419-5ff7-05be2aa1991e@iogearbox.net> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 26 Apr 2018 07:39:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 26 Apr 2018 07:39:07 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 25, 2018 at 11:14:30PM +0200, Daniel Borkmann wrote: > On 04/25/2018 11:03 PM, Jakub Kicinski wrote: > > On Wed, 25 Apr 2018 19:41:08 +0200, Jiri Olsa wrote: > >> @@ -295,6 +297,7 @@ static void print_prog_plain(struct bpf_prog_info *info, int fd) > >> printf("tag "); > >> fprint_hex(stdout, info->tag, BPF_TAG_SIZE, ""); > >> print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino); > >> + printf(" license GPL %scompatible", info->gpl_compatible ? "" : "NON "); > > > > 3 nit picks: > > > > Other "fields" are separated by two spaces between each other: > > > > 4: kprobe name func_begin tag 57cd311f2e27366b license GPL compatible > > ^^ ^^ X > > loaded_at Apr 25/11:20 uid 0 > > ^^ > > xlated 16B not jited memlock 4096B > > ^^ ^^ > > > > Could you also update the example outputs in the man page: > > > > tools/bpf/bpftool/Documentation/bpftool-prog.rst > > > > Sorry about the bike shedding but I would also vote for: > > > > "[not] GPL compatible" > > > > rather than > > > > "license GPL [NON] compatible" > > > > for brevity.. > > While we're at it, can we also squeeze this whole thing a bit? Feels like > huge string wasted for very little information compared to the rest of the > dump. Just append the string "gpl" at the end of the line if info->gpl_compatible > is set, otherwise just add nothing. This also allows to naturally grep > for it e.g. `bpftool p | grep gpl` if you need a quick summary. that's fine with me.. so 'gpl' in here: 5: tracepoint name func tag 57cd311f2e27366b gpl loaded_at Apr 26/09:37 uid 0 xlated 16B not jited memlock 4096B and keeping tyhe whole name in json output: [{ "id": 5, "type": "tracepoint", "name": "func", "tag": "57cd311f2e27366b", "gpl_compatible": true, "loaded_at": "Apr 26/09:37", "uid": 0, "bytes_xlated": 16, "jited": false, "bytes_memlock": 4096 } ] how about that? thanks, jirka