forked from alibaba/TProfiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TProfile]:增加mysql的慢日志拦截;增加asm3的说明文档
- Loading branch information
Showing
15 changed files
with
645 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/taobao/profile/dependence_query/IClassAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.taobao.profile.dependence_query; | ||
|
||
import org.objectweb.asm.ClassAdapter; | ||
import org.objectweb.asm.ClassVisitor; | ||
|
||
/** | ||
* @author weigao | ||
* @since 15/5/25 | ||
*/ | ||
public abstract class IClassAdapter extends ClassAdapter { | ||
|
||
/** | ||
* 本地唯一的跟踪ID;使用纳秒作为标记 | ||
*/ | ||
protected long localTrackID; | ||
|
||
/** | ||
* asm注入的类名 | ||
*/ | ||
protected String mClassName; | ||
|
||
public IClassAdapter(ClassVisitor classVisitor, String theClass) { | ||
super(classVisitor); | ||
this.mClassName = theClass; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/taobao/profile/dependence_query/IMethodAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.taobao.profile.dependence_query; | ||
|
||
import com.taobao.profile.Profiler; | ||
import com.taobao.profile.runtime.MethodCache; | ||
import org.objectweb.asm.MethodAdapter; | ||
import org.objectweb.asm.MethodVisitor; | ||
|
||
/** | ||
* @author weigao | ||
* @since 15/5/25 | ||
*/ | ||
public abstract class IMethodAdapter extends MethodAdapter { | ||
|
||
/** | ||
* 方法ID | ||
*/ | ||
protected int mMethodId = 0; | ||
|
||
public IMethodAdapter(MethodVisitor methodVisitor,String fileName, String className, String methodName) { | ||
super(methodVisitor); | ||
mMethodId = MethodCache.Request(); | ||
MethodCache.UpdateMethodName(mMethodId, fileName, className, methodName); | ||
// 记录方法数 | ||
Profiler.instrumentMethodCount.getAndIncrement(); | ||
} | ||
|
||
} |
Oops, something went wrong.