[tip: perf/urgent] perf report/top TUI: Replace pr_err() with ui__error()

From: tip-bot2 for Ravi Bangoria
Date: Fri Dec 06 2019 - 03:03:46 EST


The following commit has been merged into the perf/urgent branch of tip:

Commit-ID: ae87405fb511d6220ce86b9a60807fef92e1a934
Gitweb: https://git.kernel.org/tip/ae87405fb511d6220ce86b9a60807fef92e1a934
Author: Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxx>
AuthorDate: Thu, 14 Nov 2019 18:52:11 +05:30
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitterDate: Wed, 04 Dec 2019 12:27:14 -03:00

perf report/top TUI: Replace pr_err() with ui__error()

pr_err() in TUI mode does not print anyting on the screen and just
quits.

Replace such pr_err() with ui__error().

Before:

$ perf report -s +
$

After:

$ perf report -s +

ââError:âââââââââââââââââ
âInvalid --sort key: `+'â
â â
âPress any key... â
âââââââââââââââââââââââââ

Signed-off-by: Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxx>
Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Tested-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Link: http://lore.kernel.org/lkml/20191114132213.5419-2-ravi.bangoria@xxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/sort.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 345b5cc..106d795 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2681,12 +2681,12 @@ static int setup_sort_list(struct perf_hpp_list *list, char *str,
ret = sort_dimension__add(list, tok, evlist, level);
if (ret == -EINVAL) {
if (!cacheline_size() && !strncasecmp(tok, "dcacheline", strlen(tok)))
- pr_err("The \"dcacheline\" --sort key needs to know the cacheline size and it couldn't be determined on this system");
+ ui__error("The \"dcacheline\" --sort key needs to know the cacheline size and it couldn't be determined on this system");
else
- pr_err("Invalid --sort key: `%s'", tok);
+ ui__error("Invalid --sort key: `%s'", tok);
break;
} else if (ret == -ESRCH) {
- pr_err("Unknown --sort key: `%s'", tok);
+ ui__error("Unknown --sort key: `%s'", tok);
break;
}
}
@@ -2743,7 +2743,7 @@ static int setup_sort_order(struct evlist *evlist)
return 0;

if (sort_order[1] == '\0') {
- pr_err("Invalid --sort key: `+'");
+ ui__error("Invalid --sort key: `+'");
return -EINVAL;
}

@@ -3034,7 +3034,7 @@ static int __setup_output_field(void)
strp++;

if (!strlen(strp)) {
- pr_err("Invalid --fields key: `+'");
+ ui__error("Invalid --fields key: `+'");
goto out;
}