Content-Type: multipart/mixed; boundary="===============4184666074950886046==" MIME-Version: 1.0 From: Sami Kerola Subject: [Powertop] [PATCH 10/14] make --quiet option to suppress various info messages Date: Sat, 25 Oct 2014 18:33:57 +0100 Message-ID: <1414258441-30099-11-git-send-email-kerolasa@iki.fi> In-Reply-To: 1414258441-30099-1-git-send-email-kerolasa@iki.fi To: powertop@lists.01.org List-ID: --===============4184666074950886046== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable When --quiet is defined messages such as'RAPL device for cpu 0' and 'Leaving PowerTOP' are not expected to be printed. This change makes them to be printed to stderr, that the --quiet is redirecting to /dev/null. Signed-off-by: Sami Kerola --- src/cpu/rapl/rapl_interface.cpp | 5 ++--- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cpu/rapl/rapl_interface.cpp b/src/cpu/rapl/rapl_interface.= cpp index 2fc55b1..d6bd4c8 100644 --- a/src/cpu/rapl/rapl_interface.cpp +++ b/src/cpu/rapl/rapl_interface.cpp @@ -39,7 +39,7 @@ #define RAPL_DBG_PRINT(...) ((void) 0) #define RAPL_ERROR_PRINT(...) ((void) 0) #endif -#define RAPL_INFO_PRINT printf +#define RAPL_INFO_PRINT(format, m) fprintf(stderr, format, m) = #define MAX_TEMP_STR_SIZE 20 = @@ -134,8 +134,7 @@ c_rapl_interface::c_rapl_interface(const char *dev_name= , int cpu) : closedir(dir); } = - RAPL_INFO_PRINT("RAPL Using PowerCap Sysfs : Domain Mask %x\n", - rapl_domains); + RAPL_INFO_PRINT("RAPL Using PowerCap Sysfs : Domain Mask %x\n", rapl_dom= ains); return; } = diff --git a/src/main.cpp b/src/main.cpp index 9471bcc..94c2a6b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -483,7 +483,7 @@ int main(int argc, char **argv) } if (!auto_tune) endwin(); - printf("%s\n", _("Leaving PowerTOP")); + fprintf(stderr, "%s\n", _("Leaving PowerTOP")); = end_process_data(); clear_process_data(); -- = 2.1.2 --===============4184666074950886046==--