Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

USDT java guide #78

Open
sebastiaoamaro opened this issue Oct 26, 2023 · 2 comments
Open

USDT java guide #78

sebastiaoamaro opened this issue Oct 26, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@sebastiaoamaro
Copy link

Hi everyone, I was following the guide in [1], however, when attaching the usdt it fails with the error:

libbpf: usdt: no USDT notes section (.note.stapsdt) found in '/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so'

Which I believe to be caused by not having dtrace enabled in the JVM, however, I can not find any guide/tutorial to enabling it.
Sorry for the unrelated question to eBPF, but did you enable anything to run java USDT? or use a specific java version?

Thanks in advance.
[1]https://github.com/eunomia-bpf/bpf-developer-tutorial/tree/main/src/15-javagc

@yunwei37 yunwei37 added the help wanted Extra attention is needed label Nov 11, 2023
@lcxjy
Copy link

lcxjy commented Feb 28, 2024

我也遇到了这个问题,但是并没有找到解决方法
"I have also encountered this problem, but have not found a solution yet."

@fuwx295
Copy link

fuwx295 commented Jul 15, 2024

@lcxjy
@sebastiaoamaro
USDT requires JDK support (set --enable-dtrace when compiling the JVM)
To determine whether the current JDK supports USDT, enter the following command

readelf -n /path/to/openjdk/lib/server/libjvm.so

If it does, the following message will be displayed, otherwise, it means that the current JDK does not support USDT.

stapsdt              0x0000002f       NT_STAPSDT (SystemTap probe descriptors)
    Provider: hotspot
    Name: thread__yield
    Location: 0x000000000098745b, Base: 0x000000000107e7f4, Semaphore: 0x0000000000000000
    Arguments: 
  stapsdt              0x0000003d       NT_STAPSDT (SystemTap probe descriptors)
    Provider: hotspot
    Name: thread__sleep__begin
    Location: 0x000000000098ff64, Base: 0x000000000107e7f4, Semaphore: 0x0000000000000000
    Arguments: -8@%r12
  stapsdt              0x00000039       NT_STAPSDT (SystemTap probe descriptors)
    Provider: hotspot
    Name: thread__sleep__end
    Location: 0x000000000098ffa3, Base: 0x000000000107e7f4, Semaphore: 0x0000000000000000
    Arguments: -4@$0
  stapsdt              0x00000039       NT_STAPSDT (SystemTap probe descriptors)
    Provider: hotspot
    Name: thread__sleep__end
    Location: 0x0000000000990100, Base: 0x000000000107e7f4, Semaphore: 0x0000000000000000
    Arguments: -4@$1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants