Bug 100781 - Avoid confusing messages when not able to read trace events files
Summary: Avoid confusing messages when not able to read trace events files
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Tracing/Profiling
Classification: Unclassified
Component: Perf tool (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Arnaldo Carvalho de Melo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-01 21:34 UTC by Arnaldo Carvalho de Melo
Modified: 2022-01-21 07:39 UTC (History)
2 users (show)

See Also:
Kernel Version: All
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Arnaldo Carvalho de Melo 2015-07-01 21:34:50 UTC
If a non-root user tries to specify a trace event and the tracefs files can't be read, it will tell about it in a somewhat cryptic way and as well say that the tracepoint is unknown, which is obvious, since the tracefs files were not read.

Current output:

[acme@zoo linux]$ perf record -e sched:sched_switch* usleep 1
Can't open event dir: Permission denied
event syntax error: 'sched:sched_switch*'
                     \___ unknown tracepoint
Run 'perf list' for a list of valid events

 usage: perf record [<options>] [<command>]
    or: perf record [<options>] -- <command> [<options>]

    -e, --event <event>   event selector. use 'perf list' to list available events
[acme@zoo linux]$

------------

It should instead restrict it to the first line and improve it to provide a hint, like the one provided by the 'perf trace' tool:

[acme@zoo linux]$ trace usleep 1
Error:	No permissions to read /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit)
Hint:	Try 'sudo mount -o remount,mode=755 /sys/kernel/debug'

[acme@zoo linux]$
Comment 2 Ian Rogers 2022-01-21 07:39:15 UTC
This was fixed by acme in 4.4 :-)
https://lore.kernel.org/lkml/1442330917-21464-1-git-send-email-acme@kernel.org/

Note You need to log in before you can comment on or make changes to this bug.