Skip to content

Commit

Permalink
perf report/top TUI: Replace pr_err() with ui__error()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jin Yao <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Ravi Bangoria authored and acmel committed Dec 4, 2019
1 parent 9f58c93 commit ae87405
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/perf/util/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

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

Expand Down

0 comments on commit ae87405

Please sign in to comment.