linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milian Wolff <milian.wolff@kdab.com>
To: linux-perf-users <linux-perf-users@vger.kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: /sys/kernel/tracing/events permissions
Date: Mon, 22 Nov 2021 11:55:11 +0100	[thread overview]
Message-ID: <2315137.Eos4xDj3du@milian-workstation> (raw)

[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]

Hello,

a recent kernel update on my arch system has lead to breakage with regard to 
accessing trace events from perf. For example:

```
$ perf record -e sched:sched_switch ls 
event syntax error: 'sched:sched_switch'
                     \___ can't access trace events

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

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
```

When I then try to run the remount hint from the message above, which used to 
work just fine, then the error persists, because:

```
$ mount | grep tracing
tracefs on /sys/kernel/tracing type tracefs 
(rw,nosuid,nodev,noexec,relatime,mode=755)
tracefs on /sys/kernel/debug/tracing type tracefs 
(rw,nosuid,nodev,noexec,relatime,mode=755)
```

and:

```
$ ls -ld /sys/kernel/tracing/
drwxr-xr-x root root 0 B Mon Nov 22 08:39:15 2021 /sys/kernel/tracing/
$ ls -ld /sys/kernel/tracing/events/
drwxr-x--- root root 0 B Mon Nov 22 08:39:26 2021 /sys/kernel/tracing/events/
```

How should this be handled? Is it now required to manually `chmod` the 
`events` folder, or is there another means to allow non-root to record kernel 
trace events?

Thanks

-- 
Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5272 bytes --]

             reply	other threads:[~2021-11-22 11:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 10:55 Milian Wolff [this message]
2021-11-22 15:02 ` /sys/kernel/tracing/events permissions Arnaldo Carvalho de Melo
2021-11-22 17:01   ` Steven Rostedt
2021-11-22 18:37     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2315137.Eos4xDj3du@milian-workstation \
    --to=milian.wolff@kdab.com \
    --cc=acme@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).