登录 注册
当前位置:主页 > 资源下载 > 10 > JVMTI日志输出示例

JVMTI日志输出示例

  • 更新:2024-11-28 09:08:14
  • 大小:2KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Java - 后端
  • 格式:RAR

资源介绍

JVMTI例子 截获方法进入和退出,并打印时间日志 0、安装gcc 1、tracer.c拷贝到/home/java/jvmti,修改c程序的TRACE_CLSNAME为需要拦截的包 2、敲入命令 BASE_HOME='/home/java/jvmti' INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux" gcc $BASE_HOME/tracer.c -fpic $INCLUDES -shared -o $BASE_HOME/tracer.so 3、在jboss启动脚本的java参数中加入 -agentpath:/home/java/jvmti/tracer.so=/home/java/jvmti/trace_log.txt 输入日志格式类似 CALL Lcom/xxx/cc/test/Mtrace; | | ()V | 2013/6/13 8:38:46 | Exit Lcom/xxx/cc/test/Mtrace; | | ()V | 2013/6/13 8:38:46 | CALL Lcom/xxx/cc/test/Mtrace; | main | ([Ljava/lang/String;)V | 2013/6/13 8:38:46 | CALL Lcom/xxx/cc/test/Mtrace; | themytest | ()V | 2013/6/13 8:38:46 | Exit Lcom/xxx/cc/test/Mtrace; | themytest | ()V | 2013/6/13 8:38:46 | Exit Lcom/xxx/cc/test/Mtrace; | main | ([Ljava/lang/String;)V | 2013/6/13 8:38:46 |