zoukankan      html  css  js  c++  java
  • trace openjdk from systemtap

    here are several different tactics to trace openjdk from systemtap.

    The first relies on sys/sdt.h dtrace-style markers compiled into the JVM, but not dbgsym data:

    % stap -L 'process("/usr/lib/jvm/java*/jre/lib/*/server/libjvm.so").mark("*")'
    

    If this shows an empty result, (and if I have the ubuntu libjvm.so path right), then this suggests your openjdk was compiled without the sys/sdt.h stuff, so this option is closed to you. If it shows a lovely list, you can use those .mark probes directly, or snarf/adapt a copy of the hotspot*.stp tapset sources from anywhere and transcribe it into your .stp file, or let stap find it via

    % stap -I PATH ...
    

    The second method relies on dwarf debuginfo compiled into the JVM, for which the dbgsym* stuff should be handy. If that is installed properly,

    % stap -L 'process("/usr/lib/jvm/java*/jre/lib/*/server/libjvm.so").function("*")'
    

    should show a gajillion functions. You may not have the benefit of tapsets, but with clever choice of functions, you should be able to get some decent tracing going.

    The third method relies on byteman to do intra-JVM self-instrumentation under systemtap control. This requires no java dbgsym, but does require byteman and a bunch of auxiliary stuff. If this is available and compiled into the ubuntu systemtap, then something like:

    % stap -e 'probe java("org.my.MyApp").class("^java.lang.Object").method("foo(int)")
               { println($$parms) }'
  • 相关阅读:
    ubuntu 18.04 搭建flask服务器(大合集,个人实操)
    Ubuntu18.04下Git安装及使用
    c#随机打乱数组
    c#递归获取目录下所有文件名称
    授人以渔:Keil配色界面较为详细的解释
    k8s存储资源之持久化存储资源存储卷PV与PVC理解与应用(七)
    Servlet总结
    Linux 系统目录结构
    make 编译笔记
    【Linux】Linux网络编程
  • 原文地址:https://www.cnblogs.com/zengkefu/p/5632780.html
Copyright © 2011-2022 走看看