From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF9AC072B5 for ; Fri, 24 May 2019 09:46:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2058B20645 for ; Fri, 24 May 2019 09:46:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="cAo+rRhT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390048AbfEXJq6 (ORCPT ); Fri, 24 May 2019 05:46:58 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53756 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389980AbfEXJq6 (ORCPT ); Fri, 24 May 2019 05:46:58 -0400 Received: by mail-wm1-f66.google.com with SMTP id 198so8670420wme.3 for ; Fri, 24 May 2019 02:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mkCiLlrSzhAV2CD8PHBGktrJShCBHx4vJYh2M4ZW7p0=; b=cAo+rRhTZq9z2qCSV3cQYDh9UM2ZnNYvDfhK0Kemyke+xwh4upPOy7Gi2YbHvgRG2A 1E8cx1fBBr0UJLmRLJ2Xvb3pIJeNgPwBDR9oWko192PapCUgWMVeADq1JRe4QfdT25mR prJxVgI/9mEw2NVr3Hwzw/FoS1WYbB7TeyiBmZxJLqyTnFu+HX9gyvgWdxUsHL2JJm6R S6Z/VWMfUAgBKn23chrdO4JLXbJgxMY3xzDpORETxigyn4qcjoEdHKhYAHOCv7Rj44sZ 9O3eRRVqRIcAVm2NCahQTUqYck/RCh4zPMgYvEp99se7kst8CLNwnZwmLx6r3bpXvkBQ 2bfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mkCiLlrSzhAV2CD8PHBGktrJShCBHx4vJYh2M4ZW7p0=; b=iImo4WfUu5Nfp+p+P5Tjolhc515e93o+UuJTJd2Az9N29IRIQEqtJAJMXMdNrrbCaZ E27UT3aROiOsav+WykvzyvNoSdPIsRUnKxnZt0tkeCnbQh4twyoNN0pDR0l5sfD75T/3 AC979XHjjnrwEKkZQOpTUCigXu+gcy7Nup8AOW01nl4w7yNkATq+nVxtn2viNq8jyZRo ZmJXYrcpiqZtuH3yae/t1yhwMw/u0bQY59RPmTL7Zl6YBilP1fTjRh0qoOFgungbMqM8 3WSj8XDEtB3EbDeBO0a58N8yO+mNTLZpOanVfNW1v2txZE1ZLyYqFGntdFIt9hao54ZA HhHA== X-Gm-Message-State: APjAAAXqCjTOVVZnOdKYJccaC/x5tyR6Pp69rpvqS30MWYfw67pYcBqN XzKyG8Tu+cbQZHa+o4frTzFe7Q== X-Google-Smtp-Source: APXvYqyOmcBpTlo/qkNaZeMYvIEjLQYgMp7eWOOzsanh0QRKYrYyzJRsPOwbF0mcezuMOUMX0NS3HA== X-Received: by 2002:a05:600c:23d2:: with SMTP id p18mr15045739wmb.66.1558691216664; Fri, 24 May 2019 02:46:56 -0700 (PDT) Received: from [192.168.1.2] ([194.53.186.20]) by smtp.gmail.com with ESMTPSA id i17sm1916346wrr.46.2019.05.24.02.46.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 02:46:56 -0700 (PDT) Subject: Re: [PATCH bpf-next v2 1/3] tools: bpftool: add -d option to get debug output from libbpf To: Andrii Nakryiko , Jakub Kicinski Cc: Alexei Starovoitov , Daniel Borkmann , bpf@vger.kernel.org, Networking , oss-drivers@netronome.com, Yonghong Song References: <20190523105426.3938-1-quentin.monnet@netronome.com> <20190523105426.3938-2-quentin.monnet@netronome.com> <20190523134421.38a0da0c@cakuba.netronome.com> From: Quentin Monnet Message-ID: Date: Fri, 24 May 2019 10:46:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org 2019-05-23 13:57 UTC-0700 ~ Andrii Nakryiko > On Thu, May 23, 2019 at 1:44 PM Jakub Kicinski > wrote: >> >> On Thu, 23 May 2019 09:20:52 -0700, Andrii Nakryiko wrote: >>> On Thu, May 23, 2019 at 3:54 AM Quentin Monnet wrote: >>>> >>>> libbpf has three levels of priority for output messages: warn, info, >>>> debug. By default, debug output is not printed to the console. >>>> >>>> Add a new "--debug" (short name: "-d") option to bpftool to print libbpf >>>> logs for all three levels. >>>> >>>> Internally, we simply use the function provided by libbpf to replace the >>>> default printing function by one that prints logs regardless of their >>>> level. >>>> >>>> v2: >>>> - Remove the possibility to select the log-levels to use (v1 offered a >>>> combination of "warn", "info" and "debug"). >>>> - Rename option and offer a short name: -d|--debug. >>> >>> Such and option in CLI tools is usually called -v|--verbose, I'm >>> wondering if it might be a better name choice? >>> >>> Btw, some tools also use -v, -vv and -vvv to define different levels >>> of verbosity, which is something we can consider in the future, as >>> it's backwards compatible. >> >> That was my weak suggestion. Sometimes -v is used for version, e.g. >> GCC. -d is sometimes used for debug, e.g. man, iproute2 uses it as >> short for "detailed". If the consensus is that -v is better I don't >> really mind. > > It's minor, so I'm not insisting at all, just wasn't sure it was > brought up. bpftool is sufficiently different in its conventions from > other modern CLIs anyways. > > As for -v for version. It seems like the trend is to use -V|--version > for version, and -v|--verbose for verbosity. I've also seen some tools > option for `cli version` (subcommand) for version. Anyway, no strong > preferences from me either. > For the record, bpftool has both "bpftool -V" and "bpftool version" to dump the version number. This leaves us with "-v" free to do something like "--verbose", but just as Jakub said we wanted to limit the risks of confusion... I don't mind changing, but since nobody has expressed a strong opinion on the matter, I'll stick to "-d|--debug" for now. Thanks Andrii for the review! Quentin