Skip to content

Commit

Permalink
make --quiet option to suppress various info messages
Browse files Browse the repository at this point in the history
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 <kerolasa@iki.fi>
  • Loading branch information
kerolasa authored and Alexandra Yates committed Nov 25, 2014
1 parent d9f0a7f commit d4fb82e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/cpu/rapl/rapl_interface.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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_domains);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -500,7 +500,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();
Expand Down

0 comments on commit d4fb82e

Please sign in to comment.