perf tools: Use ui__error() for reporting --fields errors
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 18 Jan 2018 13:28:14 +0000 (10:28 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 18 Jan 2018 13:28:14 +0000 (10:28 -0300)
commit56271170438df39c1b9a39c7aaf69010e6a4b59a
tree4c8faf7717dda651de409e2509df71dc75dd54c7
parent936f1f30bb7892f010670f1edebc419d47b139b1
perf tools: Use ui__error() for reporting --fields errors

So that we can get it working for TUI, where using just pr_err() would
end up making the message emitted to stderr to be erased by the TUI exit
routine restoring the terminal to its previous state.

Now we can see that trying to use a tracepoint field as one of the
--field entries isn't working:

  # perf top --stdio --no-children -e syscalls:sys_enter_write --fields pid,sym,count
  Error:
  Unknown --fields key: `count'
   Usage: perf top [<options>]

        --fields <key[,keys...]>
                          output field(s): overhead, period, sample plus all of sort keys
  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-usy9hhy7umdd4bbblkn63t8w@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/sort.c