perf broken on hwe kernel 5.0.0-23
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-hwe (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
After enabling the hwe stack on ubuntu 18.04, perf no longer reports events
$ perf --version
perf version 5.0.15
$ uname -a
Linux ripper 5.0.0-23-generic #24~18.04.1-Ubuntu SMP Mon Jul 29 16:12:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Results: perf does not report events
Output of `perf top -p <PID>` looks like this:
Samples: 0 of event 'cycles', 4000 Hz, Event count (approx.): 0 lost: 0/0 drop: 0/0
Overhead
Expected results: events reported
Additional info:
- HWE stack was updated the standard way:
sudo apt install --install-
- perf worked fine on linux kernel 4.15.0-55-generic (non-hwe)
- the bug reproduces on the following architectures
AMD Threadripper 1950X
AMD Opteron 6376
Intel Core i7-8650U
Changed in linux-hwe (Ubuntu): | |
status: | Confirmed → Fix Released |
With Linux and perf 4.15.0-55-generic (non-HWE), it works as reported in Ubuntu 18.04.3 LTS:
Versions
--------
$ uname -r
4.15.0-55-generic
$ perf --version
perf version 4.15.18
In dpkg:
ii linux-image- 4.15.0- 55-generic 4.15.0-55.60 amd64 Signed kernel image generic
ii linux-tools-common 4.15.0-55.60 all Linux kernel version specific tools for version 4.15.0
ii linux-tools- 4.15.0- 55-generic 4.15.0-55.60 amd64 Linux kernel version specific tools for version 4.15.0-55
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.)
What actually happened ------- ------- -
-------
I see this, so it works:
Samples: 136 of event 'cycles:ppp', Event count (approx.): 54426558 return_ via_sysret __strtoull_ l_internal
Overhead Shared Object Symbol
8.48% libc-2.27.so [.] _IO_vfscanf
6.49% [kernel] [k] do_syscall_64
4.06% [kernel] [k] pid_revalidate
3.50% [kernel] [k] syscall_
3.05% [kernel] [k] vsnprintf
2.90% [kernel] [k] get_pid_task
2.88% [kernel] [k] seq_put_decimal_ull
2.75% [kernel] [k] __task_pid_nr_ns
2.74% [kernel] [k] seq_put_decimal_ll
2.71% libc-2.27.so [.] __GI___
2.41% [kernel] [k] format_decode
2.38% [kernel] [k] memcpy_erms
2.18% libc-2.27.so [.] vfprintf
1.93% [kernel] [k] pid_nr_ns
1.79% [kernel] [k] __d_lookup_rcu
1.63% [kernel] [k] rcu_all_qs
1.58% [kernel] [k] filldir
1.39% [kernel] [k] render_sigset_t
System calls
------------
perf_event_open System calls:
$ strace perf top -p `pidof top` 2>&1 | grep ^perf_event_open open({type= PERF_TYPE_ HARDWARE, size=PERF_ ATTR_SIZE_ VER5, config= PERF_COUNT_ HW_CPU_ CYCLES, ...}, 0, -1, -1, 0) = 3 open({type= PERF_TYPE_ SOFTWARE, size=0 /* PERF_ATTR_SIZE_??? */, config= PERF_COUNT_ SW_CPU_ CLOCK, ...}, -1, 6, -1, PERF_FLAG_ FD_CLOEXEC) = 3 open({type= PERF_TYPE_ HARDWARE, size=PERF_ ATTR_SIZE_ VER5, config= PERF_COUNT_ HW_CPU_ CYCLES, ...}, -1, 0, -1, PERF_FLAG_ FD_CLOEXEC) = 3 open({type= PERF_TYPE_ HARDWARE, size=PERF_ ATTR_SIZE_ VER5, config= PERF_COUNT_ HW_CPU_ CYCLES, ...}, -1, 0, -1, PERF_FLAG_ FD_CLOEXEC) = 3 open({type= PERF_TYPE_ HARDWARE, size=PERF_ ATTR_SIZE_ VER5, config= PERF_COUNT_ HW_CPU_ CYCLES, ...}, 12089, -1, -1, PERF_FLAG_ FD_CLOEXEC) = 3
perf_event_
perf_event_
perf_event_
perf_event_
perf_event_