From 3780f4883b2f3319afe88bf3ddc73ef426851d49 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Tue, 29 May 2012 13:22:57 +0900 Subject: perf tools: Convert critical messages to ui__error() There were places where use ui__warning (or even fprintf) to show critical messages. This patch converts them to ui__error so that the front-end code can implement appropriate behavior. Signed-off-by: Namhyung Kim Cc: Paul Mackerras Cc: Pekka Enberg Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1338265382-6872-3-git-send-email-namhyung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/perf/builtin-record.c') diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e5cb084..f95840d 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -264,7 +264,7 @@ try_again: } if (err == ENOENT) { - ui__warning("The %s event is not supported.\n", + ui__error("The %s event is not supported.\n", event_name(pos)); exit(EXIT_FAILURE); } @@ -858,8 +858,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) usage_with_options(record_usage, record_options); if (rec->force && rec->append_file) { - fprintf(stderr, "Can't overwrite and append at the same time." - " You need to choose between -f and -A"); + ui__error("Can't overwrite and append at the same time." + " You need to choose between -f and -A"); usage_with_options(record_usage, record_options); } else if (rec->append_file) { rec->write_mode = WRITE_APPEND; @@ -868,8 +868,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) } if (nr_cgroups && !rec->opts.target.system_wide) { - fprintf(stderr, "cgroup monitoring only available in" - " system-wide mode\n"); + ui__error("cgroup monitoring only available in" + " system-wide mode\n"); usage_with_options(record_usage, record_options); } @@ -905,7 +905,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) int saved_errno = errno; perf_target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); - ui__warning("%s", errbuf); + ui__error("%s", errbuf); err = -saved_errno; goto out_free_fd; @@ -933,7 +933,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) else if (rec->opts.freq) { rec->opts.default_interval = rec->opts.freq; } else { - fprintf(stderr, "frequency and count are zero, aborting\n"); + ui__error("frequency and count are zero, aborting\n"); err = -EINVAL; goto out_free_fd; } -- cgit v1.1