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
amd64Signed kernel image generic
ii
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-235.0.0-23.24~18.04.1 all
ii
After some investigation, I found this:
If I use the perf executable from the package linux-tools-4.15.0-55-generic
along with the Linux kernel 5.0.0-23-generic from the package
linux-image-5.0.0-23-generic , it works.
$ /usr/lib/linux-tools/4.15.0-55-generic/perf top -p `pidof top`
Samples: