tools lib api fs: Store tracing mountpoint for better error message
authorJiri Olsa <jolsa@kernel.org>
Sat, 19 Sep 2015 14:47:07 +0000 (16:47 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 Sep 2015 18:50:54 +0000 (15:50 -0300)
commitdc240c5dc2a02e335c5bcb50ad3a1274818c8609
treeeddd6aeca2ce858c2beaba83bf392db6fe6aadfe
parentab9c2bdc8947482057b81258c0128952763661cb
tools lib api fs: Store tracing mountpoint for better error message

Storing the actual tracing path mountpoint to display correct
error message hint ('Hint:' line). The error hint rediscovers
mountpoints, but it could be different from what we actually
used in tracing path.

Before we'd display debugfs mount even though tracefs was used:
  $ perf record -e sched:sched_krava ls
  event syntax error: 'sched:sched_krava'
                       \___ can't access trace events

  Error:  No permissions to read /sys/kernel/debug/tracing/events/sched/sched_krava
  Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug'
  ...

After this change, correct mountpoint is displayed:
  $ perf record -e sched:sched_krava ls
  event syntax error: 'sched:sched_krava'
                       \___ can't access trace events

  Error:  No permissions to read /sys/kernel/debug/tracing/events/sched/sched_krava
  Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
  ...

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Raphael Beamonte <raphael.beamonte@gmail.com>
Link: http://lkml.kernel.org/r/1442674027-19427-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/api/fs/tracing_path.c