[PATCH v2 1/3] perf hists: Replace pr_err with ui__error

From: Ravi Bangoria
Date: Thu Nov 14 2019 - 08:23:03 EST


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>
---
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 43d1d410854a..cba8f22e4ffb 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2696,12 +2696,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;
}
}
@@ -2758,7 +2758,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;
}

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

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

--
2.21.0