From patchwork Thu Oct 19 22:46:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 828398 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="XpTdHsjU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yJ3wH6n9dz9t5C for ; Fri, 20 Oct 2017 09:47:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753507AbdJSWrU (ORCPT ); Thu, 19 Oct 2017 18:47:20 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:48392 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbdJSWrP (ORCPT ); Thu, 19 Oct 2017 18:47:15 -0400 Received: by mail-pf0-f196.google.com with SMTP id b79so8112029pfk.5 for ; Thu, 19 Oct 2017 15:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iHAqawkPpIK7usEkFOzQbPjGxlfMuS9wy85Y0mVzMHM=; b=XpTdHsjUQRe4L7l7tMWvNSedSIbR64mPiikdkystxUT4GhZPMP65ZzNwKkEhoo9DCC gWC6ycfuA0NDQEEKDXIW9NhSRebKsgDchN0F6w+Ns5Wximp0sCY8BGpeCXCqgrs7sPrS d/znKD9JC5lbDd3clgth0QBFdCnT8jJlbsLi/7L7urkV+u2TGAWys9jR5YsKW0gZ+wfU yDVp1Wu1/mViF8aFQRLy+NQjZV2zIzPvJd6FvBUVznx1bZZ4EMlfA5zlE2615TCRZqxD ojVOH7S1qum21XyXtGLqjjPKHe5+KBq4S0DP1avPeHzfO2KUyaUh73rtUtfJzXIHRA34 Xa7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iHAqawkPpIK7usEkFOzQbPjGxlfMuS9wy85Y0mVzMHM=; b=DDSZfeTThOxcj4DGOKcQCEYuvI0jDlWiITVXx2UO1AVUBB2EEcAVKko4xvRiLz8vT2 Z9K7gdkLMNN0ryb3VZb9LDBnoj91bhVsLm41kg+8QdSywxZAUbk097Yhaz5hfzG4Gfs9 rOjzDS4sjAHT6+/FFk003BfyGx9XjJPB9pbVzdUgrpF8RgSpWSIhjEOUBDs7r+KUMaZ3 7mlqx7c6DP5oPJISymGs2MajyM2g4iQS/nybqvxdMpJyQCImZuPczVTVZ8vBV+/QtHwQ zgKLq2Qzj+CUf/DAca3f2p0EINY5Icsjuqp4idRgDbp0MAAscG4iXSE9QwRFMvKubRd+ 7mdA== X-Gm-Message-State: AMCzsaVcpbhkOLoFKJUJM7mewWzHvxjyIadTunWVJ6ITX13Nblrs8/rS bi3izkx5k0u3yM7GLS3RBUTZSOuV X-Google-Smtp-Source: ABhQp+QgeKpalh536bk0NvMF51VYflChUCHTBPtK3TErWB0Ox0Y+hKAEraClalu+S5szYQqdJBrwZQ== X-Received: by 10.84.164.104 with SMTP id m37mr2614750plg.242.1508453234592; Thu, 19 Oct 2017 15:47:14 -0700 (PDT) Received: from jkicinski-Precision-T1700.netronome.com ([75.53.12.129]) by smtp.gmail.com with ESMTPSA id c185sm16969156pfb.112.2017.10.19.15.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Oct 2017 15:47:14 -0700 (PDT) From: Jakub Kicinski To: netdev@vger.kernel.org Cc: oss-drivers@netronome.com, Quentin Monnet , Jakub Kicinski Subject: [PATCH net-next 7/8] tools: bpftool: show that `opcodes` or `file FILE` should be exclusive Date: Thu, 19 Oct 2017 15:46:25 -0700 Message-Id: <20171019224626.31608-8-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171019224626.31608-1-jakub.kicinski@netronome.com> References: <20171019224626.31608-1-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Quentin Monnet For the `bpftool prog dump { jited | xlated } ...` command, adding `opcodes` keyword (to request opcodes to be printed) will have no effect if `file FILE` (to write binary output to FILE) is provided. The manual page and the help message to be displayed in the terminal should reflect that, and indicate that these options should be mutually exclusive. Signed-off-by: Quentin Monnet Signed-off-by: Jakub Kicinski Acked-by: Daniel Borkmann --- tools/bpf/bpftool/Documentation/bpftool-prog.rst | 8 ++++---- tools/bpf/bpftool/prog.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst index 3968f0bd37db..69b3770370c8 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst @@ -11,8 +11,8 @@ SYNOPSIS ======== | **bpftool** prog show [*PROG*] -| **bpftool** prog dump xlated *PROG* [file *FILE*] [opcodes] -| **bpftool** prog dump jited *PROG* [file *FILE*] [opcodes] +| **bpftool** prog dump xlated *PROG* [{file *FILE* | opcodes }] +| **bpftool** prog dump jited *PROG* [{file *FILE* | opcodes }] | **bpftool** prog pin *PROG* *FILE* | **bpftool** prog help | @@ -28,14 +28,14 @@ DESCRIPTION Output will start with program ID followed by program type and zero or more named attributes (depending on kernel version). - **bpftool prog dump xlated** *PROG* [**file** *FILE*] [**opcodes**] + **bpftool prog dump xlated** *PROG* [{ **file** *FILE* | **opcodes** }] Dump eBPF instructions of the program from the kernel. If *FILE* is specified image will be written to a file, otherwise it will be disassembled and printed to stdout. **opcodes** controls if raw opcodes will be printed. - **bpftool prog dump jited** *PROG* [**file** *FILE*] [**opcodes**] + **bpftool prog dump jited** *PROG* [{ **file** *FILE* | **opcodes** }] Dump jited image (host machine code) of the program. If *FILE* is specified image will be written to a file, otherwise it will be disassembled and printed to stdout. diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 57edbea2fbe8..7838206a455b 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -469,8 +469,8 @@ static int do_help(int argc, char **argv) { fprintf(stderr, "Usage: %s %s show [PROG]\n" - " %s %s dump xlated PROG [file FILE] [opcodes]\n" - " %s %s dump jited PROG [file FILE] [opcodes]\n" + " %s %s dump xlated PROG [{ file FILE | opcodes }]\n" + " %s %s dump jited PROG [{ file FILE | opcodes }]\n" " %s %s pin PROG FILE\n" " %s %s help\n" "\n"