#!/bin/bash
#PID=`ps aux | grep java | head -1 | awk '{print $2}'`
PID=` ps aux | grep -v grep|grep java |awk '{print $2}' | tail -n1`
ps -mp $PID -o THREAD,tid,time | sort -k 2 -r | head -20
#该脚本目前只能看didi的进程信息,尚未做优化;
echo -n -e "\nPlease import check PID:"
read f
if [ -z $f ]
then
echo "no"
else
jstack "$PID" | grep `printf "%x\n" $f` -A 30
fi
原文地址:http://blog.51cto.com/amunlinux/2132832
时间: 2024-11-01 19:03:24