jacoco0.8.8源码分享
2023-05-08 09:10:13 5 举报
分享一点java agent的知识
作者其他创作
大纲/内容
cv.visitMethod
startup()
CoverageTransformer
new AgentOptions(options)参数初始化
instrument
CoverageTransformer对象创建
new MethodInstrumenter
runtime.startup($jacocoAccess)
PreMain
step2javaagent采集覆盖率
dump参数classdumpdir开关
createFor
ModifiedSystemClassRuntime
startup(final RuntimeData data)
transform
ClassVisitor
createRuntime(inst)
Instrumenter
reader.accept
new ClassInstrumenter
ProbeArrayStrategyFactory
Agent
业务类
step1javaagent初始化
reader.accept(new ClassVisitor***)
inst.addTransformer
new ClassProbesAdapter
ClassFileDumper
visitMethod
createAgentOutput,根据Output参数file、tcpserver、tcpclient、none
ClassInstrumenter
返回接口或类的策略ClassFieldProbeArrayStrategyInterfaceFieldProbeArrayStrategy
Agent.getInstance
业务方法被调用
new ClassReadernew ClassWriter
new ProbeInserter
new DuplicateFrameEliminator
0 条评论
下一页