With Linux and perf 5.0.0-23-generic (HWE or Hardware Enablement), it is
broken.


Versions
--------

$ uname -r
5.0.0-23-generic
$ perf --version
perf version 5.0.15

$ dpkg -l|grep 5.0.0-23|awk '{print $1,$2,$3,$4}'|column -t
ii  linux-headers-5.0.0-23                5.0.0-23.24~18.04.1  all
ii  linux-headers-5.0.0-23-generic        5.0.0-23.24~18.04.1  amd64
ii  linux-hwe-tools-5.0.0-23              5.0.0-23.24~18.04.1  amd64
ii  linux-image-5.0.0-23-generic          5.0.0-23.24~18.04.1  amd64
ii  linux-modules-5.0.0-23-generic        5.0.0-23.24~18.04.1  amd64
ii  linux-modules-extra-5.0.0-23-generic  5.0.0-23.24~18.04.1  amd64
ii  linux-tools-5.0.0-23-generic          5.0.0-23.24~18.04.1  amd64


A minimal series of steps necessary to make it happen
-----------------------------------------------------

1. In a terminal tab., run:
    $ top

2. In another tab, run
    $ perf top -p `pidof top`

3. Look at the output of "perf top".


What you expected to happen
---------------------------

I expect to see "cycles" events being reported for the process "top"
(started at step 1.)

See section "What actually happened" in comment #1 above.


What actually happened
----------------------

The output of "perf top -p `pidof top`" (step 2) is:


Samples: 0  of event 'cycles:ppp', 4000 Hz, Event count (approx.): 0 lost: 0/0 
drop: 0/0
Overhead  


It is as if there are no events being sampled.


System calls
------------

perf_event_open System calls:

$ strace perf top -p `pidof top` 2>&1 | grep ^perf_event_open
perf_event_open({type=PERF_TYPE_HARDWARE, size=PERF_ATTR_SIZE_VER5, 
config=PERF_COUNT_HW_CPU_CYCLES, ...}, 0, -1, -1, 0) = 3
perf_event_open({type=PERF_TYPE_SOFTWARE, size=0 /* PERF_ATTR_SIZE_??? */, 
config=PERF_COUNT_SW_CPU_CLOCK, ...}, -1, 2, -1, PERF_FLAG_FD_CLOEXEC) = 3
perf_event_open({type=PERF_TYPE_HARDWARE, size=PERF_ATTR_SIZE_VER5, 
config=PERF_COUNT_HW_CPU_CYCLES, ...}, -1, 0, -1, PERF_FLAG_FD_CLOEXEC) = 3
perf_event_open({type=PERF_TYPE_HARDWARE, size=PERF_ATTR_SIZE_VER5, 
config=PERF_COUNT_HW_CPU_CYCLES, ...}, -1, 0, -1, PERF_FLAG_FD_CLOEXEC) = 3
perf_event_open({type=PERF_TYPE_HARDWARE, size=PERF_ATTR_SIZE_VER5, 
config=PERF_COUNT_HW_CPU_CYCLES, ...}, 4035, -1, -1, PERF_FLAG_FD_CLOEXEC) = 3


Additional note
---------------

Using the full path to perf 5.0.0-23 also produce 0 events.

$ /usr/lib/linux-tools/5.0.0-23-generic/perf top -p `pidof top`

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1839852

Title:
  perf broken on hwe kernel 5.0.0-23

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-hwe/+bug/1839852/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to