aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2012-05-29 00:22:57 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-29 10:53:42 -0400
commit3780f4883b2f3319afe88bf3ddc73ef426851d49 (patch)
tree240a22d02b4ba502e5e68c1a6526db6338acc782 /tools/perf/builtin-record.c
parent21f0d423b989284f82004d0f80c75581fec91fb2 (diff)
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 <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1338265382-6872-3-git-send-email-namhyung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index e5cb08427e1..f95840d04e4 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -264,7 +264,7 @@ try_again:
264 } 264 }
265 265
266 if (err == ENOENT) { 266 if (err == ENOENT) {
267 ui__warning("The %s event is not supported.\n", 267 ui__error("The %s event is not supported.\n",
268 event_name(pos)); 268 event_name(pos));
269 exit(EXIT_FAILURE); 269 exit(EXIT_FAILURE);
270 } 270 }
@@ -858,8 +858,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
858 usage_with_options(record_usage, record_options); 858 usage_with_options(record_usage, record_options);
859 859
860 if (rec->force && rec->append_file) { 860 if (rec->force && rec->append_file) {
861 fprintf(stderr, "Can't overwrite and append at the same time." 861 ui__error("Can't overwrite and append at the same time."
862 " You need to choose between -f and -A"); 862 " You need to choose between -f and -A");
863 usage_with_options(record_usage, record_options); 863 usage_with_options(record_usage, record_options);
864 } else if (rec->append_file) { 864 } else if (rec->append_file) {
865 rec->write_mode = WRITE_APPEND; 865 rec->write_mode = WRITE_APPEND;
@@ -868,8 +868,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
868 } 868 }
869 869
870 if (nr_cgroups && !rec->opts.target.system_wide) { 870 if (nr_cgroups && !rec->opts.target.system_wide) {
871 fprintf(stderr, "cgroup monitoring only available in" 871 ui__error("cgroup monitoring only available in"
872 " system-wide mode\n"); 872 " system-wide mode\n");
873 usage_with_options(record_usage, record_options); 873 usage_with_options(record_usage, record_options);
874 } 874 }
875 875
@@ -905,7 +905,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
905 int saved_errno = errno; 905 int saved_errno = errno;
906 906
907 perf_target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); 907 perf_target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
908 ui__warning("%s", errbuf); 908 ui__error("%s", errbuf);
909 909
910 err = -saved_errno; 910 err = -saved_errno;
911 goto out_free_fd; 911 goto out_free_fd;
@@ -933,7 +933,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
933 else if (rec->opts.freq) { 933 else if (rec->opts.freq) {
934 rec->opts.default_interval = rec->opts.freq; 934 rec->opts.default_interval = rec->opts.freq;
935 } else { 935 } else {
936 fprintf(stderr, "frequency and count are zero, aborting\n"); 936 ui__error("frequency and count are zero, aborting\n");
937 err = -EINVAL; 937 err = -EINVAL;
938 goto out_free_fd; 938 goto out_free_fd;
939 } 939 }