ps axH -opid,ppid,pidns -p 21503
lsns -p 21503
ls -iL /proc/21503/ns/pid
# -------------- trace script Java source ---------------- # | |
import com.sun.btrace.annotations.*; | |
import static com.sun.btrace.BTraceUtils.*; | |
import com.sun.btrace.AnyType; | |
@BTrace // (trusted=true) | |
public class Test { | |
@OnMethod( | |
clazz="java.net.ServerSocket", | |
method="bind" |
yum erase ais-vnic -y # 卸载ali-vnic | |
yum install teamd -y | |
systemctl daemon-reload # systemctl 更新配置 | |
modprobe bonding # teamd依赖 | |
modprobe team # teamd依赖的驱动 | |
ip link del bond0 # 删除bond 驱动新增的网卡 | |
systemctl restart network # 启动网络,teamd 后台进程会启动 ps auxf | grep teamd 查看确认 |
-- 分析 unreachable对象 https://wiki.eclipse.org/MemoryAnalyzer/FAQ#How_to_analyse_unreachable_objects | |
-consoleLog -application org.eclipse.mat.api.parse -keep_unreachable_objects <heapDump.bin> | |
-- 查询 非unreachable的对象,GCRootInfo null 表名此对象非GcRoot,MAT keepunreachable 对象时,unreachable对象的gcroot是自身 | |
SELECT * FROM byte[] s WHERE ((s.@length >= 2000000) and (s.@GCRootInfo = null)) |
grant codebase "file:${java.home}/../lib/tools.jar" { | |
permission java.security.AllPermission; | |
}; | |
jstatd -J-Djava.security.policy=jstatd.all.policy |
#!/bin/env bash | |
# -------------------------------------------- | |
# | |
# 网络丢包模拟工具 | |
# | |
# -------------------------------------------- | |
block(){ | |
interface=$1 |
import com.sun.btrace.annotations.*; | |
import com.sun.btrace.AnyType; | |
import static com.sun.btrace.BTraceUtils.*; | |
@BTrace | |
public class Q{ | |
@OnMethod( | |
clazz="java.nio.Buffer", | |
method="/.*/", | |
location=@Location(value=Kind.FIELD_SET, clazz="java.nio.Buffer", field="po |
import com.sun.btrace.annotations.*; | |
import com.sun.btrace.AnyType; | |
import static com.sun.btrace.BTraceUtils.*; | |
@BTrace | |
public class Q{ | |
@OnMethod( | |
clazz="java.nio.Buffer", | |
method="/.*/", | |
location=@Location(value=Kind.FIELD_SET, clazz="java.nio.Buffer", field="po |
import com.sun.btrace.annotations.*; | |
import com.sun.btrace.AnyType; | |
import static com.sun.btrace.BTraceUtils.*; | |
@BTrace | |
public class Q{ | |
@OnMethod( | |
clazz="java.nio.Buffer", | |
method="/.*/", | |
location=@Location(value=Kind.FIELD_SET, clazz="java.nio.Buffer", field="po |
stap -e 'probe kernel.function("tcp_recvmsg") {sp = @cast($sk, "inet_sock")->num; dp = @cast($sk, "inet_sock")->sport; if(sp == 9091){ printf("hell,world, %d, %x\n", sp, dp);}}' |