Received: by 10.192.165.148 with SMTP id m20csp1718724imm; Thu, 26 Apr 2018 00:56:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kApowEvusDY0Uu8cvphlH0VAeKyVngm5cs1kU+1+SvPO2hwUMvAwH/zT9+Hcz/8a4Y89t X-Received: by 2002:a17:902:6e08:: with SMTP id u8-v6mr32214399plk.96.1524729366355; Thu, 26 Apr 2018 00:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524729366; cv=none; d=google.com; s=arc-20160816; b=ac3oPQFS4AeKRatF31D//sNCg4mnIGdyJxp66JKYmuFj5B2163JHYvQy1QO+ZP87wE COwKVJUGz5IudhfGHGfjF7espLpYy1E2zPY8ob0/H5A2ZoFlkPAneBWUV3yzSnPYJhC5 nuU46YtgoSVK7aj16h+1FmHhgDsXD35Pfo/pMz9jYaXcQIaedY54aejGtHel1Bz+Z4eX XaZuNAlo4WAjlZLM30mW88N5nWB8fSz8+lgnCz27H2eVwf+sDgw/evLLiz/t4S4mSzmu Ln0IeJtcd7ttrWAvHrV9vxKLHZZ6BWL5pjib9L5iHP8KdNL9+chJDnANVQi5EPuzO0Rn 5Slw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=dFWX0XWIWY75t7FnmjXzeOlOdSYdknp7w07sJDaFemY=; b=erWLcHr3Gmn0Yu20xMCogLJVZmeZvEcefeX/aXKzn53fdTEO173Gs3xgWe4Ztr0hVz BRf9186sFXdjLSeBefQbrbIxqC6K1kZM8rKulG2NA2Nn0/oFDB4aqyUMH19PIQYGw/xJ SIm3od2p/qc1rUKJR18RwaUu+8yMlsP3gxIdJ33X4zyBrSv1SzkTWHlkgty0hERaY5Qw SNwvmqa0VzXHAz1DBailjrfsK88OZqqUL/mBShrQOzYODhuygQ5PaGMTheMH4yh2gLd9 OO4rVhHy1Tf0nubgOpN3W0Cy/liwKRXjpuSZkozVLS+D7VBjVnZwo6Y0qTbYRHxOfeGo zakA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14-v6si17651440ple.450.2018.04.26.00.55.51; Thu, 26 Apr 2018 00:56:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754215AbeDZHxg (ORCPT + 99 others); Thu, 26 Apr 2018 03:53:36 -0400 Received: from www62.your-server.de ([213.133.104.62]:49278 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752962AbeDZHxc (ORCPT ); Thu, 26 Apr 2018 03:53:32 -0400 Received: from [188.63.75.139] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fBbiZ-0001vJ-Hm; Thu, 26 Apr 2018 09:53:27 +0200 Subject: Re: [PATCH 3/3] tools bpftool: Display license GPL compatible in prog show/list To: Jiri Olsa Cc: Jakub Kicinski , Jiri Olsa , Alexei Starovoitov , lkml , netdev@vger.kernel.org, Quentin Monnet 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> <20180426073905.GI3396@krava> From: Daniel Borkmann Message-ID: <639b2b78-af9e-4605-2b33-9bd1af8e760a@iogearbox.net> Date: Thu, 26 Apr 2018 09:53:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180426073905.GI3396@krava> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24514/Thu Apr 26 06:27:07 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/26/2018 09:39 AM, Jiri Olsa wrote: > 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? Sounds good, thanks Jiri!