Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot run off-CPU profiling in Ubuntu 22.04 #519

Closed
lengocthuong15 opened this issue Oct 10, 2023 · 1 comment · Fixed by #520
Closed

Cannot run off-CPU profiling in Ubuntu 22.04 #519

lengocthuong15 opened this issue Oct 10, 2023 · 1 comment · Fixed by #520
Labels

Comments

@lengocthuong15
Copy link

Describe the bug
When I run the program and check for off-CPU profiling, an error shows up, it is about invalid event sched:sched_switch

To Reproduce
Steps to reproduce the behavior:

  1. Open Hotspot UI, record data
  2. Select Attach to Processes
  3. Tick on: Elevate Privilege and Off-CPU profiling
  4. And error shows: Failed to record perf data, error code 129
$ perf record -o /home/build/perf.data --call-graph dwarf --event cycles --switch-events --event sched:sched_switch --pid 1648
event syntax error: 'sched:sched_switch'
                     \___ unsupported tracepoint

libtraceevent is necessary for tracepoint support
Run 'perf list' for a list of valid events

Expected behavior
Can record data with Off-CPU profiling

Version Info (please complete the following information):

  • Linux Kernel version:6.2.0-34-generic
  • perf version:6.2.16
  • hotspot version (appimage? selfcompiled?): Ubuntu 22.04. Install from source list
@lievenhey
Copy link
Contributor

Can you check if perf is compiled with with libtraceevent support? perf version --build-options

On my ubuntu VM it reports

....
libtraceevent: [ OFF ]  # HAVE_LIBTRACEEVENT

in this case you have to build perf yourself

lievenhey added a commit that referenced this issue Oct 11, 2023
Some distros **cough** ubuntu **cough** build perf without libtraceevent
support. In this case tracepoints obviosly don't work. This patch adds
a check for this and shows the user an error message.

closes: #519
lievenhey added a commit that referenced this issue Oct 11, 2023
Some distros **cough** ubuntu **cough** build perf without libtraceevent
support. In this case tracepoints obviosly don't work. This patch adds
a check for this and shows the user an error message.

closes: #519
milianw pushed a commit that referenced this issue Oct 11, 2023
Some distros **cough** ubuntu **cough** build perf without libtraceevent
support. In this case tracepoints obviosly don't work. This patch adds
a check for this and shows the user an error message.

closes: #519
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants