* perf tracepoints for regular user?
@ 2016-01-15 21:05 Benjamin King
2016-01-17 21:20 ` Milian Wolff
0 siblings, 1 reply; 8+ messages in thread
From: Benjamin King @ 2016-01-15 21:05 UTC (permalink / raw)
To: Linux perf users
Hi,
I am trying to use 'perf stat -e uprobes:xyz' on a tracepoint that I have
previously set, but with no success.
I thought that I should be able to do that when allowing my user access to
debugfs, but this is what I get:
$ id -u;id -g
1001
1001
$ mount|grep debug
none on /sys/kernel/debug type debugfs (rw,uid=1001,gid=1001)
$ ls /sys/kernel/debug
acpi bluetooth cleancache dell_laptop dri extfrag ...
$ ls /sys/kernel/debug/tracing/
ls: cannot open directory /sys/kernel/debug/tracing/: Permission denied
So, my user can't look in the tracing subdirectory and perf list doesn't show
the uprobes either.
I have also tried to ´sudo setcap cap_sys_admin+eip $(which perf)´, also
without success.
Any ideas?
Thanks,
Benjamin King
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: perf tracepoints for regular user?
2016-01-15 21:05 perf tracepoints for regular user? Benjamin King
@ 2016-01-17 21:20 ` Milian Wolff
2016-01-17 21:56 ` Milian Wolff
2016-01-19 5:02 ` Benjamin King
0 siblings, 2 replies; 8+ messages in thread
From: Milian Wolff @ 2016-01-17 21:20 UTC (permalink / raw)
To: Benjamin King; +Cc: Linux perf users
[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]
On Freitag, 15. Januar 2016 22:05:16 CET Benjamin King wrote:
> Hi,
>
> I am trying to use 'perf stat -e uprobes:xyz' on a tracepoint that I have
> previously set, but with no success.
> I thought that I should be able to do that when allowing my user access to
> debugfs, but this is what I get:
>
> $ id -u;id -g
> 1001
> 1001
> $ mount|grep debug
> none on /sys/kernel/debug type debugfs (rw,uid=1001,gid=1001)
> $ ls /sys/kernel/debug
> acpi bluetooth cleancache dell_laptop dri extfrag ...
> $ ls /sys/kernel/debug/tracing/
> ls: cannot open directory /sys/kernel/debug/tracing/: Permission denied
>
> So, my user can't look in the tracing subdirectory and perf list doesn't
> show the uprobes either.
>
> I have also tried to ´sudo setcap cap_sys_admin+eip $(which perf)´, also
> without success.
Try these commands:
$ sudo mount -o remount,mode=755 /sys/kernel/debug
$ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
$ echo \"-1\" | sudo tee /proc/sys/kernel/perf_event_paranoid
HTH
--
Milian Wolff | milian.wolff@kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5903 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: perf tracepoints for regular user?
2016-01-17 21:20 ` Milian Wolff
@ 2016-01-17 21:56 ` Milian Wolff
2016-01-19 5:02 ` Benjamin King
1 sibling, 0 replies; 8+ messages in thread
From: Milian Wolff @ 2016-01-17 21:56 UTC (permalink / raw)
To: Benjamin King; +Cc: Linux perf users
[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]
On Sonntag, 17. Januar 2016 22:20:00 CET Milian Wolff wrote:
> On Freitag, 15. Januar 2016 22:05:16 CET Benjamin King wrote:
> > Hi,
> >
> > I am trying to use 'perf stat -e uprobes:xyz' on a tracepoint that I have
> > previously set, but with no success.
> > I thought that I should be able to do that when allowing my user access to
> > debugfs, but this is what I get:
> >
> > $ id -u;id -g
> > 1001
> > 1001
> > $ mount|grep debug
> > none on /sys/kernel/debug type debugfs (rw,uid=1001,gid=1001)
> > $ ls /sys/kernel/debug
> > acpi bluetooth cleancache dell_laptop dri extfrag ...
> > $ ls /sys/kernel/debug/tracing/
> > ls: cannot open directory /sys/kernel/debug/tracing/: Permission denied
> >
> > So, my user can't look in the tracing subdirectory and perf list doesn't
> > show the uprobes either.
> >
> > I have also tried to ´sudo setcap cap_sys_admin+eip $(which perf)´, also
> > without success.
>
> Try these commands:
>
> $ sudo mount -o remount,mode=755 /sys/kernel/debug
> $ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
> $ echo \"-1\" | sudo tee /proc/sys/kernel/perf_event_paranoid
(minus the escaping, copy'n'paste fail from a slide of mine)
--
Milian Wolff | milian.wolff@kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5903 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: perf tracepoints for regular user?
2016-01-17 21:20 ` Milian Wolff
2016-01-17 21:56 ` Milian Wolff
@ 2016-01-19 5:02 ` Benjamin King
2016-01-19 22:18 ` Arnaldo Carvalho de Melo
1 sibling, 1 reply; 8+ messages in thread
From: Benjamin King @ 2016-01-19 5:02 UTC (permalink / raw)
To: Milian Wolff; +Cc: Linux perf users
Hi Milian,
On Sun, Jan 17, 2016 at 10:20:00PM +0100, Milian Wolff wrote:
>On Freitag, 15. Januar 2016 22:05:16 CET Benjamin King wrote:
>> I am trying to use 'perf stat -e uprobes:xyz' on a tracepoint that I have
>> previously set, but with no success.
>Try these commands:
>
>$ sudo mount -o remount,mode=755 /sys/kernel/debug
>$ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
>$ echo \"-1\" | sudo tee /proc/sys/kernel/perf_event_paranoid
Hm, that does not work for me. I can do the first remount, but not the
second:
-----
$ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
mount: can't find /sys/kernel/debug/tracing in /etc/fstab
$ mount|grep debug
none on /sys/kernel/debug type debugfs (rw,mode=755,mode=755)
-----
And then, I still can not see tracepoints as a regular user:
-----
$ perf list tracepoint
List of pre-defined events (to be used in -e):
$
-----
If this works for you, then maybe it's my version? I'm on 4.2.3
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: perf tracepoints for regular user?
2016-01-19 5:02 ` Benjamin King
@ 2016-01-19 22:18 ` Arnaldo Carvalho de Melo
2016-01-20 11:50 ` Aw: " Benjamin King
0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-19 22:18 UTC (permalink / raw)
To: Benjamin King; +Cc: Milian Wolff, Linux perf users
Em Tue, Jan 19, 2016 at 06:02:44AM +0100, Benjamin King escreveu:
> Hi Milian,
>
> On Sun, Jan 17, 2016 at 10:20:00PM +0100, Milian Wolff wrote:
> >On Freitag, 15. Januar 2016 22:05:16 CET Benjamin King wrote:
> >>I am trying to use 'perf stat -e uprobes:xyz' on a tracepoint that I have
> >>previously set, but with no success.
> >Try these commands:
> >
> >$ sudo mount -o remount,mode=755 /sys/kernel/debug
> >$ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
> >$ echo \"-1\" | sudo tee /proc/sys/kernel/perf_event_paranoid
>
> Hm, that does not work for me. I can do the first remount, but not the
> second:
> -----
> $ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
> mount: can't find /sys/kernel/debug/tracing in /etc/fstab
> $ mount|grep debug
> none on /sys/kernel/debug type debugfs (rw,mode=755,mode=755)
> -----
Ok, your kernel is old and doesn't have the tracefs:
[acme@zoo ~]$ mount | egrep \(debug\|trace\)fs
debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel,mode=755)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime,mode=755)
[acme@zoo ~]$
> And then, I still can not see tracepoints as a regular user:
> -----
> $ perf list tracepoint
>
> List of pre-defined events (to be used in -e):
>
> $ -----
>
> If this works for you, then maybe it's my version? I'm on 4.2.3
[acme@zoo ~]$ uname -r
4.3.0+
But on another machine, oops, I thought it was older, in fact it is newer :-\
[root@jouet images]# uname -r
4.3.3-300.fc23.x86_64
[root@jouet images]# mount | egrep \(trace\|debug\)fs
debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
[root@jouet images]#
^ permalink raw reply [flat|nested] 8+ messages in thread
* Aw: Re: perf tracepoints for regular user?
2016-01-19 22:18 ` Arnaldo Carvalho de Melo
@ 2016-01-20 11:50 ` Benjamin King
2016-01-21 14:05 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 8+ messages in thread
From: Benjamin King @ 2016-01-20 11:50 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: linux-perf-users
Hi Arnaldo,
> > $ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
> > mount: can't find /sys/kernel/debug/tracing in /etc/fstab
> > $ mount|grep debug
> > none on /sys/kernel/debug type debugfs (rw,mode=755,mode=755)
>
> Ok, your kernel is old and doesn't have the tracefs:
>
>
> [acme@zoo ~]$ mount | egrep \(debug\|trace\)fs
> debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel,mode=755)
> tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime,mode=755)
> [...]
> [acme@zoo ~]$ uname -r
> 4.3.0+
That's odd. According to kernelnewbies.org (Yes, I am that much of a kernel hacker :-) ), tracefs should be in since 4.1 and I'm on 4.2, but I can only find CONFIG_DEBUG_FS in my kernel configuration. There is no mentioning of a corresponding CONFIG_TRACE_FS there.
I'll try to upgrade to a more recent kernel and stop bugging you guys until then.
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: perf tracepoints for regular user?
2016-01-20 11:50 ` Aw: " Benjamin King
@ 2016-01-21 14:05 ` Arnaldo Carvalho de Melo
2016-01-25 15:43 ` Benjamin King
0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-21 14:05 UTC (permalink / raw)
To: Benjamin King; +Cc: linux-perf-users
Em Wed, Jan 20, 2016 at 12:50:33PM +0100, Benjamin King escreveu:
> Hi Arnaldo,
>
> > > $ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
> > > mount: can't find /sys/kernel/debug/tracing in /etc/fstab
> > > $ mount|grep debug
> > > none on /sys/kernel/debug type debugfs (rw,mode=755,mode=755)
> >
> > Ok, your kernel is old and doesn't have the tracefs:
Not having tracefs, if that is indeed the case, only means that the
remount isn't needed, as what is in tracefs is what, before its
existence, lived in a debugfs directory, /sys/kernel/debug/tracing, i.e.
remounting just /sys/kernel/debug/ would then be enough.
> > [acme@zoo ~]$ mount | egrep \(debug\|trace\)fs
> > debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel,mode=755)
> > tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime,mode=755)
> > [...]
> > [acme@zoo ~]$ uname -r
> > 4.3.0+
> That's odd. According to kernelnewbies.org (Yes, I am that much of a
> kernel hacker :-) ), tracefs should be in since 4.1 and I'm on 4.2,
> but I can only find CONFIG_DEBUG_FS in my kernel configuration. There
> is no mentioning of a corresponding CONFIG_TRACE_FS there.
> I'll try to upgrade to a more recent kernel and stop bugging you guys until then.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: perf tracepoints for regular user?
2016-01-21 14:05 ` Arnaldo Carvalho de Melo
@ 2016-01-25 15:43 ` Benjamin King
0 siblings, 0 replies; 8+ messages in thread
From: Benjamin King @ 2016-01-25 15:43 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: linux-perf-users
On Thu, Jan 21, 2016 at 11:05:05AM -0300, Arnaldo Carvalho de Melo wrote:
>Not having tracefs, if that is indeed the case, only means that the
>remount isn't needed, as what is in tracefs is what, before its
>existence, lived in a debugfs directory, /sys/kernel/debug/tracing, i.e.
>remounting just /sys/kernel/debug/ would then be enough.
I could not make /sys/kernel/debug/tracing available to a regular users even
after upgrading to kernel 4.4, so I just did a desperate system upgrade and -
lo and behold - it now works, by which I mean
1) tracefs is mounted and when remounted world readable...
2) ...regular users can read /sys/kernel/debug/tracing/uprobe_events and...
3) ...see the probes in perf and...
4) ...use them for tracing.
So it was all my fault, being too lazy to upgrade, thanks for the help and
sorry for the noise!
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-01-25 15:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 21:05 perf tracepoints for regular user? Benjamin King
2016-01-17 21:20 ` Milian Wolff
2016-01-17 21:56 ` Milian Wolff
2016-01-19 5:02 ` Benjamin King
2016-01-19 22:18 ` Arnaldo Carvalho de Melo
2016-01-20 11:50 ` Aw: " Benjamin King
2016-01-21 14:05 ` Arnaldo Carvalho de Melo
2016-01-25 15:43 ` Benjamin King
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).