Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Greg Thelen <gthelen@google.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org, Greg Thelen <gthelen@google.com>
Subject: [PATCH 2/2] trace-cmd: respect -s/--silent
Date: Thu, 24 Oct 2019 23:39:57 -0700
Message-ID: <20191025063957.21558-2-gthelen@google.com> (raw)
In-Reply-To: <20191025063957.21558-1-gthelen@google.com>

Keep make -s,--silent from printing any progress messages.  Only show
warnings and errors.  By default (without -s), there's no change.

Signed-off-by: Greg Thelen <gthelen@google.com>
---
 Makefile         | 4 +++-
 scripts/utils.mk | 9 +++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index bbdf15ea7af6..8f9eb0203c01 100644
--- a/Makefile
+++ b/Makefile
@@ -101,6 +101,8 @@ ifndef VERBOSE
   VERBOSE = 0
 endif
 
+SILENT := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),1)
+
 SWIG_DEFINED := $(shell if command -v swig; then echo 1; else echo 0; fi)
 ifeq ($(SWIG_DEFINED), 0)
 BUILD_PYTHON := report_noswig
@@ -188,7 +190,7 @@ export LIBTRACEEVENT_DIR LIBTRACECMD_DIR
 export LIBTRACECMD_STATIC LIBTRACECMD_SHARED
 export LIBTRACEEVENT_STATIC LIBTRACEEVENT_SHARED
 
-export Q VERBOSE EXT
+export Q SILENT VERBOSE EXT
 
 # Include the utils
 include scripts/utils.mk
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 8e4e4b5f3a4a..d1d5135063fc 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -15,6 +15,13 @@ endif
 ifeq ($(VERBOSE),1)
   Q =
   S =
+else
+  Q = @
+  S = -s
+endif
+
+# Use empty print_* macros if either SILENT or VERBOSE.
+ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1)
   print_compile =
   print_app_build =
   print_fpic_compile =
@@ -24,8 +31,6 @@ ifeq ($(VERBOSE),1)
   print_install =
   print_update =
 else
-  Q = @
-  S = -s
   print_compile =		echo '  $(GUI)COMPILE            '$(GOBJ);
   print_app_build =		echo '  $(GUI)BUILD              '$(GOBJ);
   print_fpic_compile =		echo '  $(GUI)COMPILE FPIC       '$(GOBJ);
-- 
2.24.0.rc0.303.g954a862665-goog


  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  6:39 [PATCH 1/2] trace-cmd: refactor print_update Greg Thelen
2019-10-25  6:39 ` Greg Thelen [this message]
2019-10-26 15:46 ` Steven Rostedt

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191025063957.21558-2-gthelen@google.com \
    --to=gthelen@google.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git